Domain

How to Restart Apache and Nginx on VPS Hosting

Introduction

Apache and Nginx are the two most commonly used web servers in VPS hosting environments.

Sometimes you may need to restart your web server after configuration changes, SSL installation, PHP updates, or troubleshooting website problems.

This guide explains how to restart Apache and Nginx safely on your VPS server.

How to Restart Apache Server

Use the following command:

systemctl restart apache2

Check Apache server status:

systemctl status apache2

How to Restart Nginx Server

Restart Nginx using:

systemctl restart nginx

Check Nginx server status:

systemctl status nginx



How to Reload Without Downtime

Reload Apache:

systemctl reload apache2

Reload Nginx:

systemctl reload nginx

Enable Web Server on Boot

Enable Apache:

systemctl enable apache2

Enable Nginx:

systemctl enable nginx
Common Server Errors

1. Apache Failed to Start

Check configuration syntax:

apachectl configtest

2. Nginx Configuration Error

Test Nginx configuration:

nginx -t

3. Port Already in Use

Another service may already be using port 80 or 443.

Useful Monitoring Commands

top
htop
free -m
df -h

Need Help?

The HostPeppy support team can help you troubleshoot Apache, Nginx, PHP, SSL, and VPS server issues anytime.

Still need help?

Our support team is available 24/7 to assist you with any hosting questions.

Contact Support