Httpd compilation and Installation
1. Compile and install APR
The httpd-2.4.9 needs a newer version of APR and APR-util, so first install these two packages in the check environment, check whether the three development package groups development tools, server platform development, and desktop platform development are installed, and then start compilation and installation.
#tar xf apr-1.5.0.tar.bz2#cd apr-1.5.0#./configure --prefix=/usr/local/apr#make && make install
2. Compile and install Apr-util
#tar xf apr-util-1.5.3.tar.bz2#cd apr-util-1.5.3#./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr#make && make install
3. Compile and install the httpd-2.4
#./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --enable-mpms-shared=all --with-mpm=event --enable-modules=most#make && make install
4. After compilation, add the variable; otherwise, you cannot start it with apachectl.
#vim /etc/profile.d/httpd.sh
650) This. width = 650; "Title =" E4 ~ S0000@_t_g_z1_rk1_ak1w9wp.jpg "src =" http://s3.51cto.com/wyfs02/M02/46/40/wKiom1PwvyyT8qTZAABdH2kAfa4063.jpg "alt =" wkiom1pwvyyt8qtzaabdh2kafa4063.jpg "/>
After editing, use source httpd. Sh to add the environment variable. This will start
# Apachetctl
In this way, port 80 listens.
650) This. width = 650; "Title =" ktj @ X3 @ to4se} 65q % t4h ~ 28. jpg "src =" http://s3.51cto.com/wyfs02/M00/46/42/wKioL1PwwJSzcIi_AAHsYzv_Ek0190.jpg "alt =" wkiol1pwwjszcii_aahsyzv_ek0190.jpg "/>
5. Enable man Manual
If you do not want to use the absolute path to view the httpd manual information, you must enable the httpd man manual. Add an absolute path of the httpd man manual below. You can use # Man httpd directly later.
#vim /etc/man.config
650) This. width = 650; "Title =" y5to%4%8jkl% B %ckhph4up9.jpg "src =" http://s3.51cto.com/wyfs02/M00/46/40/wKiom1Pwv-ijM0mTAADkQkEMlFk007.jpg "alt =" wKiom1Pwv-ijM0mTAADkQkEMlFk007.jpg "/>
6. Configure Service Startup
#vim /etc/rc.d/init.d/httpd
Add the following command in it, but note that you must modify the path in it.
#!/bin/bash## httpd Startup script for the Apache HTTP Server## chkconfig: - 85 15# HTML files and CGI.# processname: httpd# config: /etc/httpd/conf/httpd.conf#if [ -f /etc/sysconfig/httpd ]; then# Start httpd in the C locale by default.HTTPD_LANG=${HTTPD_LANG-"C"} # mod_ssl needs a pass-phrase from the user.INITLOG_ARGS=""apachectl=/usr/local/httpd/bin/apachectlhttpd=${HTTPD-/usr/local/httpd/bin/httpd}prog=httpdpidfile=${PIDFILE-/usr/local/httpd/logs/httpd.pid}lockfile=${LOCKFILE-/var/lock/subsys/httpd}RETVAL=0 start() { echo -n $"Starting $prog: " LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS [ $RETVAL = 0 ] && touch ${lockfile} return $RETVAL } stop() { echo -n $"Stopping $prog: " killproc -p ${pidfile} -d 10 $httpd RETVAL=$? echo [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile} } reload() { echo -n $"Reloading $prog: " if ! LANG=$HTTPD_LANG $httpd $OPTIONS -t >&/dev/null; then RETVAL=$? echo $"not reloading due to configuration syntax error" else killproc -p ${pidfile} $httpd -HUP RETVAL=$? fi echo } # See how we were called. case "$1" in start) start ;; stop) stop ;; status) status -p ${pidfile} $httpd RETVAL=$? ;; start ;; condrestart) if [ -f ${pidfile} ] ; then stop start fi ;; reload) reload ;; graceful|help|configtest|fullstatus) $apachectl [email protected] RETVAL=$? ;; *) echo $"Usage: $prog {start|stop|restart|condrestart|reload|status| fullstatus|graceful|help|configtest}" exit 1 esac exit $RETVAL
650) This. width = 650; "Title =" tx's%g9g%kzr%i3oo2%y10r.jpg "src =" http://s3.51cto.com/wyfs02/M02/46/40/wKiom1PwwkmzsdLnAABkKRkJH0M726.jpg "alt =" wkiom1pwwkmzsdlnaabkkrkjh0m%.jpg "/>
This article from the fish blog, please be sure to keep this source http://kyfish.blog.51cto.com/1570421/1541396