zl程序教程

您现在的位置是:首页 >  工具

当前栏目

Centos7.5启动Apache Web 服务报错AH00072: make_sock: could not bind to address [::]:9096

ApacheWeb服务 报错 to 启动 not could
2023-09-14 09:16:01 时间

环境:

本地华为桌面云服务器环境
Centos 7.5

问题描述:

启动Apache Web 服务报错AH00072: make_sock: could not bind to address [::]:9096

systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since 五 2022-02-18 11:04:04 CST; 2h 13min ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 13393 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 13391 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 13391 (code=exited, status=1/FAILURE)

218 11:04:03 localhost.localdomain httpd[13391]: (13)Permission denied: AH00072: make_sock: could not bind to address [::]:9096
218 11:04:03 localhost.localdomain httpd[13391]: (13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:9096
218 11:04:03 localhost.localdomain httpd[13391]: no listening sockets available, shutting down
218 11:04:03 localhost.localdomain httpd[13391]: AH00015: Unable to open logs
218 11:04:03 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
218 11:04:04 localhost.localdomain kill[13393]: kill: cannot find process ""
218 11:04:04 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
218 11:04:04 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
218 11:04:04 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.
218 11:04:04 localhost.localdomain systemd[1]: httpd.service failed.

解决方案:

本机selinux而导致的错误,调整selinux状态

1.修改配置文件
[root@localhost ~]# vim /etc/selinux/config

7 SELINUX=enforcing #把enforcing改为disabled

2.重启服务器
[root@localhost ~]# reboot

查看状态
#systemctl status httpd.service


● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since 五 2022-02-18 13:21:45 CST; 4s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 13393 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
 Main PID: 55869 (httpd)
   Status: "Processing requests..."
    Tasks: 6
   CGroup: /system.slice/httpd.service
           ├─55869 /usr/sbin/httpd -DFOREGROUND
           ├─55871 /usr/sbin/httpd -DFOREGROUND
           ├─55872 /usr/sbin/httpd -DFOREGROUND
           ├─55875 /usr/sbin/httpd -DFOREGROUND
           ├─55876 /usr/sbin/httpd -DFOREGROUND
           └─55877 /usr/sbin/httpd -DFOREGROUND

218 13:21:45 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
218 13:21:45 localhost.localdomain httpd[55869]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using ... message
218 13:21:45 localhost.localdomain systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.