设置一个新的开发服务器来运行PHP7,并接受一些培训并遇到僵局。
我可以从本地主机访问服务器,127.0.0.1没问题。但是,当我转到局域网上的另一台计算机时。我感到恐惧:
因此,为了安全起见,禁止
您无权访问此服务器上的/dev/lab.php。
我使用新界面查看新设置将如何创建虚拟主机。虚拟主机在本地工作正常,但不能从局域网上的另一台PC工作。apache_error.log
显示:
[authz_core:error] [pid 3408:tid 928] [client 192.168.1.38:54761] AH01630: client denied by server configuration: C:/wamp64/www/dev/lab.php
从我正在阅读的所有内容来看,它应该是对此的简单更改
<VirtualHost *:80>
ServerName dev
DocumentRoot c:/wamp64/www/dev
<Directory "c:/wamp64/www/dev/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
您可以看到我将"要求本地"更改为"要求全部授予"。没有喜悦!
仍然在其他局域网PC上获得禁止访问。
一旦我将本地主机更改为全部授予。子目录开始工作。然后我可以毫无问题地到达 http://192.168.1.36/dev。
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp64/www
<Directory "c:/wamp64/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
感谢您的提示。 我被WampServer 版本 3.0.6 64 位访问(Apache 版本 2.4.23)卡住了,这段代码有效。
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp64/www
<Directory "c:/wamp64/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
如果您
更改了Apache服务器的端口号,则必须在以下配置中提供相同的端口号。 例如,如果您的 Apache 端口号是 8080,那么您需要替换 httpd-conf 文件中的现有代码
<VirtualHost *:8080>
ServerName dev
DocumentRoot c:/wamp64/www/dev
<Directory "c:/wamp64/www/dev/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>