I'm new to Debian and new at it's Apache2 webserver. I made some configuration about virtual host and I restarted Apache2 via service apache2 reload
. I got this back: [FAIL] Reloading web server config: apache2 failed!
. Not surprised about that. Ok let's see the error log what's gone wrong, but there is nothing about the above fail in /var/log/apache2/error.log
. Is there another place where Apache2 log that fail?
2 Answers
If you suspect problems with your Apache 2 configuration, the easiest (and safest!) way to check that is to issue the command sudo apache2ctl configtest
.
If everything is correct, it will print Syntax OK
(or something similar), but if there are errors, it will tell you exactly what those errors are. What it does not do is have Apache actually load the configuration into the running server instance, so you don't break anything. It also won't write anything to your web server's log files. If configtest
comes back clean, the configuration should at least be mostly okay.
When you are satisfied that the configuration is likely correct, use apache2ctl graceful
or apache2ctl restart
to actually start using the new configuration.
I recommend checking out the man page for apache2ctl
for some of the finer details on these. Particularly, the man page does state that configtest
"does not catch all errors", but my experience is that it catches most that occur in real life when tweaking configuration.
Config most likey is broken, that or the package itself is broken
try sudo apt pruge apache2
then sudo apt install apache2
this removes the config and Apache
If this doesn't work check the ports and the /www/ files (.html and .php)
For me its usally a port error with my firewall (If forgot what came up in the logs, so it might not be)
-
-
But also, what does “check the ports and the
/www/
files (.html
and.php
)” mean? Commented Apr 2, 2019 at 13:59 -
@Scott
purge
sorry, it removes both a program and config files Commented Apr 3, 2019 at 13:35 -
Check if your ports are open and are not being blocked by a firewall, check if your files are comapatable with Apache, (make sure you install PHP) Commented Apr 3, 2019 at 13:36
sudo apache2ctl configtest
and see what comes out.ErrorLog
line but no log file was produced by Apache2.