:info:

http://docs1.cpanel.net/twiki/bin/view/11_...RestartServices

Restart Services [/b]
For WHM version 11.30


Using this feature, you can restart a service (usually a daemon) on your web server. Daemons are small processes that run in the background of your server.








How to restart services


Take these steps to restart services on your server.


Restarting may be helpful if you have changed a services configuration or if the service is experiencing problems.


By default, you may restart the following services via WHM:
  • DNS nameserver (named/BIND or NSD)
  • FTP Server (ProFTPd or Pure-FTPd)
  • HTTP web server (Apache/httpd)
  • POP3/IMAP email server (Courier or Dovecot)
  • POP3 server (cPPOP)
  • Mail server (Exim)
  • SQL server (MySQL)
  • SSH server (openSSH)



Restarting a service will not work if the service is stopped. If you wish to start or stop a service, refer to the Service Manager feature in WHM.


To restart a service:
  1. On the main Restart Services screen, select the service you wish to restart.
  2. When asked whether you wish to restart the service, click Yes.





Troubleshooting (advanced users only)




Restart from the command line


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 servers restart script. Type:
CODE
/usr/local/cpanel/scripts/restartsrv $service
. Replace
CODE
$service
with one of the entries in the column on the left below:


Input Value for $service
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


cPanels 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.




entropychat


Chat service.





Restart directly from the command line


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
CODE
/etc/init.d/
directory.


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

  • CODE
    ff init.d

  • CODE
    find / -name init.d



To restart using this method, type the path to the service followed by the
CODE
restart
command. For example:
CODE
/etc/rc.d/init.d/$service restart
  • Replace
    CODE
    $service
    with the name of the daemon, such as exim, named, proftpd, httpd, etc.
  • Some distributions keep services in different locations. You may use the
    CODE
    ff
    ,
    CODE
    locate
    , or
    CODE
    find
    command to locate the service you would like to restart.



If the restart fails, you should check the services error log. It can be very useful for diagnosing problems.


Each service logs its errors differently, so you will need to check the services documentation to find the error logs location. Following are some examples of useful error logs and their possible locations; of course, results will vary depending on your installation.




Service (Daemon) Name
Error Log Location
Notes




Apache web server (httpd)


CODE
/usr/local/apache/logs/error_log



Details errors encountered during Apache requests.




BIND nameserver (named)


CODE
/var/log/messages








ProFTP server (proftpd)


CODE
/var/log/messages








Pure-FTP server (pureftpd)


CODE
/var/log/messages








Exim mail transfer agent (exim)


CODE
/var/log/exim_mainlog



Details all Exim transactions.




Exim mail transfer agent (exim)


CODE
/var/log/exim_rejectlog



Details rejected messages and reasons.




Exim mail transfer agent (exim)


CODE
/var/log/exim_paniclog



Details configuration and similar errors.

Important: If this log has contents, Exim has serious problems and will not run on some distributions




Courier POP3/IMAP service (imapd)


CODE
/var/log/maillog








Dovecot POP3/IMAP service (imapd)


CODE
/var/log/maillog








MySQL database server (mysqld)


CODE
/var/lib/mysql/hostname.err

(in FreeBSD:
CODE
/var/db/mysql/hostname.err
)


Substitute
CODE
hostname
with your server's hostname.




OpenSSH secure shell service (sshd)


CODE
/var/log/messages
,

CODE
/var/log/secure
, or

CODE
/var/log/auth



Log location depends on the configuration of the syslog service.

View the full article