应该是左键单击 WAMPManager 菜单并单击 Put online 的简单案例。
这样做会改变httpd.conf的这一部分:
如果使用 Apache 2.2.x
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1 localhost
到这里:
# onlineoffline tag - don't remove
Order Allow,Deny
Allow from all
如果使用 Apache 2.4.x
# onlineoffline tag - don't remove
Require local
到这里:
# onlineoffline tag - don't remove
Require all granted
严格来说,这就是你应该做的所有事情!
但是,由于您已经对 httpd.conf 进行了一些手动操作,因此您需要检查一些事情。我假设您想将端口更改为 8080,而不是认为您出于某种原因必须这样做。如果您不想将端口号更改为 8080,请在以下信息中使用 80 而不是 8080。更改为 8080 只会让您的用户的生活更加复杂,但如果这只是一个游戏站点,我想这并不重要。
httpd.conf
# as your router probably does not support IPV6 change so apache only listens on IPV4
# you dont need to put the actual ip address of this PC in here as you say you did.
Listen 0.0.0.0:8080
# ServerName port need to match the Listen, your question made me think you may have left this as localhost:80
ServerName localhost:8080
如果使用 Apache 2.2.x
# Assuming your site is in c:\wamp\www ( this section should already exist I just removed all the comments for brevity)
<Directory "d:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Order Allow,Deny
Allow from all
</Directory>
如果使用 Apache 2.4.x
# Assuming your site is in c:\wamp\www ( this section should already exist I just removed all the comments for brevity)
<Directory "d:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Require from all
</Directory>
如果您犯了更改此部分的常见错误,请将其改回此部分,否则您将向任何人授予对 C:\ 的访问权限。
如果使用 Apache 2.2.x
<Directory />
Options FollowSymLinks
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>
如果使用 Apache 2.4.x
<Directory />
Options FollowSymLinks
Require all denied
</Directory>
我希望这里的某些东西能让你偶然发现自己的错误或疏忽。
编辑:附加信息
phpMyAdmin 可以防止这样的窥探:
编辑 c:\wamp\alias\phpmyadmin.conf
Alias /phpmyadmin "d:/wamp/apps/phpmyadmin3.5.1/"
# to give access to phpmyadmin from outside
# replace the lines
#
# Order Deny,Allow
# Deny from all
# Allow from 127.0.0.1
#
# by
#
# Order Allow,Deny
# Allow from all
#
<Directory "d:/wamp/apps/phpmyadmin3.5.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
请参阅Allow from 127.0.0.1 行,该行阻止与使用它的数据库不在同一台 PC 上的任何人。
因此,如果您尝试从 Internet 访问它,它将无法正常工作。
我想您可以暂时将其更改为:
Order Allow,Deny
Allow from all
或者如果你知道要测试它的IP地址,你可以做的更好
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1 localhost
Allow from xxx.yyy.zzz.aaa
其中 xxx.yyy.zzz.aaa 是您朋友的 IP 地址。