软件版本:
Apache :apache_2.2.14-win32-x86-no_ssl.msi
1.Apache2.2
选择Custom,然后配置安装目录,默认向下,安装完Apache后。可以先测试下,
浏览器IP地址输入http://127.0.0.1。
您能看见这个页面,说明Apache web server 已经安装成功。您可以在这个目录中增加内容,或者把这个页面替换掉。
可以看到已经正常工作了。
开始配置Apache, 在安装目录下的 ~\Apache Software Foundation\Apache2.2\conf\, 编辑http.conf文件,这是一个文本文件,从开始菜单也能看到他的配置。
程序\Apache HTTP Server 2.2\Configure Apache Server\Edit the Apache httpd.conf Configuration File.
配置apaceh活动目录
查找关键字DocumentRoot,这个是网站根目录,可以更改为自己的目录。
查找Directory, 配置为跟DocumentRoot一样的目录,这个是必须要同步的。
原文如下:
This should be changed to whatever you set DocumentRoot to.
#
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "D:/Web/Apache Group/Apache2/htdocs"
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "D:/Web/Apache Group/Apache2/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
#
查找关键字,DirectoryIndex(目录索引,也就是在仅指定目录的情况下,默认显示的文件名),可以添加很多,系统会根据从左至右的顺序来优先显示,以单个半角空格隔开,比如有些网站的首页是index.htm,就在光标那里加上“index.htm”文件名是任意的,不一定非得“index.html”,比如“test.php”等,都可以。
可以添加并且把“index.php”设为默认索引文件,优先顺序就自己排了,我的是放在第一位。编辑完成,保存,关闭。
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents. The MultiViews Option can be used for the
# same purpose, but it is much slower.
#
DirectoryIndex index.html index.html.var
Apache的简单配置完成。