zoukankan      html  css  js  c++  java
  • 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      3128, 8080, 8118, 11211, 10001-10010
    http_cache_port_t              udp      3130, 11211
    http_port_t                    tcp      80, 443, 488, 8008, 8009, 8443
    pegasus_http_port_t            tcp      5988
    pegasus_https_port_t           tcp      5989

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

    http_port_t                    tcp      81, 80, 443, 488, 8008, 8009, 8443

    再看就有了,然后

    [root@localhost logs]# setenforce 1
    [root@localhost logs]# service httpd start
    Starting httpd: 
    [root@localhost logs]# service httpd status
    httpd (pid  21673) 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的父目录权限错误

  • 相关阅读:
    nyist 287 Redar
    nyist 14 会场安排问题
    nyist 90 整数分割
    nyist 123 士兵杀敌四
    nyist 116 士兵杀敌
    nyist 277 车牌号
    nyist 590 相同的和
    寄宿于WindowsService的WebAPI
    C#Dictionary 字典、泛型
    Repository模式
  • 原文地址:https://www.cnblogs.com/ShepherdIsland/p/3158153.html
Copyright © 2011-2022 走看看