安装配置:
1.代理服务器
(1) 编译安装apr
yum groupinstall "Developmenttools" -y
yum groupinstall "DevelopmentLibraries" -y
# tar xf apr-1.5.1.tar.gz
# cd apr-1.5.1
# ./configure --prefix=/usr/local/apr
# make && make install
(2) 编译安装apr-util
# tar xf apr-util-1.5.3.tar.gz
# cd apr-util-1.4.1
# ./configure --prefix=/usr/local/apr-util--with-apr=/usr/local/apr
# make && make install
安装pcre
tar xf pcre-8.35.tar.gz
cd pcre-8.35
./configure --prefix=/usr/local/pcre
# make && make install
安装openssl
tar xf openssl-0.9.8zc.tar.gz
cd openssl-0.9.8zc
./config --prefix=/usr/local/openssl
make & make install
编译安装httpd-2.4.9
首先下载httpd-2.4.9到本地,而后执行如下命令进行编译安装过程:
# tar xf httpd-2.4.9.tar.bz2
# cd httpd-2.4.9
./configure --prefix=/usr/local/apache--sysconfdir=/etc/httpd --enable-so --enable-ssl=/usr/local/openssl/--enable-cgi --enable-rewrite --with-zlib --with-pcre=/usr/local/pcre/--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util--enable-mpms-shared=all --with-mpm=event --enable-proxy --enable-proxy-http--enable-proxy-ajp --enable-proxy-balancer --enable-lbmethod-heartbeat --enable-heartbeat --enable-slotmem-shm --enable-slotmem-plain --enable-watchdog --enable-proxy-balancer --enable-lbmethod-heartbeat--enable-heartbeat --enable-slotmem-shm
--enable-slotmem-plain --enable-watchdog
# make && make install
修改httpd的主配置文件,设置其Pid文件的路径
编辑/etc/httpd/httpd.conf,添加如下行即可:
PidFile "/var/run/httpd.pid"
4、提供SysV服务脚本/etc/rc.d/init.d/httpd,内容如下:
#!/bin/bash
#
# httpd Startup script for the Apache HTTPServer
#
# chkconfig: - 85 15
# description: Apache is a World Wide Webserver. It is used to serve \
# HTML files and CGI.
# processname: httpd
# config: /etc/httpd/conf/httpd.conf
# config: /etc/sysconfig/httpd
# pidfile: /var/run/httpd.pid
# Source function library.
. /etc/rc.d/init.d/functions
if [ -f /etc/sysconfig/httpd ]; then
. /etc/sysconfig/httpd
fi
# Start httpd in the C locale by default.
HTTPD_LANG=${HTTPD_LANG-"C"}
# This will prevent initlog from swallowingup a pass-phrase prompt if
# mod_ssl needs a pass-phrase from theuser.
INITLOG_ARGS=""
# Set HTTPD=/usr/sbin/httpd.worker in/etc/sysconfig/httpd to use a server
# with the thread-based "worker"MPM; BE WARNED that some modules may not
# work correctly with a thread-based MPM;notably PHP will refuse to start.
# Path to the apachectl script, serverbinary, and short-form for messages.
apachectl=/usr/local/apache/bin/apachectl
httpd=${HTTPD-/usr/local/apache/bin/httpd}
prog=httpd
pidfile=${PIDFILE-/var/run/httpd.pid}
lockfile=${LOCKFILE-/var/lock/subsys/httpd}
RETVAL=0