忍者ブログ

鯖設定とプログラム

メモ。

<< | 2024/05 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | >>

[PR]

×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

PHP5.3.8にアップグレードする RHEL4(RedHat Enterprise Linux ES v4)

curlを有効にしたかったので、ついでに何年ぶりかにPHPをアップグレードした。

PHP5.2.5からPHP5.3.8にサーバをアップグレードする。

前回のPHP5.2.4からPHP5.2.5にアップグレードと同様にインストールしてみる。

# cd /usr/local/src/

# wget http://jp.php.net/get/php-5.3.8.tar.gz/from/a/mirror
# ls -al
php-5.3.8.tar.bz2

# tar jxvf php-5.3.8.tar.bz2
# cd php-5.3.8

# ../configure --prefix=/usr/local --bindir=/usr/local/bin/ --with-apxs2=/usr/sbin/apxs --with-mysql=/usr --enable-mbstring --enable-mbregex --with-freetype-dir=/usr --with-png-dir=/usr --with-gd --enable-gd-native-ttf --with-gettext --with-gmp --with-iconv --with-jpeg -dir=/usr --with-openssl --with-pspell --with-regex --with-zlib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quot
es --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-wddx --without-oci8 --with-pear --with-kerberos=/usr/kerberos --with-ldap=shared --enable-bcmath --enable-shmop --enable-calendar --with-pdo-mysql --with-mcrypt --with-curl

+--------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+

Thank you for using PHP.

# make

Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).

アパッチを止める
/etc/init.d/httpd stop
インストール
# make install
アパッチ起動
/etc/init.d/httpd start

これでアップグレードは完了。

# php -v

5.3.8の情報に変わっていた。

Deprecated: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0
と警告が出ている。5.3以降は'magic_quotes_gpc'が推奨されていないようだ。

# vi /usr/local/etc/php.ini

magic_quotes_gpc = Offとした
もう一つ非推奨のregister_long_arraysも
register_long_arrays = Off
とした。

# php -v
PHP 5.3.8 (cli) (built: Oct 25 2011 00:53:30)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

エラーも出なくなりcurlも利用可能となった。

PHPアップグレード履歴
PHP4.3.9からPHP5.1.5にアップグレード
PHP5.1.5からPHP5.2.0にアップグレード
PHP5.2.0からPHP5.2.1にアップグレード
PHP5.2.1からPHP5.2.3にアップグレード
PHP5.2.3からPHP5.2.4にアップグレード
PHP5.2.4からPHP5.2.5にアップグレード
PR

WordPressの自動アップグレードのエラー

ディレクトリがないとかではなく、接続が出来ないとエラーの場合。

パーミッションやら、PASVモードを無効にしてみたり、ホスト名をIPにしてみたり、何やっても駄目な時。
サーバ内からのFTPアクセスが蹴られている。

/etc/hosts.allow に自鯖のIPを記入 ついでにlocalhost用も

vsftpd: 自鯖のIP
vsftpd: 127.0.0.1

これでFTPが繋がりアップデート出来ました。

定期的に時刻を合わせる

# vi /etc/crontab

# <ntp_0>
0 3 * * * root /usr/sbin/ntpdate 130.69.251.23
# </ntp_0>
# <ntp_1>
10 3 * * * root /sbin/hwclock --systohc
# </ntp_1>

NTP鯖は東京大学に設定。時刻は3時
3時10分にハードウェアクロックとシステムクロックの同期。

監視ツールが止まっている場合

snmpdデーモンが停止している。
# /etc/init.d/snmpd start

crontabの設定

phpを定期的に動かす場合

min hour day month week command

例:月曜日の8時と8時30分に実行
# vi /etc/crontab
0,30 20 * * 1 root php /PATH/hogehoge.php

拡張子無しでのアクセス

httpd.conf

該当ディレクトリのオプションにMultiviewsを追加

<Directory />
Options Multiviews
</Directory>

公開サーバをPHP5.2.1にアップグレードする RHEL4(RedHat Enterprise Linux ES v4)

ローカルサーバのPHP5.2.1が安定しているようなので公開サーバにも適用した。

公開サーバにはpostgresqlも入っているので、--with-pgsql=/usrを追加。

# ./configure --prefix=/usr/local --bindir=/usr/local/bin/ --with-apxs2=/usr/sbin/apxs --with-mysql=/usr --with-pgsql=/usr --enable-mbstr-enc-trans --enable-mbstring --enable-mbregex --enable-track-vars --with-freetype-dir=/usr --with-png-dir=/usr --with-gd --enable-gd-native-ttf --with-ttf --with-gettext --with-ncurses --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-png --with-pspell --with-regex --with-xml --with-expat-dir=/usr --with-zlib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-discard-path --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --enable-mbstring --enable-mbstr-enc-trans --enable-mbregex --without-oci8 --with-pear --with-kerberos=/usr/kerberos --with-ldap=shared --enable-memory-limit --enable-bcmath --enable-shmop --enable-calendar --enable-dbx --enable-dio --with-pdo-mysql --enable-mcal

ここからは前回のローカルサーバと同じ

# php -v
PHP 5.2.1 (cli) (built: Feb 27 2007 12:30:31)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

Net_UserAgent_Mobile 0.30.0 にアップグレード

Net_UserAgent_Mobileがバージョンアップされてたんで、アップグレードした。
http://pear.php.net/package/Net_UserAgent_Mobile

# pear list
Installed packages, channel pear.php.net:
=========================================
Package              Version State
Archive_Tar          1.3.1   stable
Console_Getopt       1.2     stable
DB                   1.7.6   stable
HTTP                 1.4.0   stable
HTTP_Request         1.3.0   stable
Mail                 1.1.10  stable
Net_SMTP             1.2.8   stable
Net_Socket           1.0.6   stable
Net_URL              1.0.14  stable
Net_UserAgent_Mobile 0.29.0  beta
PEAR                 1.4.11  stable
XML_Parser           1.2.7   stable
XML_RPC              1.5.0   stable

# pear upgrade -f Net_UserAgent_Mobile

WARNING: failed to download pear.php.net/Net_UserAgent_Mobile within preferred state "stable", will instead download version 0.30.0, stability "beta"
Did not download optional dependencies: pear/XML_RPC, use --alldeps to download automatically
warning: pear/PEAR dependency package "pear/Console_Getopt" downloaded version 1.2.2 is not the recommended version 1.2.1
downloading Net_UserAgent_Mobile-0.30.0.tgz ...
Starting to download Net_UserAgent_Mobile-0.30.0.tgz (31,955 bytes)
.........done: 31,955 bytes
downloading PEAR-1.5.0.tgz ...
Starting to download PEAR-1.5.0.tgz (286,143 bytes)
...done: 286,143 bytes
downloading Archive_Tar-1.3.2.tgz ...
Starting to download Archive_Tar-1.3.2.tgz (17,150 bytes)
...done: 17,150 bytes
downloading Structures_Graph-1.0.2.tgz ...
Starting to download Structures_Graph-1.0.2.tgz (30,947 bytes)
...done: 30,947 bytes
downloading Console_Getopt-1.2.2.tgz ...
Starting to download Console_Getopt-1.2.2.tgz (4,252 bytes)
...done: 4,252 bytes
upgrade ok: channel://pear.php.net/Console_Getopt-1.2.2
upgrade ok: channel://pear.php.net/Structures_Graph-1.0.2
upgrade ok: channel://pear.php.net/Archive_Tar-1.3.2
upgrade ok: channel://pear.php.net/PEAR-1.5.0
PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
upgrade ok: channel://pear.php.net/Net_UserAgent_Mobile-0.30.0
To install use "pear install pear/PEAR#featurename"

pear自体も古かったので最新になった。

# pear list

Installed packages, channel pear.php.net:
=========================================
Package              Version State
Archive_Tar          1.3.2   stable
Console_Getopt       1.2.2   stable
DB                   1.7.6   stable
HTTP                 1.4.0   stable
HTTP_Request         1.3.0   stable
Mail                 1.1.10  stable
Net_SMTP             1.2.8   stable
Net_Socket           1.0.6   stable
Net_URL              1.0.14  stable
Net_UserAgent_Mobile 0.30.0  beta
PEAR                 1.5.0   stable
Structures_Graph     1.0.2   stable
XML_Parser           1.2.7   stable
XML_RPC              1.5.0   stabl

ローカルサーバの設定を公開サーバにも適用した

phpMyAdminを2.9.2にアップグレード

文字化け対策

安定しているようなので上記のローカルサーバの設定を公開サーバにも適用した。

PHP5.2.0にアップグレードする2 RHEL4(RedHat Enterprise Linux ES v4)

PHP5.1.5からPHP5.2.0に公開サーバをアップグレードした。

公開サーバにはpostgresqlも入っているので、--with-pgsql=/usrを追加。

./configure --prefix=/usr/local --bindir=/usr/local/bin/ --with-apxs2=/usr/sbin/apxs --with-mysql=/usr --with-pgsql=/usr --enable-mbstr-enc-trans --enable-mbstring --enable-mbregex --enable-track-vars --with-freetype-dir=/usr --with-png-dir=/usr --with-gd --enable-gd-native-ttf --with-ttf --with-gettext --with-ncurses --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-png --with-pspell --with-regex --with-xml --with-expat-dir=/usr --with-zlib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-discard-path --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --enable-mbstring --enable-mbstr-enc-trans --enable-mbregex --without-oci8 --with-pear --with-kerberos=/usr/kerberos --with-ldap=shared --enable-memory-limit --enable-bcmath --enable-shmop --enable-calendar --enable-dbx --enable-dio --with-pdo-mysql --enable-mcal

前回のローカルサーバと全く同じで問題なくインストール完了。
ブログのプロフィールをPHP5.1.5からPHP5.2.0に変更。

これで多少の違い(メモリ量などの問題でphp.iniの設定が違ったり等)はあるが、
公開サーバとローカルサーバの設定がほぼ同じになった。
ブログ内検索
カレンダー
04 2024/05 06
S M T W T F S
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
プロフィール
HN:
No Name Ninja
性別:
非公開
自己紹介:
へなちょこサーバ管理者

HPは作れるがプログラムが出来なかったので、PHPを覚えた。

公開サーバ環境:
CPU:Pentium M 740 1.73GHz
Mem:512MB DDR2
HDD1:160GB SATA
HDD2:160GB SATA
OS:RedHat Enterprise Linux ES v4
Apache:httpd-2.0.52-28ent
MySQL:mysql-4.1.20-1
PHP:php-5.2.5
JavaSE:JDK6
Tomcat:apache-tomcat-5.5.20
Apache Tomcat Connector:jk-1.2.19

ローカルサーバ環境:
DELL INSPIRON4000
OS:RedHat Enterprise Linux ES v4
Apache:httpd-2.0.52-28ent
MySQL:mysql-4.1.20-1
PHP:php-5.2.5
JavaSE:JDK6
Tomcat:apache-tomcat-5.5.20
Apache Tomcat Connector:jk-1.2.19

ローカルPC
OS:Windows7
最新コメント
[03/14 mietwagen]
[02/02 Online poker]
[03/13 ほし]
[03/01 へなとこ]
[11/14 ポポ]
アクセス解析
?
カウンター
起動、終了、再起動
Apacheの起動
/etc/init.d/httpd start
Apacheの終了
/etc/init.d/httpd stop
Apacheの再起動
/etc/init.d/httpd restart

Tomcatの起動
/usr/local/tomcat/bin/startup.sh
Toncatの終了
/usr/local/tomcat/bin/shutdown.sh

MySQLの起動
/etc/rc.d/init.d/mysqld start
MySQLの終了
/etc/rc.d/init.d/mysqld stop
MySQLの再起動
/etc/rc.d/init.d/mysqld restart

vsftpdの起動
/etc/init.d/vsftpd start
vsftpdの終了
/etc/init.d/vsftpd stop
vsftpdの再起動
/etc/init.d/vsftpd restart
場所
httpd.conf
/etc/httpd/conf/httpd.conf

AdminControlMenu: AdminMenu | NewEntry | EditComment | EditTrackback

忍者ブログ [PR]