A 到apache官方网站上,下载apache的源码包(非binary版)。
B 安装Apache
# cd /usr/local/
# tar xvfz httpd-2.0.54.tar.gz
# cd httpd-2.0.54
# ./configure --prefix=/usr/local/apache --enable--so
# make
# make install
# cd /usr/local/apache/conf
# vi ./httpd.conf
将Listen 80 修改为Listen 127.0.0.1:80 (219行)
将ServerName 修改为ServerName LocalHost:80 (291行)
在DirectoryIndex中添加 index.jsp (394行)
# cd /usr/local/apache/bin/
# ./apachectl configtest
显示Syntax ok则表明安装成功
#./apachectl start
启动apache服务,浏览器中访问本机80端口,查看端口是否正常,输入127.0.0.1:80
# ./apachectl stop
关闭服务
备注:prefix定义apache的安装路径