天天看点

Apache(httpd) 报错You don't have permission to access /on this server.

项目需要,增加个访问端口,指向不同目录。

但是一直报“You don't have permission to access /on this server.”错误

配置文件语法检查:

<code>#/etc/init.d/httpd configtest 或 apachectl -t</code>

直接输入:/etc/init.d/httpd 会新显示选项

<code>[root@centos ~]</code><code># /etc/init.d/httpd </code>

<code>Usage: httpd {start|stop|restart|condrestart|try-restart|force-reload|reload|status|fullstatus|graceful|help|configtest}</code>

检查无误:会提示Syntax OK

<code>[root@shopdev1 conf]</code><code># apachectl -t</code>

<code>Syntax OK</code>

用namei -m /home/tomcat/html 列出这个路径下所有的权限和所属组。

最后经过查看,突然发现,html父目录tomcat是只给了775的权限,给了777权限访问成功。

本文转自 piazini 51CTO博客,原文链接:http://blog.51cto.com/wutou/1897272