Source code installation httpd2.4.4
Don't gossip and get to the point.
Prepare the tool
Httpd_-2.4.4.tar.bz2
Apr-1.4.6.tar.gz (a portable runtime for apache)
Apr-util-1.5.1.tar.gz
Mkdir / mnt/cdrom
Mount / dev/cdrom / mnt/cdrom/ (establish CD mount point)
Cd / mnt/cdrom/Server/
Ll apr*
Rpm-ivh apr-devel-1.2.7-11.e15_3.1.i386.rpm (install apr development package)
Install the apr-1.4.6 runtime
Tar-zxvf apr-1.4.6.tar.gz-C/usr/local/src/
Cd / usr/local/src/apr-1.4.6/
Configure apr-1.4.6
Ll
Less README
. / configure (installed by default to the automatically generated apr directory under the / usr/local directory)
Make
Make install
Cd
Install apr-util-1.5.1
Tar-zxvf apr-util-1.5.1.tar.gz-C / usr/local/src/
Cd / usr/local/src/apr-util-1.5.1/
Ll
Ls
. / configure
. / configure-- with- apr=/usr/local/apr/bin/apr-1-config (to specify the full path to apr-config)
Make
Make install
Cd
Install pcre and its development package (don't ask why you install this, it will be a problem if you don't install it. )
Ll / mnt/cdrom/Server/pcre*
Rpm-ivh / mnt/cdrom/Server/pcre-6.6-2.el5_1.7.i386.rpm
Rpm-ivh / mnt/cdrom/Server/pcre-devel-6.6-2.e15_1.7.i386.rpm
Install http2.4.4
Tar-jxvf httpd-2.4.4.tar.bz2-C / usr/local/src/
Cd / usr/local/src/httpd-2.4.4/
Cd / usr/local/apr
Vim / etc/ld.so.conf.d/apr.conf
Write path / usr/local/apr/lib (let the system call the runtime)
Ldconfig loading
. / configure-- prefix=/usr/local/apache-- sysconfdir=/etc/httpd (configuration file directory)-- with-apr=/usr/local/apr/bin/apr-1-config (to specify the full path to apr-config)
Make
Make install
Cd / usr/local/
Cd bin/
. / apachectl start
Netstat-tupln | grep 80 (check whether port 80 is enabled)
Apachectl is called at this time, so we want to call our own script to start apache?
Then write a script.
Cd / etc/init.d
Vim httpd
#! / bin/bash
# descriptionion: httpd server
# chkconfig:-88 90
HTTPD='/usr/local/apache/bin/httpd'
CONFFILE='etc/httpd/httpd.conf'
. / etc/init.d/FUNCTIONS
Start () {
[- f / var/lock/subsys/http] & & echo "httpd is starting...."
Echo-n "httpd is starting."
Sleep 1
$HTTPD-f $CONFFILE & & RETVAL=0 | | RETVAL=1
[$RETVAL-eq 0] & & touch / var/lock/subsys/http & & echo-e "\ 033 [31m [ok]\ 033 [0m" | | echo-e "\ 033 [31m [fail]\ 033 [0m"
}
Stop () {
Echo-n "httpd is stoping."
Sleep 1
Killproc httpd & & RETVAL=0 | | RETVAL=1
[$RETVAL-eq 0] & & rm-rf / var/lock/subsys/http | | echo-e "\ 033 [31m [fail]\ 033 [0m"
}
Case $1 in
Start)
Start
Stop)
Stop
Restart)
Stop
Start
*)
Echo "Usage:start | stop | restart"
Esac
Chmod axix httpd
Chkconfig-add httpd (set the httpd service to boot automatically)
End