Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Restart Apache on your dedicated server

This guide shows you three ways to restart Apache, the program that serves your websites.

Dedicated Servers2 min read11 steps

What is Apache?

Apache is a web server program. When someone types your website address, Apache hands them the page. Sometimes you must restart it, for example after you change a setting. Restarting is like turning a switch off and on again. Your sites go offline for a few seconds.

You need root access for this guide. Root is the main administrator login of the server.

Option 1: WHM

  1. Log in to WHM as root at https://your-server-ip:2087.
  2. Type Restart Services in the search box.
  3. Click HTTP Server (Apache).
  4. Click Yes to confirm. WHM shows a message when it has finished.

Option 2: SSH

SSH is a safe way to type commands on a remote server.

  1. Connect to your server with SSH as root.
  2. On Red Hat style systems such as CentOS and AlmaLinux, type:
    systemctl restart httpd
    This restarts Apache fully.
  3. On Ubuntu or Debian, type:
    systemctl restart apache2
    The program has a different name there.
  4. Check that it runs.
    systemctl status httpd
    Look for the word active (running). On Ubuntu use apache2.

Older systems use service httpd restart. It does the same job.

Restart or reload?

A reload reads the new settings without cutting visitors off. Use it when you can.

systemctl reload httpd

This asks Apache to load its settings again without a full stop.

If Apache will not start

  1. Test the settings file.
    apachectl configtest
    This tells you if a setting has a mistake, and where.
  2. Fix the line it names.
  3. Try the restart again.
Tip: Restart at a quiet time. If you changed a config file, take a backup and run the test before you restart.

Quick recap

  • Apache serves your websites. Restarting it makes it load new settings.
  • In WHM, use Restart Services, then HTTP Server (Apache).
  • In SSH, use systemctl restart httpd (or apache2).
  • Run apachectl configtest if it fails.