Guide for troubleshooting network services on a Linux system
This project is maintained by bertvv
The specific things on this layer mostly depend on the service in question. Apache, BIND, Vsftpd, Postfix, etc. all have quite different architecture and configuration.
However, there are a few general things that should be checked:
Check the log, either using journalctl
, or by looking at the log file in /var/log
. The former is standard, the latter may be needed for services that keep a log file not managed/recognized by systemd-journald
.
Open a separate terminal with the relevant logs opened and watching for changes (-f
option). E.g.:
sudo journalctl -f -u httpd.service
sudo tail -f /var/log/httpd/error_log
Check the configuration file, somewhere in /etc/
, e.g. /etc/httpd/httpd.conf
. First, create a backup of the current configuration file(s), and if possible the default one (as created when installing the service)
httpd
: apachectl configtest
sudo systemctl restart httpd.service
You can start checking availability on the loopback interface of the server itself, but it is important to repeat this from another host. The loopback interface is not firewalled, while physical network interfaces are.
sudo nmap -sS -p 80,443 HOST
(perform a TCP SYN scan on port 80 and 443)wget http://HOST/
, wget https://HOST/
curl http://HOST/
, curl https://HOST/