搭建apahce服务器出现403的解决方法,防火墙开放80端口

  •   
  • 4916
  • Linux
  • 5
  • super_dodo
  • 2015/05/20

使用的是wampServer2.5的组件。安装过程请参照 http://www.dodobook.net/linux/1744 安装完成之后,在服务器上可以直接的访问localhost,显示正常。但是远程通过ip或者解析的域名去访问,显示403.

首先检查防火墙,防火墙开启状态,无法访问到该服务器的网站。为了方便调试,直接把防火墙关闭,这样就可以排除端口被禁的可能.

如果开启了防火墙也可以在服务器配置的时候,开放设置入站和出站的规则。开放80端口。这样开启防火墙的时候也可以通过80来访问服务器了。此外根据需要开启3306或者其他窗口。

QQ截图20150520161927

排除了服务器的端口的因素,直接来调整apahce的配置文件httpd.conf 关于其他部分的模块和组件请根据你的需要去开启。此处开启两个部分,即可解决远程的403。直接上代码。


# 修改成下面的代码块

<Directory />
 #   AllowOverride none
 #   Require all denied
	Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    allow from all
    Satisfy all
</Directory>


#改进的第二个部分


<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.
    #

#   onlineoffline tag - don't remove
#   Require local
	Order Deny,Allow
    Deny from all
    Allow from all
</Directory>


修改完毕之后,重启apahce服务,本地测试再远程测试,能正常访问,证明已解决403,若有其他错误请尽可能的查阅相关的文档。

相关阅读:

激活windows Server 2008 r2服务器的方法和工具

安装wampserver2.5时 没有找到MSVCR110.dll的解决办法

搭建apahce服务器出现403的解决方法,防火墙开放80端口

服务器apahce配置vhosts实现多站点的方法

鲜肉终究要腐烂,我在等待死亡。