wampserver部署笔记 设置apache使得外网可以访问

本文档详细介绍了在Windows2008系统下,如何解决因系统安全限制导致的Apache服务器无法在局域网中被访问的问题。通过开启80端口的Windows防火墙入站规则,以及修改httpd.conf配置文件允许所有访问,成功实现外网对WampServer的访问。但可能会遇到403 Forbidden错误,需调整目录访问权限。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在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>



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值