Apache2 服务器不工作

Apache2 server not wotking

由于某种原因,我的 apache2 已停止工作。
我试过卸载它,问题仍然存在。
以下是我尝试过的一些命令及其结果,可能会对您有所帮助:-

"sudo systemctl status apache2":-

● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: 
   Active: failed (Result: exit-code) since Sun 2020-06-21 12:56:28 IST; 7min ag
     Docs: https://httpd.apache.org/docs/2.4/

Jun 21 12:56:21 kabir systemd[1]: Starting The Apache HTTP Server...
Jun 21 12:56:28 kabir apachectl[1086]: AH00558: apache2: Could not reliably dete
Jun 21 12:56:28 kabir apachectl[1086]: (98)Address already in use: AH00072: make
Jun 21 12:56:28 kabir apachectl[1086]: no listening sockets available, shutting 
Jun 21 12:56:28 kabir apachectl[1086]: AH00015: Unable to open logs
Jun 21 12:56:28 kabir apachectl[1086]: Action 'start' failed.
Jun 21 12:56:28 kabir apachectl[1086]: The Apache error log may have more inform
Jun 21 12:56:28 kabir systemd[1]: apache2.service: Control process exited, code=
Jun 21 12:56:28 kabir systemd[1]: apache2.service: Failed with result 'exit-code
Jun 21 12:56:28 kabir systemd[1]: Failed to start The Apache HTTP Server.

"sudo systemctl restart apache2":-

Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.

netstat -an | grep ":80"

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN     
tcp        0      0 192.168.43.128:33944    117.18.237.29:80        TIME_WAIT  
tcp        0      0 192.168.43.128:33864    117.18.237.29:80        ESTABLISHED
tcp        0      0 192.168.43.128:34524    23.217.53.84:80         ESTABLISHED
tcp        0      0 192.168.43.128:54364    172.217.166.163:80      ESTABLISHED
tcp        0      0 192.168.43.128:54206    172.217.166.163:80      TIME_WAIT  
tcp        0      0 192.168.43.128:33946    117.18.237.29:80        ESTABLISHED
tcp        0      0 192.168.43.128:34522    23.217.53.84:80         ESTABLISHED
tcp6       0      0 :::80                   :::*                    LISTEN 

"sudo apachectl start":-

Invoking 'systemctl start apache2'.
Use 'systemctl status apache2' for more info.
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
Action 'start' failed.
The Apache error log may have more information.

检查您的配置,因为该错误表明您已经有一个到同一端口的侦听指令。

sudo vim /etc/apache2/ports.conf [On Debian/Ubuntu]

sudo vim /etc/httpd/conf/httpd.conf [On RHEL/CentOS]

检查您是否没有监听您需要的端口。