22
0
Fork 0
wiki/HowtoCheckconf.md

227 lines
2.2 KiB
Markdown
Raw Normal View History

2017-03-31 00:43:51 +02:00
---
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.
2017-03-31 00:47:48 +02:00
# sudo
~~~
# visudo -cf /etc/sudoers
~~~
2017-03-31 00:43:51 +02:00
# FTP
## proftpd
~~~
2017-03-31 00:48:27 +02:00
# proftpd -t
Checking syntax of configuration file
Syntax check complete.
2017-03-31 00:43:51 +02:00
~~~
# SSH
## OpenSSH
Pour valider la configuration du serveur SSH :
2017-03-31 00:43:51 +02:00
~~~
# sshd -t -f /etc/ssh/sshd_config
2017-03-31 00:43:51 +02:00
~~~
Pour valider une clé publique :
~~~
# ssh-keygen -l -f .ssh/id_rsa.pub
~~~
2017-03-31 00:43:51 +02:00
# Mail
## OpenSMTPD
~~~
2017-05-24 20:48:31 +02:00
# smtpd -n
2017-03-31 00:43:51 +02:00
~~~
## Postfix
~~~
2017-03-31 00:51:46 +02:00
# postconf >/dev/null
2017-03-31 00:43:51 +02:00
~~~
## Spamassasin
~~~
spamassassin --lint
~~~
2017-03-31 00:43:51 +02:00
# DNS
## Bind
~~~
# named-checkzone domain /path/to/zone
# named-checkconf /etc/bind/named.conf
~~~
## NSD
~~~
2017-05-24 20:48:38 +02:00
# nsd-checkconf /var/nsd/etc/nsd.conf
2017-03-31 00:43:51 +02:00
~~~
2020-03-16 00:36:48 +01:00
## Unbound
2018-12-05 10:53:03 +01:00
~~~
2020-03-16 00:36:48 +01:00
# unbound-checkconf /var/unbound/etc/unbound.conf
2018-12-05 10:53:03 +01:00
~~~
# MySQL
2017-03-31 00:43:51 +02:00
~~~
2020-03-16 00:36:48 +01:00
# /usr/sbin/mysqld --help
2017-03-31 00:43:51 +02:00
~~~
2018-11-21 11:21:23 +01:00
# DHCP
## dhcpd
~~~
# dhcpd -n
~~~
2017-03-31 00:43:51 +02:00
# HTTP
## Apache
~~~
# apachectl -t
2018-01-28 17:54:01 +01:00
# apachectl configtest
2017-03-31 00:43:51 +02:00
~~~
## Haproxy
~~~
2017-06-05 16:38:20 +02:00
# haproxy -c -f /etc/haproxy/haproxy.cfg
2017-03-31 00:43:51 +02:00
~~~
## httpd
~~~
2017-03-31 00:47:51 +02:00
# httpd -dnv
2017-03-31 00:43:51 +02:00
~~~
## Fail2ban
~~~
# fail2ban-regex /chemin/fichier.log /etc/fail2ban/filter.d/config-exclusion.conf
2020-02-10 16:28:17 +01:00
~~~
## DRBD
2020-02-10 16:28:17 +01:00
~~~
# drbdadm dump
~~~
2019-11-05 17:08:56 +01:00
## Logrotate
~~~
# logrotate /etc/logrotate.d/
# logrotate -vdf /etc/logrotate.d/config-file
~~~
2017-03-31 00:43:51 +02:00
## Nginx
~~~
# nginx -t
~~~
2018-01-23 23:05:53 +01:00
## Php
~~~
# php5-fpm -t
~~~
2017-03-31 00:43:51 +02:00
## Varnish
~~~
# varnishd -Cf /etc/varnish/default.vcl > /dev/null
~~~
2020-06-01 11:25:31 +02:00
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
~~~
2017-08-25 10:45:34 +02:00
## Squid3
~~~
# squid -k parse
~~~
2017-03-31 00:43:51 +02:00
# Imap / pop
## Dovecot
~~~
2017-05-24 20:50:22 +02:00
# doveconf -n > /dev/null
2017-03-31 00:43:51 +02:00
~~~
# BGP
## OpenBGPD
~~~
# bgpd -nf /etc/bgpd.conf
2017-03-31 21:18:41 +02:00
~~~
2018-01-28 17:54:01 +01:00
# IRC
## Charybdis
~~~
$ charybdis-ircd -conftest
2018-02-13 11:56:17 +01:00
~~~
# Networking
2018-01-28 17:54:01 +01:00
~~~
2018-02-13 11:56:17 +01:00
# ifup --no-act eth0
2018-06-12 03:10:26 +02:00
~~~
# CUPS
~~~
# cupsd -t -c test.conf
~~~
# PHP-FPM
Changer la version en fonction.
~~~
# php-fpm7.3 -t
~~~