Your Gateway To Digital Success
Wesbytes Blue Logo

Wesbytes Knowledge Base

Search our articles or browse by category below

How to restart a VPS service using the command line/Control Panel

Last modified: July 2, 2022
You are here:
Estimated reading time: 2 min
VPS

If you are not yet ready to commit to a dedicated server, you can choose the best Virtual Private Server solution on the market. It combines the freedom and power of a dedicated server with the low-cost hosting solution’s reasonable pricing. Furthermore, you can choose a control panel for your VPS to ensure the greatest possible performance. As a result, VPS hosting is the best alternative for individuals whose businesses have outgrown shared hosting but are not yet ready to transition to a dedicated server. Learn how to control a virtual server’s processes and restart it if necessary.

There are two primary techniques to restart a VPS. The first step is to manage the control panel tool you’ve selected for your VPS. Another need is that you use specific shell commands while signed in to the server through SSH using the root password.

Those who utilise a cPanel control panel on their VPS can effortlessly restart all services. To gain full access, they must log in to WHM using the root password. As soon as you enter WHM, select Restart Services from the options menu.

As soon as you access this menu, you will find the opportunity to restart all of the server’s services — simply click the button in the menu. The procedure will begin, and you will need to wait until the page completely reloads and the message “successful restart” appears. You can restart DNS servers, mail servers, SQL servers, SSH servers, IMAP servers, and other sorts of servers in this manner.

If the primary server (DNS or Apache) fails, you will be unable to log in to WHM, and the only remedy will be to restart the failed service using shell access. You must log in using the VPS’s hostname or the main IP address, as well as the root username and password. As soon as you have access, you must determine where the services are located. Execute the following command:

cd /etc/init.d/

When you enter the command, you will be taken to the init.d folder, which contains all services.

In the init.d folder, enter the command ls -la to view the whole list of services. To restart a specific service, type: servicename restart (“the servicename” is the service that needs to be restarted). For example, if you want to restart the VPS’s HTTP (Apache) server, type “httpd restart.” Services can be stopped and restarted using the applications httpd stop and httpd start.

This method is quite beneficial because if the service completely ceases (rather than just looks to be overloaded), the command to start may simply fail. In such cases, a simple httpd start will suffice. Only in this manner can you properly restart cPanel and reload the entire Control Panel.

If you are using the DirectAdmin Control Panel, you must log in with your admin username and password and restart the services via the Service Monitor menu, which is found in the Admin Tools area of the Control Panel. Start, Stop, Restart, and Reload Virtual Server services are available when you enter the Service Monitor menu. This allows you to restart the complete VPS management panel as well as other servers (Apache, MySQL, mail server, etc.).

A Command-Line Restart of a Service

There are two ways to restart a service from the command line. In both circumstances, you must be logged in as root, because a regular user does not have the necessary privileges to execute such commands.

Because of these benefits, VPS hosting is suggested in many circumstances. Its low cost, combined with the ability to operate the server, enables you to give higher-quality services to your clients.

Was this article helpful?
Dislike 0
Views: 71