1.运行apache_2.0.49-win32-x86-no_ssl.exe,一路点"确定"和"接受"就行,路径选
d:\server\apache group\apache2。
此时apache已经安装成功,且已运行,在IE中输入http://localhost/可以看到
apache的主页。安装成功!
2.修改httpd.conf
apache的配置文件是httpd.conf,位于apache根目录的下的conf文件夹下
(1).修改默认网站根目录:
在d:\server下建立文件夹www,以此作为网站的根目录
DocumentRoot "D:/server/Apache Group/Apache2/htdocs"
改为DocumentRoot "D:/server/www
(2).修改字符设置
apache解析中文网页时会产生乱码,
修改AddDefaultCharset ISO-8859-1为AddDefaultCharset GB2312
(3).修改默认主页
当访问目录时,apache会自动导入的主页,优先级以先后顺序为准
把DirectoryIndex index.html index.html.var改为
DirectoryIndex index.html index.jsp index.php default.jsp default.php index.html.var
(4).设置错误页面
这样对于你的网站会更安全些,如果没设置,别人在你的网址后随便输入一个路径,会显示404错
误,并且会显示你的服务器版本号,服务器配置一目了然,为了避免这种情况,可以设置错误页面。
当出现404错误,即找不到网页时,把访问者导入到一个错误页面
找到:
#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#
httpd.conf中的这一部分,#ErrorDocument 404 /missing.html
一行修改为ErrorDocument 404 /error/noFile.htm,其中noFile.htm为d:\server\www\error\下一个错误文件,需
要你自己建立。当发生404错误时,进入noFile.htm页面,可以提示网页没有找到。这样就不可能看到
你的服务器软件信息了。也可以设置其它的错误导向的页面,具体http响应错误编号请查阅相关资料。
重新启动apache,如果没意外,此时已经安装成功,把静态页面放到d:\server\www\error\目录下,看能不能成功解析。
随便输入一个:http://localhost/sdagasgdasasg.htm,看是不是导向你设置的404错误,即noFile.htm错误页面.
成功了吧!
关于apache中其他参数的意义,我就不说啦,你可以去网上查,其实最好的方法是看httpd.conf中的注释部
分,已经说得很清楚啦。
好啦,到此apache安装成功,你可以休息一下,听首音乐,开始下一步的安装:)

