404 error on Apache
When trying to login to my site I'm getting a 404 error. What can I do to troubleshoot this?
1 Reply
A 404 error might be caused by a virtualhost configuration issue. (For example: if the document root is set to a directory that doesn't exist.) You can check your Apache configuration file for errors using the below:
Debian and Ubuntu:
apache2ctl -t
Fedora and CentOS:
httpd -t
If you see the below failure in your logs, check on the status of Apache:
[FAILED] Failed to start The Apache HTTP Server.
Check Apache status:
systemctl status apache2.service
View the associated logs:
journalctl -xe
As for other general troubleshooting steps, if you recently made changes to your server that don't seem to be taking effect, it might help to restart or reload Apache:
Debian and Ubuntu:
/etc/init.d/apache2 reload
Fedora and CentOS:
/etc/init.d/httpd reload
Check your Apache logs to see if they point to anything specific. You can use
tail -f
to live-reload your error logs:tail -f /var/log/apache2/error.log
For more general troubleshooting steps, please see:
https://www.linode.com/docs/troubleshooting/troubleshooting-common-apache-issues/