check linux configuration files syntax for errors

OpenSSH/usr/sbin/sshd -t && echo $?
/usr/sbin/sshd -T
Apache/usr/sbin/apache2 -t
apachectl configtest
nginx/usr/local/nginx/sbin/nginx -t
/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf
lighttpd/usr/local/sbin/lighttpd -t -f /usr/local/etc/lighttpd/cyberciti.biz/lighttpd.conf
Bind (named server config)named-checkconf /etc/named.conf
Bind (zone syntx)named-checkzone cyberciti.biz /var/named/zone.cyberciti.biz
Squid proxy/usr/sbin/squid -k check
/usr/sbin/squid -k parse
MySQL servermysqld –verbose –help
/usr/libexec/mysqld –verbose –help 1>/dev/null
Postfix MTApostfix check
postfix -vvv
Samba SMB/CIFStestparm -v
tcpdtcpdchk
tcpdchk -v
dhcpd (DHCP / BOOTP) serverdhcpd -t -cf /path/to/dhcpd.testing.conf
vsftpd servervsftpd -olisten=NO /path/to/vsftpd.testing.conf
nagiosnagios -v /path/to/testing/nagios.cfg
Openntpd NTPD serverntpd -d -f /usr/local/etc/ntpd.conf -n
Xorg (X11 Server)Xorg -config /path/to/xorg.conf.new -retro
syslogd / rsyslogdrsyslogd -c4 -f /etc/rsyslog.testing.conf -N 1
CUPS Printing Systemcupsd -f -c /path/to/cupsd.testing.conf -t
slapd (OpenLDAP)slapd -Tt
varnishdvarnishd -C -f /path/to/wordpress.vlc
exim MTAexim -bV
Bash/Ksh scriptsbash -n ./myscript
ksh -n /path/to/script.ksh
BSD pf firewallpfctl -nf /etc/pf.conf
proftpdproftpd -t -c /path/to/proftpd.testing.conf
Perl scriptsperl -c /path/to/script.pl
perl -wc /path/to/script.pl

http://www.cyberciti.biz/tips/check-unix-linux-configuration-file-for-syntax-errors.html

 

Leave a Reply

Your email address will not be published. Required fields are marked *