不要在ubuntu上重新启动apache2

时间:2018-08-20 07:47:13

标签: apache ubuntu

在运行sudo service apache2 restart之后,显示此错误:

● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2018-08-20 07:36:07 UTC; 18s ago
Process: 27890 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Aug 20 07:36:07 debian apachectl[27890]: (98)Address already in use: AH00072: make_sock: could not bi
Aug 20 07:36:07 debian apachectl[27890]: (98)Address already in use: AH00072: make_sock: could not bi
Aug 20 07:36:07 debian apachectl[27890]: no listening sockets available, shutting down
Aug 20 07:36:07 debian apachectl[27890]: AH00015: Unable to open logs
Aug 20 07:36:07 debian apachectl[27890]: Action 'start' failed.
Aug 20 07:36:07 debian apachectl[27890]: The Apache error log may have more information.
Aug 20 07:36:07 debian systemd[1]: apache2.service: Control process exited, code=exited status=1
Aug 20 07:36:07 debian systemd[1]: Failed to start The Apache HTTP Server.
Aug 20 07:36:07 debian systemd[1]: apache2.service: Unit entered failed state.
Aug 20 07:36:07 debian systemd[1]: apache2.service: Failed with result 'exit-code'.

我使用bitnami gitlab在ubunti上安装了gitlab。

如何解决此错误?

1 个答案:

答案 0 :(得分:0)

您可以通过以下方式检查您的config是否正确

# apachectl configtest
Syntax OK

就像已经指出的那样,似乎该端口正在使用中,因此请检查哪个程序正在使用它

# netstat -tulpn

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp6       0      0 :::80                   :::*                    LISTEN      5170/apache2
tcp6       0      0 :::443                  :::*                    LISTEN      5170/apache2

然后使用

终止进程
kill -15 <proces_id>