Apache修改127.0.0.1的指向并解决修改后无法访问的问题

    打开Apache配置文件httpd.conf,找到DocumentRoot,将原来的路径那一行用#注释掉,再在下面写上自已的路径,比如这里我用的是DocumentRoot "C:/MyFiles".

改好后如下图所示:

  改完可能会出现You don't have permission to access / on this server的情况,出现这种情况则需要在配置文件中再改一项内容:

配置文件中定义了默认对网站根的访问权限:
# 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
Order deny,allow
Deny from all
</Directory>

将<Director>中间的内容改成如下,即可解决问题
<Directory />
Options Indexes FollowSymLinks
AllowOverride None
</Directory>

原文地址:https://www.cnblogs.com/lzj-0218/p/3468239.html