It looks like you're new here. If you want to get involved, click one of these buttons!Sign In Register
It looks like you're new here. If you want to get involved, click one of these buttons!
This article provides troubleshooting steps for the Apache webserver .
If you have an issue with your site or webserver, firstly you should check your Apache status.
sudo systemctl status apache2
systemctl status httpd
If it isn’t, go ahead and restart Apache:
sudo service apache2 restart
sudo service httpd restart
Even if Apache is already operating, restarting the server might be helpful. This allows you to view the Apache starting message. If you receive an error, you can use the error text in an internet search to find further information.
Reloading enables Apache to reread its configuration files and implement the changes without requiring a full restart, avoiding downtime for the web server. Run the following command to refresh Apache's configuration:
To check for Apache errors, you can try to use the tail command with the -f flag, which shows you the most recent part of the log live as it’s updated. For instance:
tail -f /var/log/apache2/error.log
The access logs can also help you find specific information about visitors to your server. The default access log locations are:
Apache includes a syntax checking tool. You can use it to make sure you aren’t missing any brackets in your configuration files (and similar problems):
There is another Apache tool that lets you see all the virtual hosts on the server, their options, and the file names and line numbers of where they are defined.
It helps to identify all the domains that are configured on the server. Further, it helps to locate the correct file of the domain where the configuration details should be updated.
Explanation of the received output:
All your directives use IP addresses and port numbers that match the ones defined in the NameVirtualHost directives.
For example, if you have set NameVirtualHosts *:80, then the virtual host configuration should begin with:
If you make changes to a configuration option but don't see them take effect after reloading the server configuration, it's conceivable that a conflicting directive has overruled the new option. The most important thing to understand is that newer commands take precedence over previous ones that clash. As a result, the directive that has been read the most recently will always take effect.
Here are some points on how the directories are read:
If you still have an issue with troubleshooting your Apache web server, then it might take a deeper investigation of your VPS. So you might need to consult with VPS administrator.
Also, for more information about Apache webserver, you can find here.