从http://httpd.apache.org/download.cgi找到最新版下载链接,现在最版稳定版链接是:
http://labs.renren.com/apache-mirror//httpd/httpd-2.2.19.tar.gz
cd /usr/local/src wget http://labs.renren.com/apache-mirror//httpd/httpd-2.2.19.tar.gz tar -zxvf httpd-2.2.19.tar.gz cd httpd-2.2.19 ./configure --prefix=/usr/local/apache --enable-vhost-alias --enable-rewrite --enable-info make make install
更多的configure选项可参考http://httpd.apache.org/docs/2.2/programs/configure.html
cp build/rpm/httpd.init /etc/init.d/httpd chmod 755 /etc/init.d/httpd chkconfig --add httpd chkconfig --level 35 httpd on
cd /etc mv httpd httpd_old ln -s /usr/local/apache/ httpd cd /usr/sbin/ ln -fs /usr/local/apache/bin/httpd ln -fs /usr/local/apache/bin/apachectl cd /var/log rm -rf httpd/ ln -s /usr/local/apache/logs httpd /etc/init.d/httpd start
service httpd restart service httpd start /usr/local/apache/bin/apachectl start /usr/local/apache/bin/apachectl stop /usr/local/apache/bin/apachectl status /etc/init.d/httpd start /etc/init.d/httpd stop /etc/init.d/httpd restart
使用pgrep查找启动的进程。
pgrep httpd
vi /usr/local/apache/conf/httpd.conf