Heim  >  Artikel  >  Backend-Entwicklung  >  在服务器上部署了一个php项目 不能通过域名访问该服务器 出现403

在服务器上部署了一个php项目 不能通过域名访问该服务器 出现403

WBOY
WBOYOriginal
2016-06-06 20:28:252229Durchsuche

windows server 2008系统 wampserver集成环境
绑定域名用的是这个方法:
启动wamp开打httpd.conf找到Include conf/extra/httpd-mpm.conf把前面的#号去掉。

在找到D:wampbinapacheApache2.4.4confextra目录下的httpd-vhosts.conf文件

里面有事例。按照事例写我们自己的

<code>ServerAdmin admin@xxx.com
DocumentRoot "D:/wamp/www/xxx.com"
ServerName www.xxx.com
ErrorLog "logs/www.xxx.com-error.log"
CustomLog "logs/www.xxx.com-access.log" common</code>

打开host文件,写入 127.0.0.1 www.xxx.com

回复内容:

windows server 2008系统 wampserver集成环境
绑定域名用的是这个方法:
启动wamp开打httpd.conf找到Include conf/extra/httpd-mpm.conf把前面的#号去掉。

在找到D:wampbinapacheApache2.4.4confextra目录下的httpd-vhosts.conf文件

里面有事例。按照事例写我们自己的

<code>ServerAdmin admin@xxx.com
DocumentRoot "D:/wamp/www/xxx.com"
ServerName www.xxx.com
ErrorLog "logs/www.xxx.com-error.log"
CustomLog "logs/www.xxx.com-access.log" common</code>

打开host文件,写入 127.0.0.1 www.xxx.com

检查权限,检查目录是否正确

一般403 forbidden的问题,你要检查apache conf文件。
尤其是在

Order Deny,Allow
Allow from all
Require all granted

这种地方,你要尤其注意。
至于具体含义,你自己去搜索资料。一般403都是由于对目录的配置不恰当造成的。
祝一切顺利。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn