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

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


配置文件语法检查:

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

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

[root@centos ~]# /etc/init.d/httpd 
Usage: httpd {start|stop|restart|condrestart|try-restart|force-reload|reload|status|fullstatus|graceful|help|configtest}

检查无误:会提示Syntax OK

[root@shopdev1 conf]# apachectl -t
Syntax OK

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

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