Your Cart is Empty Reseller Login or Sign up FAQ Search

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

Along with the other reseller hosting services and cheap dedicated server solutions that you can find on our website, we offer also one of the best Virtual Private Server solutions on the Internet. The virtual private servers offer you the freedom and the power typical of a dedicated server, combined with prices akin to those of an average low-cost reseller hosting account. Along with this, you have the option to choose a Control Panel solution for your Linux-powered VPS to further boost its performance. Our reliable VPS hosting solutions represent a logical answer for those whose needs have outgrown what our other hosting reseller programs are capable of offering, but are still not ready to move to a full dedicated server hosting solution.

In this article you will learn how to manage the service processes of your Virtual Server and how to restart them if the need occurs.

There are two main ways in which this can be performed. The first one is through the Control Panel tool you have selected for your VPS. The other one is by using certain shell commands while you are logged in to the server via SSH with your root password. For your convenience, I will explain them one by one.

If you are using a cPanel Control Panel on your Virtual Private Server, you have the option to restart all the services very quickly and easily. To do this, you will need to log in to the WHM using your root password, which gives you full access privileges.

Once inside your WHM, locate the option menu Restart Services.

Restart VPS3

In this menu you will see the option to restart each service on your Virtual Server. All you need to do is select the service that you need and click on the corresponding icon in the menu. This will start the restarting process. Just wait for the page to fully reload and for the message informing of the successful restart of the service to appear. Through this menu you have the option to restart the DNS Server (BIND/NSD), the E-Commerce Server (Interchange), the FTP Server (ProFTPd/PureFTPd), the HTTP Server (Apache), the IMAP Server (Courier/Dovecot), the Mail Server (Exim), the POP3 Server (cPPOP), the SQL Server (MySQL) and the SSH Server (OpenSSH).

Sometimes, if a major service like the DNS Server, or the Apache, has failed, you will not be able to log in to the WHM at all. In times like these the only possible solution will be to restart the failed service using shell access. To do that, use a shell client like PuTTY, for example. Log in using the VPS's hostname or main IP and the root username and password. Once inside, you will need to navigate to where the services are located. This is done through the following command:

cd /etc/init.d/

Press enter after you have typed in this command and you will be taken to the init.d folder where all the services are located.

By typing the command ls -la in the init.d folder, you will see a list of all the services in it . Now, in order to restart a certain service you must type: servicename restart, where the servicename is the service you wish to restart. For example, with this command you can restart the HTTP (Apache) service of the Virtual Server: httpd restart. You can also start and stop services in the same way using the following commands:

httpd stop
httpd start

This is very useful, because if the service is not just overloaded, but completely stopped, the restart command may not work due to the fact that this command is always trying to stop the service and then start it. In such cases a simple httpd start will do the work. Only from here you can actually restart the cPanel service, which will reload your entire Control Panel.

If you are using the DirectAdmin Control Panel, you will need to log in with your admin username and password. Here, the services can be restarted through the Service Monitor menu located in the Admin Tools section of the Control Panel. Once inside the Service Monitor menu, you will have the option to Start, Stop, Restart and Reload the separate Virtual Server services. This allows you to restart the entire VPS Control Panel. You can also restart exim (mail server), httpd (Apache), mysqld (MySQL), named (Name Servers), proftpd (FTP), sshd (SSH) and dovecot (IMAP, POP3).

Restart VPS4

A service restart via the command line:

There are two ways to restart a service via the command line. In both cases you must be logged in as root, since a normal user does not have enough privileges to execute such commands. I will give an example with the named service:

#~: service named restart

Restart VPS1

#~: /etc/init.d/named restart

Restart VPS2

Thanks to all these and many other features, our Virtual Private Server hosting solutions occupy one of the leading places in the web hosting sphere. The low cost VPS provides you with the opportunity to manage your own server and grants you the ability to offer more quality services to your clients.

« Back to menu