Hack 81. Validate the httpd.conf after making changes

Use option -t to validate whether there are any issues with a specific Apache configuration file. In the example shown below, it displays that there is a problem at line 148 in the httpd.conf.debug. mod_auth_basicso is missing a . (period) before the so.

# httpd -t -f conf/httpd.conf.debug

httpd: Syntax error on line 148 of /etc/httpd/conf/httpd.conf.debug:
Cannot load /etc/httpd/modules/mod_auth_basicso into server:
/etc/httpd/modules/mod_auth_basicso: cannot open shared object file: No such file or directory

Once you fix the issue, it will display Syntax OK.

# httpd -t -f conf/httpd.conf.debug

Syntax OK