Updating to Apache 2.0.48, PHP 4.3.3 and MySQL 4.0.14 on Redhat 9
Notes:
http://www.devside.net/
http://www.hamptonandassociates.net/apache_tips.htm
http://httpd.apache.org/docs-2.0/install.html
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=4189894b.0304030218.4e275531%40posting.google.com&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DISO-8859-1%26q%3Dapache%2B%2522Error%253A%2Bunable%2Bto%2Bfind%2Blayout%2522%26sa%3DN%26tab%3Dwg
First setup our environment:
Before we get started we will be compiling into /usr/local/lib which
is not the default library directory on Redhat.
Edit /etc/ld.so.conf
and put at the top of the file
/usr/local/lib
then as root run
# ldconfig
Now setup our LD_LIBRARY_CONFIG for configure
# LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/usr/X11R6/lib:/usr/lib/sane:/usr/kerberos/lib:/usr/lib/qt-3.0.5/lib:/usr/lib/qt2/lib:/usr/lib/wine:/usr/lib/mysql; export LD_LIBRARY_PATH
# export LDFLAGS="-L/usr/local/lib -L/usr/lib -L/usr/X11R6/lib"
# mkdir /build (if not already created)
Now we need to remove old legacy rpms installed by Redhat if they exist:
Notes:
If rpm comnmand hangs you may have a corrupt rpm database.
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=73097
Stop the Apache server:
# /etc/init.d/httpd stop
Stopping httpd: [ OK ]
Copy the existing Apache configs
# mkdir /save
# cd /etc/httpd
# find . -print -depth | cpio -pvdm /save
Remove Apache and PHP rpm's:
# rpm -e httpd-manual-2.0.40-21.5
# rpm -e httpd-devel-2.0.40-21.5
# rpm -e mod_perl-1.99_07-5
# rpm -e mod_python-3.0.1-3
# rpm -e mod_ssl-2.0.40-21.5
# rpm -e mod_auth_mysql-1.11-12
# rpm -e mod_auth_pgsql-0.9.12-14
# rpm -e wordtrans-web-1.1pre12-7
# rpm -e php-imap-4.2.2-17.2
# rpm -e php-ldap-4.2.2-17.2
# rpm -e php-manual-4.2.2-17.2
# rpm -e php-mysql-4.2.2-17.2
# rpm -e php-odbc-4.2.2-17.2
# rpm -e php-pgsql-4.2.2-17.2
# rpm -e php-snmp-4.2.2-17.2
# rpm -e squirrelmail-1.2.11-1
# rpm -e php-devel-4.2.2-17.2
# rpm -e php-4.2.2-17.2
# rpm -e redhat-config-httpd-1.0.1-18
# rpm -e webalizer-2.01_10-11
# rpm -e htdig-web-3.2.0-16.20021103
# rpm -e nut-cgi-1.2.0-6
# rpm -e namazu-cgi-2.0.12-5
# rpm -e mailman-2.1.1-4
# rpm -e httpd-2.0.40-21.5
warning: /etc/httpd/conf/httpd.conf saved as /etc/httpd/conf/httpd.conf.rpmsave
Now remove MySQL legacy rpm's:
# mv /etc/my.cnf /etc/my.cnf.orig_redhat
# rpm -e libdbi-dbd-mysql-0.6.5-5
# rpm -e MySQL-python-0.9.1-6
# rpm -e qt-MySQL-3.1.1-6
# rpm -e MyODBC-2.50.39-11
# rpm -e mysql-devel-3.23.58-1.9
# rpm -e mysql-server-3.23.58-1.9
# rpm -e mysql-3.23.58-1.9 perl-DBD-MySQL-2.1021-3
warning: /etc/my.cnf saved as /etc/my.cnf.rpmsave
Compile OpenSSL first.
Grab the source from http://www.openssl.org/source/openssl-0.9.7c.tar.gz
or
http://ws.harcourt.com/pub/soft/src/openssl-0.9.7c.tar.gz
and save it into /build/openssl-0.9.7c.tar.gz
uncompress and untar
# cd /build/openssl-0.9.7c
# ./config --prefix=/usr/local --openssldir=/usr/local/openssl shared
# make
# make test
# make install
# echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
# ldconfig
# openssl version
OpenSSL 0.9.7c 30 Sep 2003
Build libxml:
http://www.xmlsoft.org/
Download from ftp://xmlsoft.org/libxml2-2.5.10.tar.gz
# cd /build/libxml2-2.5.10
# ./configure --prefix=/usr/local
# make
# make install
Build libxslt:
Download from ftp://xmlsoft.org/libxslt-1.0.32.tar.gz
# cd /build/libxslt-1.0.32
# ./configure --prefix=/usr/local
# make
# make install
Build CrackLib:
Download http://www.crypticide.org/users/alecm/security/cracklib,2.7.tar.gz
# cd /build
# mv "cracklib,2.7" cracklib2.7
# cd /build/cracklib2.7
# CC=gcc; export CC
Edit util/Makefile and replace all "cc $(CFLAGS) -o" with "gcc $(CFLAGS) -o"
# make all
# make install
# cp /build/cracklib2.7/cracklib/libcrack.a /usr/local/lib/libcrack.a
# chmod +r /usr/local/lib/libcrack.a
Build Curl (needs 7.9.8 or better):
Notes:
http://curl.haxx.se/mail/archive-2000-05/0002.html
http://groups.google.com/groups?hl=en&lr=lang_en|lang_iw|lang_es&ie=UTF-8&newwindow=1&safe=off&threadm=3C33A3E9.1D6EAD40%40sonic.net&rnum=2&prev=/groups%3Fhl%3Den%26lr%3Dlang_en%257Clang_iw%257Clang_es%26ie%3DISO-8859-1%26newwindow%3D1%26safe%3Doff%26q%3Dcurl%253A%2B(35)%2BSSL%253A%2Berror%253A140770FC%253ASSL%2Broutines%253ASSL23_GET_SERVER_HELLO%253Aunknown%2Bprotocol%26sa%3DN%26tab%3Dwg
Download http://curl.haxx.se/download/curl-7.10.5.tar.gz
# cd /build/curl-7.10.5
# CFLAGS='-O2 -I/build/openssl-0.9.7c/include -DEAPI'; export CFLAGS
# LDFLAGS="-L/build/openssl-0.9.7c"; export LDFLAGS
# SSL_BASE=/build/openssl-0.9.7c; export SSL_BASE
# ./configure --prefix=/usr/local
# make
# make test
# make install
Build libsas12
http://asg.web.cmu.edu/sasl/
ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/
Downlod from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.15.tar.gz
# cd /build/cyrus-sasl-2.1.15
# export LIBS=-lcrypto
# export SASL_USE_GSSAPI=NO
# ./configure --prefix=/usr/local --without-krb --enable-login --disable-gssapi \
--disable-krb4 --with-saslauthd=/var/run/saslauthd
# make
# make install
Build cyrus-imap (needs 2.0.8 or better):
Download ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-imapd-2.1.13.tar.gz
# cd /build/cyrus-imapd-2.1.13
# ./configure --prefix=/usr/local --with-auth=unix --without-perl
# make
# make install
We will also need to install the UW implementation of IMAP
http://www.faqchest.com/prgm/cyrus-l/cyrus-01/cyrus-0107/cyrus-010700/cyrus01070415_23371.html
Download from ftp://ftp.cac.washington.edu/imap/imap.tar.Z
# cd /build/imap-2002c1
# make lrh
# cp /build/imap-2002c1/src/c-client/rfc822.h /usr/include/rfc822.h
# chmod +r /usr/include/rfc822.h
Build libpng:
http://sourceforge.net/projects/libpng/
Download from http://prdownloads.sourceforge.net/libpng/libpng-1.2.5.tar.gz
# cd /build/libpng-1.2.5
# cp scripts/makefile.linux Makefile
# make
# make test
# make install
Build libjpeg:
Download from ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
# cd /build/jpeg-6b
# ./configure --prefix=/usr/local
# make
# make test
# make install
# cp /build/jpeg-6b/libjpeg.a /usr/lib/libjpeg.a
# chmod +r /usr/lib/libjpeg.a
Build mcrypt, libmcrypt and libmhash:
Mhash can be found at http://mhash.sourceforge.net/ or
http://unc.dl.sourceforge.net/sourceforge/mhash/mhash-0.8.18.tar.gz
Download from ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz
Download from ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/mcrypt-2.6.4.tar.gz
# cd /build/mhash-0.8.18
# ./configure --prefix=/usr/local
# make install
Notes:
http://lists.hellug.gr/pipermail/mcrypt-dev/2003/000405.html
"Replace mcrypt_symb.c in src/ with the original file from the distribution.
For some reason the makefile decided to overwrite it."
# cd /build/libmcrypt-2.5.7
# ./configure --prefix=/usr/local
# cp lib/mcrypt_symb.c src/mcrypt_symb.c
# make
# make install
# cd /build/mcrypt-2.6.4
# ./configure --prefix=/usr/local
# make
# make install
Build MySQL
Notes:
http://www.mysql.com/doc/en/Installing_source.html
http://www.mysql.com/doc/en/configure_options.html
Download from http://www.mysql.com/downloads/mysql-4.0.html
ftp://mirror.mcs.anl.gov/pub/mysql/Downloads/MySQL-4.0/mysql-4.0.14.tar.gz
# cd /build/mysql-4.0.14
# ./configure --prefix=/usr/local/mysql --with-unix-socket-path=/tmp/mysql.sock \
--sysconfdir=/usr/local/mysql/etc
# make
# make test
# make install
Install the MySQL grant database:
Notes:
http://www.mysql.com/doc/en/Post-installation.html
Check /etc/passwd and if no mysql account is defined then:
# groupadd mysql
# useradd mysql
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash
Backup your old data if you have any first!
# rm -rf /var/lib/mysql
# /build/mysql-4.0.14/scripts/mysql_install_db
"Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
030911 15:14:49 /usr/local/mysql/libexec/mysqld: Shutdown Complete
To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h wstest03 password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests
Please report any problems with the /usr/local/mysql/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com"
Create /etc/my.cnf with the following lines:
[mysqld]
datadir=/var/lib/mysql
socket=/tmp/mysql.sock
[mysql.server]
user=mysql
basedir=/var/lib
[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
Create the MySQL init script:
# mv /etc/init.d/mysqld /etc/init.d/mysqld.orig_redhat
# mkdir -p /var/run/mysqld
# chown mysql:mysql /var/run/mysqld
# chmod 0755 /var/run/mysqld
Create the file /etc/init.d/mysqld with the following lines:
#!/bin/bash
#
# mysqld This shell script takes care of starting and stopping
# the MySQL subsystem (mysqld).
#
# chkconfig: - 78 12
# description: MySQL database server.
# processname: mysqld
# config: /etc/my.cnf
# pidfile: /var/run/mysqld.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
prog="MySQL"
datadir="/var/lib/mysql"
pidfile="/var/run/mysqld/mysqld.pid"
# Load default environment
LD_LIBRARY_PATH=/usr/local/lib:/usr/lib; export LD_LIBRARY_PATH
start(){
touch /var/log/mysqld.log
chown mysql.mysql /var/log/mysqld.log
chmod 0640 /var/log/mysqld.log
touch $pidfile
chown mysql.mysql $pidfile
chmod 0644 $pidfile
if [ ! -d $datadir/mysql ] ; then
action $"Initializing MySQL database: " /usr/local/mysql/bin/mysql_install_db
ret=$?
chown -R mysql.mysql $datadir
if [ $ret -ne 0 ] ; then
return $ret
fi
fi
chown -R mysql.mysql $datadir
chmod 0755 $datadir
/usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf >/dev/null 2>&1 &
ret=$?
if [ $ret -eq 0 ]; then
action $"Starting $prog: " /bin/true
else
action $"Starting $prog: " /bin/false
fi
[ $ret -eq 0 ] && touch /var/lock/subsys/mysqld
return $ret
}
stop(){
/bin/kill `cat $pidfile 2> /dev/null ` > /dev/null 2>&1
ret=$?
if [ $ret -eq 0 ]; then
action $"Stopping $prog: " /bin/true
else
action $"Stopping $prog: " /bin/false
fi
[ $ret -eq 0 ] && rm -f /var/lock/subsys/mysqld
[ $ret -eq 0 ] && rm -f /tmp/mysql.sock
[ $ret -eq 0 ] && rm -f $pidfile
return $ret
}
restart(){
stop
start
}
condrestart(){
[ -e /var/lock/subsys/mysqld ] && restart || :
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status mysqld
;;
restart)
restart
;;
condrestart)
condrestart
;;
*)
echo $"Usage: $0 {start|stop|status|condrestart|restart}"
exit 1
esac
exit $?
# chmod +x /etc/init.d/mysqld
Setup MySQL to start automatically on reboot:
# chkconfig --add mysqld
# chkconfig --level 1 mysqld off
# chkconfig --level 2 mysqld on
# chkconfig --level 3 mysqld on
Now startup MySQL:
# /etc/init.d/mysqld start
Initializing MySQL database: [ OK ]
Starting MySQL: [ OK ]
# ps -ef | grep -i sql
root 16407 1 0 19:34 pts/1 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf
mysql 16435 16407 3 19:34 pts/1 00:00:00 /usr/local/mysql/libexec/mysqld --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking
Test it:
# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.0.14
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> status
--------------
mysql Ver 12.21 Distrib 4.0.14, for pc-linux (i686)
Connection id: 1
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Server version: 4.0.14
Protocol version: 10
Connection: Localhost via UNIX socket
Client characterset: latin1
Server characterset: latin1
UNIX socket: /tmp/mysql.sock
Uptime: 40 sec
Threads: 1 Questions: 2 Slow queries: 0 Opens: 6 Flush tables: 1
Open tables: 0 Queries per second avg: 0.050
--------------
Now build Apache:
# cd /build/httpd-2.0.48
# export SSL_BASE=/usr/local/openssl
# LIBS="-lpthread"; export LIBS
# LDFLAGS="-lpthread"; export LDFLAGS
# unset CFLAGS
# ./configure --prefix=/usr/local/httpd \
--enable-ssl --with-ssl=/usr/local/openssl \
--enable-so \
--enable-mods-shared=all \
--enable-access=shared --enable-auth=shared --enable-auth_anon=shared \
--enable-auth_dbm=shared --enable-auth_digest=shared --enable-include=shared \
--enable-log_config=shared --enable-env=shared --enable-mime_magic=shared \
--enable-cern_meta=shared --enable-expires=shared --enable-headers=shared \
--enable-usertrack=shared --enable-unique_id=shared --enable-setenvif=shared \
--enable-mime=shared --enable-dav=shared --enable-status=shared \
--enable-autoindex=shared --enable-asis=shared --enable-info=shared \
--enable-cgi=shared --enable-dav_fs=shared --enable-vhost_alias=shared \
--enable-negotiation=shared --enable-dir=shared --enable-imap=shared \
--enable-actions=shared --enable-speling=shared --enable-userdir=shared \
--enable-alias=shared --enable-rewrite=shared --enable-proxy=shared \
--enable-proxy_ftp=shared --enable-proxy_http=shared \
--enable-proxy_connect=shared --enable-rule=SHARED_CORE \
--verbose
# make
# make install
Finally fixup Apache:
# mkdir -p /var/run/httpd
# chown apache:apache /var/run/httpd
# chmod 755 /var/run/httpd
# mkdir /usr/local/httpd/conf.d
# cp /usr/local/httpd/conf/httpd.conf /usr/local/httpd/conf/httpd.conf.orig
Move the ssl include file to conf.d:
# mv /usr/local/httpd/conf/ssl.conf /usr/local/httpd/conf.d/ssl.conf
Edit /usr/local/httpd/conf/httpd.conf
Change the line:
ServerAdmin you@your.address
to
ServerAdmin nicadmin@harcourt.com
and the line:
#ServerName new.host.name:80
to
ServerName my.host.com:80
or similiar
and the lines:
User nobody
Group #-1
to
User apache
Group apache
Add the below lines underneath the Listen statement:
# Load config files from the config directory "/usr/local/httpd/conf.d".
#
Include /usr/local/httpd/conf.d/*.conf
Change the PidFile line to:
PidFile /var/run/httpd/httpd.pid
Comment out the original ssl include lines:
#
# Include conf/ssl.conf
#
or
#
#LoadModule ssl_module modules/mod_ssl.so
#
Save and exit.
Edit the ssl.conf file /usr/local/httpd/conf.d/ssl.conf and add the following
line near the top above all other statements:
LoadModule ssl_module modules/mod_ssl.so
Remove the lines:
and
Comment out the following lines since we are using virtual hosting:
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
#SSLEngine on
and
# Server Certificate:
# Point SSLCertificateFile at a PEM encoded certificate. If
# the certificate is encrypted, then you will be prompted for a
# pass phrase. Note that a kill -HUP will prompt again. Keep
# in mind that if you have both an RSA and a DSA certificate you
# can configure both in parallel (to also allow the use of DSA
# ciphers, etc.)
#SSLCertificateFile /usr/local/httpd/conf/ssl.crt/server.crt
#SSLCertificateFile /usr/local/httpd/conf/ssl.crt/server-dsa.crt
and
# Server Private Key:
# If the key is not combined with the certificate, use this
# directive to point at the key file. Keep in mind that if
# you've both a RSA and a DSA private key you can configure
# both in parallel (to also allow the use of DSA ciphers, etc.)
#SSLCertificateKeyFile /usr/local/httpd/conf/ssl.key/server.key
and
#
and
#
Also comment out the line:
#ServerName www.example.com:443
Save and exit.
Try to start the server again:
# /usr/local/httpd/bin/apachectl start
# ps -ef | grep http
nobody 17474 17470 0 19:28:28 ? 0:00 /usr/local/httpd/bin/httpd -k start
root 17470 1 14 19:28:25 ? 0:03 /usr/local/httpd/bin/httpd -k start
nobody 17475 17470 0 19:28:28 ? 0:00 /usr/local/httpd/bin/httpd -k start
nobody 17471 17470 0 19:28:28 ? 0:00 /usr/local/httpd/bin/httpd -k start
nobody 17473 17470 0 19:28:28 ? 0:00 /usr/local/httpd/bin/httpd -k start
nobody 17472 17470 0 19:28:28 ? 0:00 /usr/local/httpd/bin/httpd -k start
Now update the init script:
# mv /etc/init.d/httpd /etc/init.d/httpd.orig_redhat
Create the file /etc/init.d/httpd with the following lines:
#!/bin/bash
#
# Startup script for the Apache Web Server
#
# chkconfig: - 85 15
# description: Apache is a World Wide Web server. It is used to serve \
# HTML files and CGI.
# processname: httpd
# pidfile: /var/run/httpd/httpd.pid
# config: /usr/local/httpd/conf/httpd.conf
# Source function library.
. /etc/rc.d/init.d/functions
# This will prevent initlog from swallowing up a pass-phrase prompt if
# mod_ssl needs a pass-phrase from the user.
INITLOG_ARGS=""
# Path to the apachectl script, server binary, and short-form for messages.
apachectl=/usr/local/httpd/bin/apachectl
httpd=/usr/local/httpd/bin/httpd
prog=httpd
RETVAL=0
# Load in environment
LD_LIBRARY_PATH=/usr/local/lib:/usr/lib; export LD_LIBRARY_PATH
# check for 1.3 configuration
check13 () {
CONFFILE=/usr/local/httpd/conf/httpd.conf
GONE="(ServerType|BindAddress|Port|AddModule|ClearModuleList|"
GONE="${GONE}AgentLog|RefererLog|RefererIgnore|FancyIndexing|"
GONE="${GONE}AccessConfig|ResourceConfig)"
if grep -Eiq "^[[:space:]]*($GONE)" $CONFFILE; then
echo
echo 1>&2 " Apache 1.3 configuration directives found"
echo 1>&2 " please read /usr/share/doc/httpd-2.0.40/migration.html"
failure "Apache 1.3 config directives test"
echo
exit 1
fi
}
# The semantics of these two functions differ from the way apachectl does
# things -- attempting to start while running is a failure, and shutdown
# when not running is also a failure. So we just do it the way init scripts
# are expected to behave here.
start() {
echo -n $"Starting $prog: "
check13 || exit 1
# daemon $httpd $OPTIONS
daemon $httpd
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/httpd
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $httpd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/httpd /var/run/httpd/httpd.pid
}
reload() {
echo -n $"Reloading $prog: "
check13 || exit 1
killproc $httpd -HUP
RETVAL=$?
echo
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $httpd
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if [ -f /var/run/httpd/httpd.pid ] ; then
stop
start
fi
;;
reload)
reload
;;
graceful|help|configtest|fullstatus)
$apachectl $@
RETVAL=$?
;;
*)
echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}"
exit 1
esac
exit $RETVAL
Save and exit.
# chmod +x /etc/init.d/httpd
# chkconfig --add httpd
# chkconfig --level 1 httpd off
# chkconfig --level 2 httpd on
# chkconfig --level 3 httpd on
Download php from http://www.php.net/downloads.php
# cd /build/php-4.3.3
# CFLAGS='-O2 -I/build/openssl-0.9.7c/include -DEAPI'; export CFLAGS
# LDFLAGS="-L/build/openssl-0.9.7c"; export LDFLAGS
# ./configure --prefix=/usr/local \
--with-apxs2=/usr/local/httpd/bin/apxs \
--with-config-file-path=/etc --enable-track-vars \
--without-bz2 --with-crack=/build/cracklib2.7 \
--with-curl=/build/curl-7.10.5 --with-cyrus=/build/cyrus-imapd-2.1.13 \
--without-fbsql --without-fdftk --without-fribidi --with-jpeg-dir=/build/jpeg-6b \
--with-png-dir=/build/libpng-1.2.5rc2 --without-hwapi --without-imap \
--without-informix --without-ingres --without-ircg --without-java --without-mcal \
--without-mcrypt --without-mcve --without-ming --without-mnogosearch --without-msession \
--without-ncurses --without-oracle --without-oci8 --without-ovrimos --disable-pcntl \
--without-cpdflib --without-pdflib --without-pfpro --without-pgsql --without-pspell \
--without-qtdom --without-readline --without-libedit --without-recode --without-swf \
--without-sybase --without-sybase-ct --without-xslt-sablot --without-sablot-js \
--without-expat-dir --disable-xslt --without-yaz --disable-yp --without-zip \
--with-mysql=/usr/local/mysql \
--with-xml --with-dom --with-domxml --with-zlib
# make
# make test
# make install
# cp php.ini-recommended /usr/local/etc/php.ini (this is new in PHP 4)
# php -v
PHP 4.3.3 (cli) (built: Nov 18 2003 20:09:02)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
Note if you have older PHP programs that are used to Ver. 3.x Global Register
behavior being on you can set Global Registors for that virtual host only via
the command in the Apache conf for that host:
.
.
.
php_value register_globals 1
Create Apache php.conf
Edit /usr/local/httpd/conf.d/php.conf
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
LoadModule php4_module modules/libphp4.so
#
# Add PHP file types
#
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .inc
AddType application/x-httpd-php .php
#
# Note: This is the old Apache 1.x syntax but I am leaving in commented
# out for documentation sake
#
#
# Cause the PHP interpreter handle files with a .php extension.
#
#
# SetOutputFilter PHP
# SetInputFilter PHP
# LimitRequestBody 524288
#
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
Now restart Apache:
# apachectl restart