使用的是wampServer2.5的组件。安装过程请参照 http://www.dodobook.net/linux/1744 安装完成之后,在服务器上可以直接的访问localhost,显示正常。但是远程通过ip或者解析的域名去访问,显示403.
首先检查防火墙,防火墙开启状态,无法访问到该服务器的网站。为了方便调试,直接把防火墙关闭,这样就可以排除端口被禁的可能.
如果开启了防火墙也可以在服务器配置的时候,开放设置入站和出站的规则。开放80端口。这样开启防火墙的时候也可以通过80来访问服务器了。此外根据需要开启3306或者其他窗口。
排除了服务器的端口的因素,直接来调整apahce的配置文件httpd.conf 关于其他部分的模块和组件请根据你的需要去开启。此处开启两个部分,即可解决远程的403。直接上代码。
# 修改成下面的代码块
# AllowOverride none
# Require all denied
Options FollowSymLinks
AllowOverride None
Order deny,allow
allow from all
Satisfy all
#改进的第二个部分
#
# 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
修改完毕之后,重启apahce服务,本地测试再远程测试,能正常访问,证明已解决403,若有其他错误请尽可能的查阅相关的文档。
相关阅读:
鲜肉终究要腐烂,我在等待死亡。