在sourcefroge上下载了wampserver安装了后,本机可以访问,局域网其他机器无法访问
在 Windows2008系统下,由于系统安全限制的问题,80端口是封闭的,所以我们自己搭建的 Apache 或者 IIS 服务器在局域网中,别人的机器无法访问到。
现打开80端口:
在 控制面板 > 系统和安全 > Windows防火墙中 左侧点击 高级设置
点击左侧 入站规则,然后点击右侧的 新建规则,然后在弹出的入站规则向导中依次是
规则类型:端口
协议和端口我们选的是 TCP 协议和 特定本地端口(例:80)
操作:允许连接
何时应用规则中选中所有(域、公用、专用)
输入名称和描述
点击完成,就OK了。
经过以上设置,同局域网的其他计算机已经可以用你的IP地址访问你搭建的服务器了。
但是新的问题又出来了,外部计算机浏览器中显示为403错误。Forbidden You don't have permission to access / on this server.
这个又是目录访问权限的问题,打开httpd.conf文件
修改含有wamp/www段附近如下允许所有访问
DocumentRoot "d:/wamp/www/"
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
# Deny from all
Allow from all
#允许所有访问
Satisfy all
</Directory>
#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#
<Directory "d:/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.
#
# onlineoffline tag - don't remove
Allow from all
</Directory>
版权声明:本文为zero10100原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。