For some websites, the Apache configuration file can grow quite complex over time.
When errors arise with the configuration, being able to quickly pinpoint the source of an error can reduce troubleshooting time.
Apache has two methods for troubleshooting configuration problems.
The first method is the httpd -t option, which can be used to check the Apache configuration file for syntax errors:
httpd -t -c httpd.conf
returns:
Syntax error on line 123 of /etc/httpd/httpd.conf: LogLevel requires level keyword: one of emerg/alert/crit/error/warn/notice/info/debug
NOTE: If an error is present, the configuration check option will print the line that contains the error, and a description of available options if it is able to detect a valid configuration directive.
If Apache fails to start and the configuration check option reports a valid configuration file, the Apache debug log level can be used to have Apache log additional data to the error_log.
To enable the debug log level, the LogLevel directive can be set to debug in the Apache configuration file.