Hack 81. Validate the httpd.conf after making changes

by Ramesh

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.

  1. # httpd -t -f conf/httpd.conf.debug
  2.  
  3. httpd: Syntax error on line 148 of /etc/httpd/conf/httpd.conf.debug:
  4. Cannot load /etc/httpd/modules/mod_auth_basicso into server:
  5. /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.

  1. # httpd -t -f conf/httpd.conf.debug
  2.  
  3. Syntax OK