Skip to content
RIPE NCC member · Local Internet RegistryCall us on 020 3318 3449sales@hosting-telecom.uk

The web server won’t start: nginx or Apache

The site on your own server doesn’t open: how to check nginx or Apache, find a configuration error and fix the common causes.

Contents

The site on your server has stopped opening, and systemctl restart doesn’t help. Work through the steps in order — the cause is usually found by the second or third.

1. Check the status

systemctl status nginx

For Apache, the service is apache2 on Ubuntu and Debian and httpd on AlmaLinux. The output includes the last lines of the log — often the error is already visible here. For more detail: journalctl -u nginx -n 50.

2. Test the configuration

sudo nginx -t                  # nginx
sudo apachectl configtest      # Apache

If an error crept in when you edited the settings, the command shows the file and line number. Fix it, test again and restart.

3. Look at the error log

nginx/var/log/nginx/error.log
Apache on Ubuntu and Debian/var/log/apache2/error.log
Apache on AlmaLinux/var/log/httpd/error_log

The last lines: sudo tail -n 50 /var/log/nginx/error.log.

Common causes

  • “Address already in use”. Port 80 or 443 is taken — often nginx and Apache are both trying to listen on it. Who is using the port and how to free it is covered in a separate article.
  • Certificate or key not found. Check the paths in the settings and the permissions on the files.
  • The disk is full. Check with df -h. Logs and old backups usually take up the most space.
  • SELinux on AlmaLinux stops the web server reading the site’s files or connecting to an application — how to fix this.
  • The server is running, but the site doesn’t open from outside. Check that the firewall allows ports 80 and 443, and that the domain points to the server’s IP address (domain lookup).

Didn’t find the answer? Ask our support team — we’ll help.

Choose which cookies we may use. You can change your mind at any time with the “Cookie settings” link at the bottom of every page.

Necessary

Always active

They keep the site secure and remember your cookie choice. They don’t identify you.

Google Analytics counts visits and shows which pages people find useful, so we can improve the site. Which cookies