Command to check Apache web server syntax

While restarting the Apache web server, its not working and not throwing any error message but showing that its restarted but still no Apache proc id is created, all the domains are down and not available. In that case check the Apache error logs as well as server disk space but nothing seems to be wrong then refer the following steps and check if any syntax error is present in the server main Apache web service.

/etc/init.d/httpd -t

or

apachectl configtest

or

/etc/init.d/httpd configtest

or

httpd -S

Above all the commands will show you the following result, if the servers main Apache configuration file syntax is fine and if you receive any error then resolve the error message and restart the Apache web service.

Syntax OK

 

About Anant 384 Articles
Senior technical writer