Answered by the Webhosting Experts

Restart a Service/Daemon On a Linux cPanel Dedicated Server

If you are running cPanel/WHM on a Linux dedicated server, most of the services can be restarted from within WHM, however sometimes you will need to restart them from the shell via ssh. To do this, you must be logged in as root.

All standard Linux services such as http, ftp, exim, cPanel/WHM, interchange, mySQL, etc have init scripts in /usr/local/cpanel/bin and /usr/local/cpanel/scripts.

To see what services with scripts are on your dedicated server, just type:

ls /usr/local/cpanel/bin

Screenshot showing the results of the command ls /usr/local/cpanel/bin.

ls /usr/local/cpanel/scripts

Screenshot showing the results of the ls /usr/local/cpanel/scripts command.

The scripts that you should be concerned with are:

  • restartsrv_cpsrvd – this starts & stops cPanel and WHM. This includes Interchange, cppop, and cluster management services as well.
  • restartsrv_exim – starts & stops the exim mail server.
  • restartsrv_httpd – starts & stops the apache webserver.
  • restartsrv_mysql – starts & stops the MySQL database server.
  • restartsrv_named – starts & stops the BIND dns server.
  • restartsrv_proftpd – starts & stops the ProFTPD (or pureftpd when that is enabled) ftp server.

Using these scripts is easy. Let’s say that named/bind is down and you need to restart it. As root, simply type:

/usr/local/cpanel/scripts/restartsrv_named

Screenshot showing the results of the /usr/local/cpanel/scripts/restartsrv_named command.

Some of these services have more options than just start and stop and other ways to use them. If you have a lot of domains using your DNS server and you don’t want to stop and restart it because you edited one domain, type “ndc reload”. ndc controls the named daemon. If you make a minor change to /usr/local/apache/conf/httpd.conf, but do not want to restart it, type “/etc/rc.d/init.d/httpd graceful” to do a graceful restart (this will finish current requests before killing the child processes).

If you want to learn more about what commands each script offers, you can simply run the script without passing any arguments to it:

root@server [~]# /etc/rc.d/init.d/cpanel3
Usage: /etc/rc.d/init.d/cpanel3 {start|stop|status|restart}

This lets you know that you can start, stop, check the running status of the service(s) or restart it.

Need More Personalized Help?

If you have any further issues, questions, or would like some assistance checking on this or anything else, please reach out to us from your my.hivelocity.net account and provide your server credentials within the encrypted field for the best possible security and support.

If you are unable to reach your my.hivelocity.net account or if you are on the go, please reach out from your valid my.hivelocity.net account email to us here at: support@hivelocity.net. We are also available to you through our phone and live chat system 24/7/365.