Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /lib/systemd/system/apache2.service.
Created symlink /etc/systemd/system/multi-user.target.wants/apache-htcacheclean.service → /lib/systemd/system/apache-htcacheclean.service.
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
invoke-rc.d: initscript apache2, action "start" failed.
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Fri 2019-08-30 13:49:57 CEST; 9ms ago
Process: 10297 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
Main PID: 13929 (code=exited, status=0/SUCCESS)
Aug 30 13:49:57 entrospace.nilebasin.org systemd[1]: Starting The Apache HTTP Server...
Aug 30 13:49:57 entrospace.nilebasin.org apachectl[10297]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Aug 30 13:49:57 entrospace.nilebasin.org apachectl[10297]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Aug 30 13:49:57 entrospace.nilebasin.org apachectl[10297]: no listening sockets available, shutting down
Aug 30 13:49:57 entrospace.nilebasin.org apachectl[10297]: AH00015: Unable to open logs
Aug 30 13:49:57 entrospace.nilebasin.org apachectl[10297]: Action 'start' failed.
Aug 30 13:49:57 entrospace.nilebasin.org apachectl[10297]: The Apache error log may have more information.
Aug 30 13:49:57 entrospace.nilebasin.org systemd[1]: apache2.service: Control process exited, code=exited status=1
Aug 30 13:49:57 entrospace.nilebasin.org systemd[1]: apache2.service: Failed with result 'exit-code'.
Aug 30 13:49:57 entrospace.nilebasin.org systemd[1]: Failed to start The Apache HTTP Server.
Processing triggers for systemd (237-3ubuntu10.3) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ufw (0.35-5) ...
答案1
看来端口 80 已被使用。因此,查看哪些端口正在使用。
你可以通过命令找到使用端口 80 的进程lsof -i:80'
,或者如果你想释放端口 80,那么你可以通过运行命令来终止该进程sudo kill -9 $(sudo lsof -t -i:80)
此后请使用以下命令重新启动 apache2sudo service apache2 start
我希望它能对你有所帮助。