*************安裝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強行刷新