SELinux配置不当导致httpd无法在非80端口启动

检测是否为selinux导致httpd启动失败,若setenforce 0以后就可以启动,就表示selinux配置不当。

首先本机要支持semanage命令,安装方法网上有。

semanage  port -l | grep http  //查看润徐httpd的端口

[root@localhost logs]# semanage  port -l | grep http
http_cache_port_t tcp , , , , -
http_cache_port_t udp ,
http_port_t tcp , , , , ,
pegasus_http_port_t tcp
pegasus_https_port_t tcp

semanage port -a -t http_port_t -p tcp 81  //添加81端口

http_port_t                    tcp      , , , , , , 

再看就有了,然后

[root@localhost logs]# setenforce
[root@localhost logs]# service httpd start
Starting httpd:
[root@localhost logs]# service httpd status
httpd (pid ) is running...

开机启动

chkconfig httpd on

--------------------------------

页面错误

httpd You don't have permission to access / on this server.

日志显示

Permission denied: /home/airc/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

解决

chmod -R 755 /home/airc/

原因DocumentRoot的父目录权限错误

上一篇:【转】logback logback.xml常用配置详解(二)


下一篇:linux提权总结(外文)