我正在使用WAMP服务器来运行我的网站。我使用的是Windows 7。
我在2台PC之间创建了LAN,我想从第二台PC访问我的本地主机 请注意,我没有使用Internet连接,因此无法使用IP地址。
请给我你的建议。
答案 0 :(得分:7)
您必须修改httpd.conf
并找到以下行:Listen 127.0.0.1:80
然后记下您为LAN设置的所需IP。不要使用自动IP。
例如:Listen 192.168.137.1:80
我使用192.167.137.1
作为Windows 7的LAN IP。重启Apache并享受分享。
答案 1 :(得分:6)
IP可以是任何LAN或WAN IP地址。但是你要设置防火墙连接允许它。
与webserver pc的设备连接可以通过LAN或WAN进行 (即wifi,连接,adhoc,有线电视,mypublic wifi等)
您应该按照以下步骤操作:
此IP将是具有Web服务器的设备。
答案 2 :(得分:4)
Actualy您不需要互联网连接即可使用IP地址。 LAN中的每台计算机都有一个内部IP地址,您可以通过运行
来发现ipconfig /all
in cmd。
您可以使用服务器的IP地址(可能是192.168.0.x或10.0.0.x)来远程访问网站。
如果你发现了ip并且仍然无法访问该网站,这意味着WAMP没有配置为响应该名称(你叫我什么?192.168.0.3?那不是我的名字。我是Localhost)你有修改...... / apache / config / httpd.conf
Listen *:80
答案 3 :(得分:-1)
<Directory "c:/wamp/www"><!-- maybe other url-->
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
# Require all granted
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
Allow from localhost
</Directory>
3- 更改:拒绝无
像这样:
<Directory "c:/wamp/www">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
# Require all granted
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from none
Allow from 127.0.0.1
Allow from ::1
Allow from localhost
4- 重新启动 Apache 不要忘记重启Apache或所有服务!!!