ソース †
展開 †
gzip -dc httpd-2.0.52.tar.gz | tar xvf -
gzip -dc php-4.3.9.tar.gz | tar xvf -
gzip -dc expat-1.95.5.tar.gz | tar xvf -
gzip -dc gdbm-1.8.3.tar.gz | tar xvf -
gzip -dc libiconv-1.8.tar.gz | tar xvf -
expatのビルド&インストール †
cd expat-1.95.5
./configure
make
su
make install
gdbmのビルド&インストール †
cd gdbm-1.8.3
./configure
make
su
make install
GNU libiconvのビルド&インストール †
cd libiconv-1.8
./configure
make
su
make install
Apache2のビルド&インストール †
cd httpd-2.0.52
./configure
make
su
make install
PHP4のビルド&インストール †
./configure --with-apach2=../httpd-2.0.52 \
--with-apxs2=/usr/local/apache2/bin/apxs \
--enable-mbstring --enable-mbregex
make
su
make install
httpd.confの編集 †
- ServerName?の変更
ServerName tanuzou.com:80
- Groupの変更
User nobody
Group "#-1"
↓
User nobody
Group nogroup
- httpd.confに以下を追加
LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Apacheの起動・終了・再起動 †
- サーバーの起動
/usr/local/apache2/bin/apachectl start
- サーバーの終了
/usr/local/apache2/bin/apachectl stop
- サーバーの再起動 (設定ファイルの再読込)
/usr/local/apache2/bin/apachectl restart
Apacheの自動起動 †
- Solaris
- /etc/init.d/apache を変更する
#!/sbin/sh
APACHE_HOME=/usr/local/apache2
CONF_FILE=/usr/local/apache2/conf/httpd.conf
LD_LIBRARY_PATH=/usr/local/lib:/usr/ccs/lib:/usr/lib
export LD_LIBRARY_PATH
#PIDFILE=/var/run/httpd.pid
PIDFILE=${APACHE_HOME}/logs/httpd.pid
if [ ! -f ${CONF_FILE} ]; then
exit 0
fi
case "$1" in
start)
/bin/rm -f ${PIDFILE}
cmdtext="starting"
;;
restart)
cmdtext="restarting"
;;
stop)
cmdtext="stopping"
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
echo "httpd $cmdtext."
/bin/sh -c "${APACHE_HOME}/bin/apachectl $1" 2>&1 &
status=$?
if [ $? != 0 ]; then
echo "$status"
exit 1
fi
exit 0
- rc*.dのS50apacheとK16apacheを、/etc/init.d/apacheへのシンボリックリンクにする
cd /etc/rc0.d
mv K16apache _K16apache
ln -s ../init.d/apache K16apache
cd /etc/rc1.d
mv K16apache _K16apache
ln -s ../init.d/apache K16apache
cd /etc/rc2.d
mv K16apache _K16apache
ln -s ../init.d/apache K16apache
cd /etc/rc3.d
mv S50apache _S50apache
ln -s ../init.d/apache S50apache
cd /etc/rcS.d
mv K16apache _K16apache
ln -s ../init.d/apache K16apache
イロイロ †
ステータスコード †