我正在尝试使用此命令在我的Ubuntu 17.10上安装apache2:
sudo apt-get install -y apache2
在安装结束时,它失败了:
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 Wed 2018-02-07 13:38:15 EET; 6ms ago
Process: 10516 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
Main PID: 1403 (code=exited, status=0/SUCCESS)
CPU: 14ms
feb 07 13:38:15 username1-Latitude-5480 systemd[1]: Starting The Apache HTTP Server...
feb 07 13:38:15 username1-Latitude-5480 apachectl[10516]: apache2: Could not open configuration file /etc/apache2/apache2.conf: No such file or directory
feb 07 13:38:15 username1-Latitude-5480 apachectl[10516]: Action 'start' failed.
feb 07 13:38:15 username1-Latitude-5480 apachectl[10516]: The Apache error log may have more information.
feb 07 13:38:15 username1-Latitude-5480 systemd[1]: apache2.service: Control process exited, code=exited status=1
feb 07 13:38:15 username1-Latitude-5480 systemd[1]: Failed to start The Apache HTTP Server.
feb 07 13:38:15 username1-Latitude-5480 systemd[1]: apache2.service: Unit entered failed state.
feb 07 13:38:15 username1-Latitude-5480 systemd[1]: apache2.service: Failed with result 'exit-code'.
80端口是免费的
我需要做什么才能安装apache2而不会出现故障?
答案 0 :(得分:2)
Could not open configuration file /etc/apache2/apache2.conf:
请测试是否存在conf以及设置了哪个所有者