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
- Log in to WHM as root at
https://your-server-ip:2087. - Type Restart Services in the search box.
- Click HTTP Server (Apache).
- 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.
- Connect to your server with SSH as root.
- On Red Hat style systems such as CentOS and AlmaLinux, type:
This restarts Apache fully.systemctl restart httpd - On Ubuntu or Debian, type:
The program has a different name there.systemctl restart apache2 - Check that it runs.
Look for the word active (running). On Ubuntu usesystemctl status httpdapache2.
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
- Test the settings file.
This tells you if a setting has a mistake, and where.apachectl configtest - Fix the line it names.
- 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(orapache2). - Run
apachectl configtestif it fails.