Monday, May 23, 2011

Commands to check errors in configuration files

In Linux, Once the service configuration has been done we can check the configuration files for errors.

Check Samba configuration file for errors with "testparm" command.
# testparm

Check HTTP(apache) configuration file for errors with the following commands
# apchectl configtest
# httpd -t
# service httpd configtest
(You can use any of the above commands to check the errors for apache)

Check SSH configuration file for errors
# sshd -t

Check  DNS configuration file for errors
# named-checkconf  /var/named/chroot/etc/named.conf
The above command will check the configuration file for errors

If you want to check the DNS zone file for errors , use the following command
Syntax: named-checkzone <domain name>  <path to zone file>
Ex: # named-checkzone  www.example.com  /var/named/chroot/var/named/zone.example.com

If the commands display the result as "OK" then the service is properly configured and you can restart the services or if you get any errors fix them.






No comments:

Post a Comment