BerkeleyDB
1./dist/configure --prefix=/usr/local/BerkeleyDB --enable-dbm --enable-share 2make 3make install
安装完成后,需要将 BerkeleyDB 的动态库,写入 /etc/ld.so.conf,否则有的程序找不到 BerkeleyDB 相应的动态库
1echo "/usr/local/BerkeleyDB/lib" > /etc/ld.so.conf 2ldconfig
Apr
======
安装 apache http server 和 apr-util,需要依赖于 apr。
1./configure --prefix=/usr/local/apr 2make 3make install
Apr-util
===========
安装 apache http server,需要依赖于 apr-util
1./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr --with-berkeley-db=/usr/local/BerkeleyDB 2make 3make install
Cronolog
apache 日志自动切割工具,可以减小 apache 日志文件大小,提高读写效率
1./configure --prefix=/usr/local/cronolog 2make 3make install
Apache HTTP Server 安装
========================
1./configure --prefix=/usr/local/apache --with-port=8080 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-shared=max --enable-deflate --disable-authn-user --enable-cache 2 --enable-file-cache --enable-cache-disk --enable-mime-magic --enable-expires --enable-remoteip --enable-static-support --enable-static-htpasswd --enable-info 3make 4make install
Apache HTTP Server 参数设置
ff
Apache HTTP Server service 脚本
================================
将以下内容,写入脚本:/etc/init.d/httpd
1#!/bin/bash 2# 3# httpd Startup script for the Apache HTTP Server 4# 5# chkconfig: - 85 15 6# description: The Apache HTTP Server is an efficient and extensible 7# server implementing the current HTTP standards. 8# processname: httpd 9# config: /usr/local/apache/conf/httpd.conf 10# config: /etc/sysconfig/httpd 11# pidfile: /var/run/httpd.pid 12# 13### BEGIN INIT INFO 14# Provides: httpd 15# Required-Start: $local_fs $remote_fs $network $named 16# Required-Stop: $local_fs $remote_fs $network 17# Should-Start: distcache 18# Short-Description: start and stop Apache HTTP Server 19# Description: The Apache HTTP Server is an extensible server 20# implementing the current HTTP standards. 21### END INIT INFO 22 23# Source function library. 24. /etc/rc.d/init.d/functions 25 26if [ -f /etc/sysconfig/httpd ]; then 27 . /etc/sysconfig/httpd 28fi 29 30# Start httpd in the C locale by default. 31HTTPD_LANG=${HTTPD_LANG-"C"} 32 33# This will prevent initlog from swallowing up a pass-phrase prompt if 34# mod_ssl needs a pass-phrase from the user. 35INITLOG_ARGS="" 36 37# Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server 38# with the thread-based "worker" MPM; BE WARNED that some modules may not 39# work correctly with a thread-based MPM; notably PHP will refuse to start. 40 41# Path to the apachectl script, server binary, and short-form for messages. 42APACHE_HOME=/usr/local/apache 43apachectl=${APACHE_HOME}"/bin/apachectl" 44httpd=${HTTPD-${APACHE_HOME}"/bin/httpd"} 45PROG=httpd 46pidfile=${PIDFILE-/var/run/httpd.pid} 47lockfile=${LOCKFILE-/var/lock/subsys/httpd} 48 49STOP_TIMEOUT=${STOP_TIMEOUT-10} 50RETVAL=0 51 52# The semantics of these two functions differ from the way apachectl does 53# things -- attempting to start while running is a failure, and shutdown 54# when not running is also a failure. So we just do it the way init scripts 55# are expected to behave here. 56start() { 57 echo -n $"Starting $PROG: " 58 LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS 59 RETVAL=$? 60 echo 61 [ $RETVAL = 0 ] && touch ${lockfile} 62 return $RETVAL 63} 64 65reload() { 66 echo -n $"Reloading $PROG: " 67 if ! LANG=$HTTPD_LANG $httpd $OPTIONS -t >&/dev/null; then 68 RETVAL=6 69 echo $"not reloading due to configuration syntax error" 70 failure $"not reloading $httpd due to configuration syntax error" 71 else 72 # Force LSB behaviour from killproc 73 LSB=1 killproc -p ${pidfile} $httpd -HUP 74 RETVAL=$? 75 if [ $RETVAL -eq 7 ]; then 76 failure $"httpd shutdown" 77 fi 78 fi 79 echo 80} 81 82# When stopping httpd, a delay (of default 10 second) is required 83# before SIGKILLing the httpd parent; this gives enough time for the 84# httpd parent to SIGKILL any errant children. 85stop() { 86 echo -n $"Stopping $PROG: " 87 killproc -p ${pidfile} -d ${STOP_TIMEOUT} $httpd 88 RETVAL=$? 89 echo 90 [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile} 91} 92 93case "$1" in 94 start) 95 start 96 ;; 97 force-reload|reload) 98 reload 99 ;; 100 restart) 101 stop 102 start 103 ;; 104 stop) 105 stop 106 ;; 107 status) 108 status -p ${pidfile} $httpd 109 RETVAL=$? 110 ;; 111 condrestart|try-restart) 112 if status -p ${pidfile} $httpd > &/dev/null; then 113 stop 114 start 115 fi 116 ;; 117 graceful|help|configtest|fullstatus) 118 $apachectl $@ 119 RETVAL=$? 120 ;; 121 *) 122 echo $"Usage: $PROG {start|stop|restart|condrestart|try-restart|force-reload|reload|status|fullstatus|graceful|configtest|help}" 123 RETVAL=2 124esac 125 126exit $RETVAL
chmod +x /etc/init.d/httpd
Apache HTTP Server 开机自启动
===========================
1chkconfig --add httpd 2chkconfig --level 235 httpd on