CentOS4.5にApacheをインストールする。またPHPに関しては、PHP5.2.5をインストールする。
以下でパッケージを調べる

# yum list | grep httpd
httpd.i386 2.0.52-32.3.ent.centos update
httpd-devel.i386 2.0.52-32.3.ent.centos update
httpd-manual.i386 2.0.52-32.3.ent.centos update
httpd-suexec.i386 2.0.52-32.3.ent.centos update
system-config-httpd.noarch 5:1.3.1-1 base

どうやら、2.0系がベースらしい。同様にPHPも調べる。こちらは4.3系がベース。
PHPに関してはとある事情で5系をインストールすることにする。

# yum -y install httpd

apr,httpd-suexec,apr-util,httpdがインストールされる。
一応インストールされたパッケージを調べる

# yum list installed | grep httpd'

開発者パッケージはインストールされていないようなのでインストールする。

# yum -y install httpd-devel

依存関係によりapr-devel,apr-util-devel, pcre-develが同時にインストールされる。
細かい設定などは以下が参考になる。

PHPのインストール
前準備
今回GD,mysql,pgclusterへの接続環境が必要なのでそれを用意しておく必要がある。ただし、pgclusterに関してはすでにインストール済みとする。GDに関してのみrpmでインストールする。

# yum -y install gd-devel

まずはphp4のパッケージをインストールしてphp --infoで標準の構成を調べる。

# yum -y install php

phpphp-pearがインストールされた。ここでphp --infoでphpのconfigureオプションを調べてみる。すると以下のようになっていた。

./configur \
--build=i686-redhat-linux-gnu \
--host=i686-redhat-linux-gnu \
--target=i386-redhat-linux-gnu \
--program-prefix= \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--datadir=/usr/share \
--includedir=/usr/include \
--libdir=/usr/lib \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--sharedstatedir=/usr/com \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--cache-file=../config.cache \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/etc/php.d \
--enable-force-cgi-redirect \
--disable-debug \
--enable-pic \
--disable-rpath \
--enable-inline-optimization \
--with-bz2 \
--with-db4=/usr \
--with-curl \
--with-exec-dir=/usr/bin \
--with-freetype-dir=/usr \
--with-png-dir=/usr \
--with-gd=shared \
--enable-gd-native-ttf \
--without-gdbm \
--with-gettext \
--with-ncurses=shared \
--with-gmp \
--with-iconv \
--with-jpeg-dir=/usr \
--with-openssl \
--with-png \
--with-pspell \
--with-xml \
--with-expat-dir=/usr \
--with-dom=shared,/usr \
--with-dom-xslt=/usr \
--with-dom-exslt=/usr \
--with-xmlrpc=shared \
--with-pcre-regex=/usr \
--with-zlib \
--with-layout=GNU \
--enable-bcmath \
--enable-exif \
--enable-ftp \
--enable-magic-quotes \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-track-vars \
--enable-trans-sid \
--enable-yp \
--enable-wddx \
--with-pear=/usr/share/pear \
--with-imap=shared \
--with-imap-ssl \
--with-kerberos \
--with-ldap=shared \
--with-mysql=shared,/usr \
--with-pgsql=shared \
--with-snmp=shared,/usr \
--with-snmp=shared \
--enable-ucd-snmp-hack \
--with-unixODBC=shared,/usr \
--enable-memory-limit \
--enable-shmop \
--enable-calendar \
--enable-dbx \
--enable-dio \
--enable-mbstring=shared \
--enable-mbstr-enc-trans \
--enable-mbregex \
--with-mime-magic=/usr/share/file/magic.mime \
--enable-force-cgi-redirect \
--enable-pcntl

このうち必要なのは、mbstring、pgsql、mysql関係そのことを考えてコンパイルオプションを決める。コンパイルオプションを決めたら、phpを削除しておく。

# yum remove php

PHPに関しては以下からソースをダウンロード

# wget http://jp.php.net/get/php-5.2.5.tar.bz2/from/jp2.php.net/mirror
# tar jxf php-5.2.5.tar.bz2

configure --helpでconfigureオプションを調べる。関係ありそうなものは以下の通り
とりあえず今日はここまで。