【发布时间】:2013-04-24 12:36:40
【问题描述】:
你好朋友, 我通过将此链接 [http://myipaddress/www.abc.com] 提供给我的朋友来显示我的网站 通过互联网这里我正在使用我的宽带连接,但现在我购买了一个路由器,我是 通过它连接我的互联网 现在,当我提供相同的链接时。他们无法访问我的网站。需要帮助。
提前谢谢你
【问题讨论】:
标签: php networking wifi hardware configure
你好朋友, 我通过将此链接 [http://myipaddress/www.abc.com] 提供给我的朋友来显示我的网站 通过互联网这里我正在使用我的宽带连接,但现在我购买了一个路由器,我是 通过它连接我的互联网 现在,当我提供相同的链接时。他们无法访问我的网站。需要帮助。
提前谢谢你
【问题讨论】:
标签: php networking wifi hardware configure
您需要移植您的 Apache 端口(通常为 80,除非指定不同
了解如何使用路由器进行端口转发。
访问您的路由器设置?如果你不知道:
你应该看到:
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::d168:1665:65c:7c2e%12
IPv4 Address. . . . . . . . . . . : 192.168.0.2
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
或者看起来像这样的东西。
【讨论】:
您需要将端口“80”(或您的 http 服务器使用的端口)转发到为其提供服务的本地计算机。
【讨论】:
就像 Maresh 所说,您需要将路由器中的 http 端口 (80) 转发到为网站提供服务的计算机,如果您使用的是 apache,请编辑 httpd.conf 文件。
这是我的样子,我只允许本地网络上的用户
DocumentRoot "c:/wamp/www/"
<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:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
# Online --> Require all granted
# onlineoffline tag - don't remove
Require local
#Require all granted
</Directory>
要允许广域网,请从“#Require allgranted”中删除 # 并将其放在“Require local”前面。
以上代码只是 httpd.conf 文件中的一部分,但这是您要编辑的部分,在编辑器中搜索“需要本地”以找到它。
【讨论】: