WAMP 403 禁止来自外部来源
WAMP 403 forbidden from external sources
我在这里和其他地方阅读了大量主题,但 none 的建议都奏效了。我在 Windows Server 2012 R2 的全新安装上安装了最新版本的 WAMP 64 位。
我在 www
目录中创建了一个名为 andrew
的子目录。那是一个 index.html
文件。
我在主机文件中添加了以下内容:
127.0.0.1 andrew
::1 andrew
我在 httpd-vhosts.conf
文件中添加了以下内容:
<VirtualHost *:80>
DocumentRoot "c:/wamp64/www/andrew"
ServerName andrew
<Directory "c:/wamp64/www/andrew">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
我取消注释了 httpd.conf
中的虚拟主机行
- 我停止并启动了 net dnscache
- 我重新启动了 WAMP 服务
- 我"Put Online" WAMP 服务器
无论如何,当我从另一台机器(如 [server IP address]*/andrew/index.html
访问服务器时,我收到 403 Forbidden
错误。
这里是apache错误日志(“[SERVER IP]”真的是服务器的实际IP):
[Fri Apr 22 17:10:32.628356 2016] [mpm_winnt:notice] [pid 4680:tid 424] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Fri Apr 22 17:10:34.656507 2016] [mpm_winnt:notice] [pid 4444:tid 312] AH00364: Child: All worker threads have exited.
[Fri Apr 22 17:10:34.672087 2016] [mpm_winnt:notice] [pid 4680:tid 424] AH00430: Parent: Child process 4444 exited successfully.
[Fri Apr 22 17:10:34.921723 2016] [auth_digest:notice] [pid 4724:tid 416] AH01757: generating secret for digest authentication ...
[Fri Apr 22 17:10:34.952892 2016] [mpm_winnt:notice] [pid 4724:tid 416] AH00455: Apache/2.4.17 (Win64) PHP/5.6.16 configured -- resuming normal operations
[Fri Apr 22 17:10:34.952892 2016] [mpm_winnt:notice] [pid 4724:tid 416] AH00456: Apache Lounge VC14 Server built: Oct 11 2015 11:49:07
[Fri Apr 22 17:10:34.952892 2016] [core:notice] [pid 4724:tid 416] AH00094: Command line: 'C:\wamp64\bin\apache\apache2.4.17\bin\httpd.exe -d C:/wamp64/bin/apache/apache2.4.17'
[Fri Apr 22 17:10:34.952892 2016] [mpm_winnt:notice] [pid 4724:tid 416] AH00418: Parent: Created child process 4388
[Fri Apr 22 17:10:35.140157 2016] [auth_digest:notice] [pid 4388:tid 312] AH01757: generating secret for digest authentication ...
[Fri Apr 22 17:10:35.171357 2016] [mpm_winnt:notice] [pid 4388:tid 312] AH00354: Child: Starting 64 worker threads.
[Fri Apr 22 17:10:49.899265 2016] [authz_core:error] [pid 4388:tid 1040] [client 73.82.23.97:57193] AH01630: client denied by server configuration: C:/wamp64/www/andrew/index.html
[Fri Apr 22 17:10:50.055249 2016] [authz_core:error] [pid 4388:tid 1040] [client 73.82.23.97:57193] AH01630: client denied by server configuration: C:/wamp64/www/favicon.ico, referer: http://[SERVER IP]/andrew/index.html
我现在认为它与 Windows 2012 服务器上的某些设置有关,但我无法弄清楚。帮助。
因为 Apache 不知道将 IP 地址与您的虚拟主机相关联,所以它使用主服务器设置。可能您根本不需要虚拟主机,但还是试试这个:
<VirtualHost *:80>
DocumentRoot "c:/wamp64/www/andrew"
ServerName andrew
#of course, enter your IP address here
ServerAlias 1.2.3.4
<Directory "c:/wamp64/www/andrew">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
请不要忘记编辑 phpMyAdmin.conf 文件。它将节省您面对 403 错误 (403 Forbidden) 的时间。您应该设置 Require all granted 如下(独立于使用的 phpMyAdmin 版本):
Alias /phpmyadmin "c:/wamp64/apps/phpmyadmin5.0.2/"
<Directory "c:/wamp64/apps/phpmyadmin5.0.2/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride all
Require all granted
# To import big file you can increase values
php_admin_value upload_max_filesize 128M
php_admin_value post_max_size 128M
php_admin_value max_execution_time 360
php_admin_value max_input_time 360
</Directory>
我在这里和其他地方阅读了大量主题,但 none 的建议都奏效了。我在 Windows Server 2012 R2 的全新安装上安装了最新版本的 WAMP 64 位。
我在
www
目录中创建了一个名为andrew
的子目录。那是一个index.html
文件。我在主机文件中添加了以下内容:
127.0.0.1 andrew ::1 andrew
我在
httpd-vhosts.conf
文件中添加了以下内容:<VirtualHost *:80> DocumentRoot "c:/wamp64/www/andrew" ServerName andrew <Directory "c:/wamp64/www/andrew"> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost>
我取消注释了 httpd.conf
中的虚拟主机行
- 我停止并启动了 net dnscache
- 我重新启动了 WAMP 服务
- 我"Put Online" WAMP 服务器
无论如何,当我从另一台机器(如 [server IP address]*/andrew/index.html
访问服务器时,我收到 403 Forbidden
错误。
这里是apache错误日志(“[SERVER IP]”真的是服务器的实际IP):
[Fri Apr 22 17:10:32.628356 2016] [mpm_winnt:notice] [pid 4680:tid 424] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Fri Apr 22 17:10:34.656507 2016] [mpm_winnt:notice] [pid 4444:tid 312] AH00364: Child: All worker threads have exited.
[Fri Apr 22 17:10:34.672087 2016] [mpm_winnt:notice] [pid 4680:tid 424] AH00430: Parent: Child process 4444 exited successfully.
[Fri Apr 22 17:10:34.921723 2016] [auth_digest:notice] [pid 4724:tid 416] AH01757: generating secret for digest authentication ...
[Fri Apr 22 17:10:34.952892 2016] [mpm_winnt:notice] [pid 4724:tid 416] AH00455: Apache/2.4.17 (Win64) PHP/5.6.16 configured -- resuming normal operations
[Fri Apr 22 17:10:34.952892 2016] [mpm_winnt:notice] [pid 4724:tid 416] AH00456: Apache Lounge VC14 Server built: Oct 11 2015 11:49:07
[Fri Apr 22 17:10:34.952892 2016] [core:notice] [pid 4724:tid 416] AH00094: Command line: 'C:\wamp64\bin\apache\apache2.4.17\bin\httpd.exe -d C:/wamp64/bin/apache/apache2.4.17'
[Fri Apr 22 17:10:34.952892 2016] [mpm_winnt:notice] [pid 4724:tid 416] AH00418: Parent: Created child process 4388
[Fri Apr 22 17:10:35.140157 2016] [auth_digest:notice] [pid 4388:tid 312] AH01757: generating secret for digest authentication ...
[Fri Apr 22 17:10:35.171357 2016] [mpm_winnt:notice] [pid 4388:tid 312] AH00354: Child: Starting 64 worker threads.
[Fri Apr 22 17:10:49.899265 2016] [authz_core:error] [pid 4388:tid 1040] [client 73.82.23.97:57193] AH01630: client denied by server configuration: C:/wamp64/www/andrew/index.html
[Fri Apr 22 17:10:50.055249 2016] [authz_core:error] [pid 4388:tid 1040] [client 73.82.23.97:57193] AH01630: client denied by server configuration: C:/wamp64/www/favicon.ico, referer: http://[SERVER IP]/andrew/index.html
我现在认为它与 Windows 2012 服务器上的某些设置有关,但我无法弄清楚。帮助。
因为 Apache 不知道将 IP 地址与您的虚拟主机相关联,所以它使用主服务器设置。可能您根本不需要虚拟主机,但还是试试这个:
<VirtualHost *:80>
DocumentRoot "c:/wamp64/www/andrew"
ServerName andrew
#of course, enter your IP address here
ServerAlias 1.2.3.4
<Directory "c:/wamp64/www/andrew">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
请不要忘记编辑 phpMyAdmin.conf 文件。它将节省您面对 403 错误 (403 Forbidden) 的时间。您应该设置 Require all granted 如下(独立于使用的 phpMyAdmin 版本):
Alias /phpmyadmin "c:/wamp64/apps/phpmyadmin5.0.2/"
<Directory "c:/wamp64/apps/phpmyadmin5.0.2/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride all
Require all granted
# To import big file you can increase values
php_admin_value upload_max_filesize 128M
php_admin_value post_max_size 128M
php_admin_value max_execution_time 360
php_admin_value max_input_time 360
</Directory>