I have the task to transfer apache settings from an old linux system to a new system (Ubuntu 20.04.5 LTS). After copying the /etc/apache2 folders to the new server and restarting the apache I had some problems which were caused by missing libraries in the config files. I fixed those and
$ sudo /usr/sbin/apachectl -t
Syntax OK
gives me the ok on my configuration files.
However when I try to start the apache again this happens:
$ sudo service apache2 start
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
journalctl -xe has nothing and v goves me the following:
$ systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2022-10-13 16:05:54 UTC; 50s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 41669 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
So the informations basically "you have an error because you have an error"
How can I get the apache start more verbose to get hints what the problem might be?
I already had a look here
The problem with the recommendations by systemd in 20.04 and elsewhere is that you're not guaranteed to get data in the logs that's useful with those.
journalctl -xe
includes extra noise and junk not related to Apache, andsystemctl status
will only get you the last run/load stanza which will not give you useful information.To really find out what you're having a problem with, you need to use
journalctl
but with different options. Runjournalctl -u apache2.service -n 50
to get the last 50 lines from the journal logs. Increase that number50
to however many lines oyu need to get the error messages.(Note that in 22.04 and later, the systemd error output indicates to add
u
to the arguments and specify the service that failed to get service-specific logs.)from your comments you indicated you found these errors following these instructions:
You can chase that error down in separate discussion threads here or simple Google, but at least you know the error you're running into now!