Table of Contents
- SSH
- vsftpd
- ProFTPd
- ISC dhcpd
- Varnish
- Haproxy
- Apache
- Nginx
- Lighttpd
- PHP-FPM
- MySQL
- Sudo
- Syslog
- Logrotate
- Samba
- Postfix
- Exim
- Dovecot
- Ldap - Slapd
- Icinga / Nagios
- Squid
- Bind
- Unbound
- dnsmasq
- TCP Wrappers
- Filebeat
- Bacula
sshd -t
Example:
root@rockbox:/usr/share/nginx/html# sshd -t
Could not load host key: /etc/ssh/ssh_host_ed25519_key
Notes:
-t
indicates test which is a common options in servers to test configurations.- Most of these commands are run as root.
vsftpd
Example:
root@rockbox:/usr/share/nginx/html# vsftpd
500 OOPS: could not bind listening IPv4 socket
proftpd -t
or
proftpd -t -c /path/to/proftpd.conf
dhcpd -t -cf /path/to/dhcpd.conf
Notes:
-cf
is a single options, it’s not-c
and-f
. And-cf
stands for config-file
mysqld --help
varnishd -C -f /etc/varnish/default.vcl
haproxy -c -V -f /etc/haproxy/haproxy.cfg
Notes:
- To prevent errors, it's safer to check all config files rather than only the main config file:
haproxy -c $(for i in /etc/haproxy/*.cfg; do echo "-f $i"; done)
-
On RedHat Derived:
httpd -t
-
On Debian Derived
apache2ctl -t
nginx -t
Or use:
service nginx configcheck
lighttpd -t -f /etc/lighttpd/lighttpd.conf
-
For php5:
php-fpm5 -t
-
For php7.0:
php-fpm7.0 -t
-
For php7.1:
php-fpm7.1 -t
-
For php7.2:
php-fpm7.2 -t
Note:
To check a new configuration file, use:
php-fpm7.0 -t -y /path/to/file.conf
visudo -c
Or to verify a single sudoers.d file:
visudo -cf /etc/sudoers.d/webdev
syslog-ng -F -s -f /path/to/config
logrotate -d /etc/logrotate.conf
testparm
Example:
root@rockbox:~$ testparm
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Server role: ROLE_STANDALONE
postfix check
Or use:
postfix -vv
exim -bV
doveconf -c /etc/dovecot/dovecot.conf -n
slaptest -f /etc/slapd.conf
-
Icinga:
icinga -v /etc/icinga/icinga.cfg
-
Nagios:
nagios3 -v /etc/nagios/nagios.cfg
Or alternatively use the init script:
/etc/init.d/icinga show-errors
Or
/etc/init.d/nagios3 show-errors
squid -k check
Or use:
squid -k parse
named-checkconf /etc/bind/named.conf
Example:
named-checkconf named.conf
Syntax OK
Check syntax errors in zone files
named-checkzone domain-name /var/cache/bind/some_zone.db
Example:
named-checkzone example.com /var/named/chroot/var/named/exaple-zone.frd
named-checkzone example.com /var/named/chroot/var/named/exaple-zone.rev
unbound-checkconf /etc/unbound/unbound.conl
dnsmasq --test
tcpdchk -v
/usr/bin/filebeat.sh -v -c /etc/filebeat/filebeat.yml -configtest -d "*"
/usr/sbin/bacula-dir -t -c /etc/bacula/bacula-dir.conf