How to Restart Apache service from WHM?

The Apache web server is a software program that allows a computer to host websites. It receives requests from web browsers like Chrome or Firefox and sends back the website's content so that users can view web pages. Apache is widely used worldwide for hosting websites, including personal blogs, e-commerce sites, and corporate websites.

When you make changes to the Apache web server, such as adjusting settings or adding new features, you need to restart it for the changes to take effect. Restarting refreshes the server and ensures that it uses the updated configuration and settings. It's similar to turning it off and on again to apply the changes.

To restart the Apache service from the WHM Panel, you can follow these steps:

Step 1: Log into the WHM Panel.

Step 2: Use the search box on the upper left side of the screen and search for "Restart Service."

Step 3: Select the "HTTP Server (Apache)" option and click on it.

Step 4: A confirmation message will appear, giving you the chance to cancel the restart if needed. If you want to proceed, click on the "Yes" button to restart the Apache service.

Step 5: You will see the server loading while it restarts.

Step 6: Once the restart is complete, you will receive a success message indicating that Apache has been restarted successfully.

Alternatively, you can also restart the Apache service from the WHM terminal by following these steps:

Step 1: Log into the WHM Panel.

Step 2: Use the search box on the upper left side of the screen and search for "terminal."

Step 3: Select the "Terminal" option and click on it.

Step 4: In the Terminal window, enter the below command:

# /scripts/restartsrv_httpd

Step 5: Once the command is executed, you will receive a success message indicating that Apache has been restarted successfully with the message "httpd restarted successfully."

If your servers are running CloudLinux 6, utilize the provided command where "/etc/rc.d/init.d/service" is the actual path to the service:

       /etc/rc.d/init.d/service restart

Execute the subsequent command for servers operating CentOS, CloudLinux 7, and later, AlmaLinux OS, Red Hat® Enterprise Linux® (RHEL), or Rocky Linux. Replace "service-name" with the specific service you intend to restart:

       systemctl restart service-name.service

For Ubuntu: 

      sudo systemctl start service_name 

To verify the enabled status of Apache, use the following command:

     sudo systemctl status service_name  

In the terminal, we can use a command to restart the Apache server for Debian and Ubuntu users using an older release.

    sudo /etc/init.d/service restart 

Conclusion:

Sometimes, instead of completely turning off and on the Apache web server, you can do a "gentle" restart. This type of restart lets Apache update its settings and apply changes without cutting off any ongoing connections. It's handy when you want to avoid service interruptions and keep things running smoothly.

However, specific changes, like making big adjustments to the server's settings or adding new features, might need a full restart. This means the server needs to be completely stopped and started again to guarantee that all the changes are correctly applied and everything works properly.


Was this answer helpful?

« Back

chat

/* */