先将文件拷贝到 /usr/local 目录,然后解压并修改目录名:
#tar -zxpf httpd-2.0.54.tar.gz
#cd httpd-2.0.54
#./configure --prefix=/usr/local/apache --enable-module=so
#make
#make install
配置Apache
#vi /usr/local/apache/conf/httpd.conf
找到下面两行,去掉前面的#注释,支持shtml解析。
#AddType text/html .shtml
#AddOutputFilter INCLUDES .shtml
找到 DirectoryIndex index.html index.html.var 后面添加 index.shtml
找到 DocumentRoot "/usr/local/apache/htdocs" 把/usr/local/apache/htdocs改为你存放网页文件的路径
找到 <Directory "/usr/local/apache/htdocs"> 先把/usr/local/apache/htdocs改为你存放网页文件的路径,然后把Options Indexes FollowSymLinks改成Options Includes FollowSymLinks
找到 AddDefaultCharset iso8859-1 如果有把iso8859-1改成GBK或者把这行注释掉
启动和停止Apache
#/usr/local/apache/bin/apachectl start 启动Apache
#/usr/local/apache/bin/apachectl stop 停止Apache
#/usr/local/apache/bin/apachectl restart 重启动Apache
为了让Apache能自动在Linux启动的时候就启动,可以将他们加入 /etc/rc.d/rc.local,方法
是 vi /etc/rc.d/rc.local ,在最后增加以下内容:
/usr/local/apache/bin/apachectl start