You need to restart your
Apache service for any changes you made to the config file to be effective. It is then very important for your to test your
Apache config for errors before restarting as it could cause the
Apache service to fail to start and disrupt the availability of your hosted websites.
Apache has built-in feature to test the validity of the config file that you can use to test your config files for errors or warnings. You could repeatedly check the configuration files until all the errors and warnings are gone before restarting the service.
You can use both
httpd tool to test your
Apache configuration from the terminal.
Apacheconfiguration file using your preferred text editor.
$ sudo vi /etc/apache2/apache2.conf
$ sudo apachectl configtest AH00543: apache2: bad user name username Action 'configtest' failed. The Apache error log may have more information.
-t option instead of
configtest if you're using
apache and not
Apacheconfiguration until no error is reported by the
$ sudo apachectl configtest Syntax OK
Apacheservice for the changes to take effect.
$ sudo systemctl restart apache2 # Ubuntu, Debian, openSUSE and SLES $ sudo systemctl restart httpd # CentOS and Red Hat
Comment anonymously. Login not required.