Apache (Web Server) - Check configuration using the httpd command

by
Jeremy Canfield |
Updated: November 08 2022
| Apache (Web Server) articles
The httpd command with the -t flag can be used to check for syntax errors in a web server configuration files (e.g. httpd.conf).
<web_server_root>/bin/httpd -t
Or, the apachectl command can be used.
<web_server_root>/bin/apachectl -t
If you have multiple web server configuration files (e.g. httpd.conf), the -f option can be used to point to a specific httpd.conf file.
<web_server_root>/bin/httpd -f <web_server_root>/conf/httpd.conf -t
If there are no syntax errors in the httpd.conf file, "Syntax OK" should be returned.
Syntax OK
On the other hand, if a syntax error is found, something like this should be returned.
httpd: Syntax error on line 198 of /opt/IHS/conf/httpd.conf: Cannot load modules/mod_ibm_ssl.so into server: /opt/IHS/modules/mod_ibm_ssl.so: undefined symbol: ihs_socket_iol_push
Did you find this article helpful?
If so, consider buying me a coffee over at