如果把apache2安装到了C盘,则其默认主目录或者说网站的根目录是:“C:/Program Files/Apache Group/Apache2/htdocs”
但为了方便,可以将这个目录改为自己愿意的一个目录,如:“D:/phpwebroot”,则需修改“C:/Program Files/Apache Group/Apache2/conf”中的文件:httpd.conf:修改的地方如下面红色标识处,改为自己想要的目录:
所需注意的是有两处修改,而不是一处:
#
DocumentRoot "D:/phpwebroot"
#
# 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:/phpwebroot">
#