Restart Services via SSH

If a service will not restart from WHM, you may want to try to restart it from the command line. First, try to restart the service using the server’s restart script. 

Type: 
CODE:
/scripts/restartsrv $service.


Example:
CODE:
/scripts/restartsrv mysql



Replace $service with one of the entries in the column on the left below:

Service Name/Type

exim Exim mail transfer agent (MTA).

named BIND nameserver daemon.

proftpd ProFTP FTP server daemon.

pureftpd Pure-FTP FTP server daemon.

httpd Apache web server daemon.

courier Courier mail server daemon.

dovecot Dovecot mail server daemon.

syslogd System logs daemon.

clamd Clam Antivirus software daemon.

sshd Secure shell (SSH) daemon

inetd Common Unix superserver daemon responsible for managing Internet services.

cppop cPanel’s version of POP3 mail downloading service. Similar to IMAP.

imapd IMAP mail downloading service. Similar to POP3.

mysql MySQL database server.

postgresql PostgreSQL database server.

interchange Interchange e-commerce server.

tomcat Java servlet container and HTTP server.

If this does not work, you can attempt to restart the service directly. The location of the service depends upon your operating system; however, for many distributions, services are located in the /etc/rc.d/init.d/ directory.

To search for the init.d directory, try one of the following commands:

* locate init.d
* ff init.d
* find / -name init.d 

To restart using this method, type the path to the service followed by the restart command. 

For example: 
CODE:
/etc/rc.d/init.d/$service restart



* Replace $service with the name of the daemon, such as exim, named, proftpd, httpd, etc.

Was this answer helpful?

 Print this Article

Also Read

Monitoring Apache Connections

To see number of IP connections and IPs connected to port 80, use the following...

Find and list large files on a Linux server

Lets say you want to find all files over 500MB  in a certain directory, go to that directory...

Useful Linux commands for cleaning malware from WordPress sites

I recently sat down to clean a server hosting a bunch of old WordPress sites. You can imagine...

How to delete all files older than X

Use this Linux command to delete all files older than X.Example below is to delete all backups...