我正在尝试使用Apache设置Web服务器。我成功安装了它,并通过打开localhost尝试了它。该页面为空,除了:
Forbidden
You don't have permission to access / on this server.
Apache/2.4.16 (Win32) Server at localhost Port 80
所以,当然,我对错误进行了搜索,发现了以下SO线程,其他人似乎已经解决了这个问题:
Error message "Forbidden You don't have permission to access / on this server"
Forbidden You don't have permission to access / on this server
apache: don't have permission to access / on this server. when I am using virtualhost
顺便过去 Error message "Forbidden You don't have permission to access / on this server" ,据我所知,我应该能够在httpd.config或httpd-vhosts.config中找到类似这样的内容:
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Allow from all
</Directory>
但是,我没有评论的整个httpd-vhosts.conf看起来像这样:
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/apache24ah64/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "/apache24ah64/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
和httpd.confs&#34;目录/&#34;看起来像这样
<Directory />
AllowOverride none
Require all denied
</Directory>
我不确定我是否应该修改我能找到的东西,主要是因为如果我做错了,我不敢搞砸它。特别是因为每个线程似乎都有自己稍微变化的解决方案,我不能一次尝试它们。
哪种解决方案最简单(最不可能产生错误),但仍然有效?或者,我在上述那个中缺少什么?