*************安装httpd*****************

1,安装

相关的包

httpd-2.4.9.tar.bz2 

apr-util-1.5.3.tar.bz2 

apr-1.5.0.tar.bz2

安装依赖

yum install pcre-devel -y依赖都是装devel包

安装apr-1.5.0.tar.bz2

cd /usr/local

tar -xf apr-1.5.0.tar.bz2

cd apr-1.5.0

./configure --prefix=/usr/local/apr 

make

make install

安装apr-util-1.5.3.tar.bz2

cd /usr/local

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

安装httpd 

cd /usr/local

tar -xf httpd-2.4.9.tar.bz2

cd httpd-2.4.9

./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-modules=most --enable-mpms-shared=all --with-mpm=event

make && make install

2,配置httpd

cp httpd httpd24 

vi httpd24

原文(apachectl=/usr/sbin/apachectl

httpd=${HTTPD-/usr/sbin/httpd})

修改后(apachectl=/usr/local/apache/bin/apachectl

httpd=${HTTPD-/usr/local/apache/bin/httpd})

chkconfig --add httpd24

chkconfig --list httpd24

chkconfig httpd24 on

vi /etc/profile.d/httpd24.sh

export PATH=/usr/local/apache/bin:$PATH

vi /etc/hosts

vim /etc/httpd24/httpd.conf 

Pidfile "/var/run/httpd/httpd.pid"

iptables -F 

通过浏览器访问:10.10.37.138 -->It works!

有缓存的话shift+F5强行刷新