apache2 won't start
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apache2 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Ubuntu 20.04.3 LTS.
Clean install of apache2 (version 2.4.41-4ubuntu3.8 amd64)
apache2 won't start due to syntax error in config file, but I can't see the error.
Steps to reproduce:
sudo apt-get purge apache2
rm -r /etc/apache2
sudo apt-get install apache2
Expected to see: error-free start
What happened:
...
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/
Active: failed (Result: exit-code) since Sat 2021-12-04 10:48:59 GMT; 10ms ago
Docs: https:/
Process: 3059008 ExecStart=
Dec 04 10:48:59 mycomputer systemd[1]: Starting The Apache HTTP Server...
Dec 04 10:48:59 mycomputer apachectl[3059021]: apache2: Syntax error on line 147 of /etc/apache2/
Dec 04 10:48:59 mycomputer apachectl[3059008]: Action 'start' failed.
Dec 04 10:48:59 mycomputer apachectl[3059008]: The Apache error log may have more information.
Dec 04 10:48:59 mycomputer systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Dec 04 10:48:59 mycomputer systemd[1]: apache2.service: Failed with result 'exit-code'.
Dec 04 10:48:59 mycomputer systemd[1]: Failed to start The Apache HTTP Server.
...
The apache2 error log did not have more information:
/etc# ls -l /var/log/apache2/ access. log
total 0
-rw-r----- 1 root adm 0 Dec 4 10:48 access.log
-rw-r----- 1 root adm 0 Dec 4 10:48 error.log
-rw-r----- 1 root adm 0 Dec 4 10:48 other_vhosts_
The config file that is tripping it up is /etc/apache2/ mods-enabled/ alias.conf, which apart from empty lines and comment lines contains
<IfModule alias_module> apache2/ icons/"
Alias /icons/ "/usr/share/
<Directory "/usr/share/ apache2/ icons">
Options FollowSymlinks
AllowOverride None
Require all granted
</Directory>
</IfModule>
I don't know why this would be a problem.