wiki/HowtoCheckconf.md
2021-01-11 17:39:15 +01:00

240 lines
2.3 KiB
Markdown

---
categories: system
title: Howto Checkconf
...
Avant de redémarrer un daemon, il vaut mieux s'assurer que sa
configuration est correcte. Cette page se veut être une cheat sheet
des différentes commandes existantes.
Le classement est fait par rapport au port réservé pour le logiciel
puis par ordre alphabétique.
# sudo
~~~
# visudo -cf /etc/sudoers
~~~
# FTP
## proftpd
~~~
# proftpd -t
Checking syntax of configuration file
Syntax check complete.
~~~
# SSH
## OpenSSH
Pour valider la configuration du serveur SSH :
~~~
# sshd -t -f /etc/ssh/sshd_config
~~~
Pour valider une clé publique :
~~~
# ssh-keygen -l -f .ssh/id_rsa.pub
~~~
# Mail
## OpenSMTPD
~~~
# smtpd -n
~~~
## Postfix
~~~
# postconf >/dev/null
~~~
## Spamassasin
~~~
spamassassin --lint
~~~
# DNS
## Bind
~~~
# named-checkzone domain /path/to/zone
# named-checkconf /etc/bind/named.conf
~~~
## NSD
~~~
# nsd-checkconf /var/nsd/etc/nsd.conf
~~~
## Unbound
~~~
# unbound-checkconf /var/unbound/etc/unbound.conf
~~~
# MySQL
~~~
# /usr/sbin/mysqld --help
~~~
# DHCP
## dhcpd
~~~
# dhcpd -n
~~~
# HTTP
## Apache
~~~
# apachectl -t
# apachectl configtest
~~~
## Haproxy
~~~
# haproxy -c -f /etc/haproxy/haproxy.cfg
~~~
## httpd
~~~
# httpd -dnv
~~~
## Fail2ban
~~~
# fail2ban-regex /chemin/fichier.log /etc/fail2ban/filter.d/config-exclusion.conf
~~~
## DRBD
~~~
# drbdadm dump
~~~
## Logrotate
~~~
# logrotate /etc/logrotate.d/
# logrotate -vdf /etc/logrotate.d/config-file
~~~
## Nginx
~~~
# nginx -t
~~~
## Php
~~~
# php5-fpm -t
~~~
## Varnish
~~~
# varnishd -Cf /etc/varnish/default.vcl > /dev/null
~~~
Dans certain cas, il est possible d'obtenir l'erreur `cannot open shared object file: Permission denied`, essayer de relancer la commande après avoir mis votre umask à `0007`.
## Samba
~~~
# testparm
~~~
## Squid3
~~~
# squid -k parse
~~~
# Imap / pop
## Dovecot
~~~
# doveconf -n > /dev/null
~~~
# BGP
## OpenBGPD
~~~
# bgpd -nf /etc/bgpd.conf
~~~
# IRC
## Charybdis
~~~
$ charybdis-ircd -conftest
~~~
# Networking
~~~
# ifup --no-act eth0
~~~
# CUPS
~~~
# cupsd -t -c test.conf
~~~
# PHP-FPM
Changer la version en fonction.
~~~
# php-fpm7.3 -t
~~~
# /etc/fstab
~~~
mount --fake --all --verbose
~~~
# rsyslog
~~~~
rsyslogd -N1
rsyslogd -N1 -f /etc/rsyslogd/foo.conf
~~~