右下角运行的软件
左键单击
选择Appache (版本号)----》httpd.conf 选中打开
全局搜索 ctrl+f
DocumentRoot
#
# 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 "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options +Indexes +FollowSymLinks +Multiviews
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Require local
</Directory>
修改
${INSTALL_DIR}/www
成自己像要的目录即可
H:\demo
这样再次访问
127.0.0.1就变成了H:\demo目录
两个位置都要修改
Apache服务器网站根目录配置是个比较基本的操作,之前经常用,现在记一下笔记
打开Apache的配置文件,一般在Apache安装目录下的conf/httpd.conf配置文件中修改,
找到 DocumentRoot "E:/abc" 把后面的路径改成我们的根目录
然后找到 <Directory "E:/abc"> 把这个路径改成和上面的完全一样
保存httpd.conf文件,重启Apache服务器即可生效