How to restart cpanel service via SSH

blog background image

This document show how to restart cPanel sevicese from SSH command line 

  • The first is to use the service command to issue commands to the service you wish to work with.  For example: service httpd restart This will issue a restart command to Apache.
  • The second would be to directly interact with the init script on the server.  An example of this would be, /etc/init.d/httpd restart This will issue a restart command to Apache.

Below are some examples of various common services and their usage flags:

Apache

One of the primary reasons Apache may need to be restarted would be after changes have been made to the configuration file in order to optimize performance. 

 

srv6# /etc/init.d/httpd
usage: /etc/init.d/httpd (start|stop|restart|fullstatus|status|graceful|configtest|help)
start      - start httpd
startssl   - start httpd with SSL enabled
stop       - stop httpd
restart    - restart httpd if running by sending a SIGHUP or start if
not running
fullstatus - dump a full status screen; requires lynx and mod_status enabled
status     - dump a short status screen; requires lynx and mod_status enabled
graceful   - do a graceful restart by sending a SIGUSR1 or start if not running
configtest - do a configuration syntax test
help       - this screen

Mail

On cPanel servers the default mail service is exim.  Any configuration changes to exim will require a restart to take effect.

srv6# /etc/init.d/exim
Usage: exim {start|stop|restart|status}

On Plesk servers the default mail service is qmail.  Any configuration changes to qmail will require a restart to take effect.

srv6# /etc/init.d/qmail
Usage: /etc/init.d/qmail {start|stop|status|reload|condrestart|restart}

SSH

Any change to the ssh configuration file(such as changing the SSH port) require a restart to take effect.

srv6# /etc/init.d/sshd
Usage: /etc/init.d/sshd {start|stop|restart|reload|condrestart|status}

FTP

On cPanel servers the default FTP program is pure-ftp.  Any configuration changes to pure-ftp will require a restart to take effect.

srv6# /etc/init.d/pure-ftpd
Usage: pure-config.pl {start|stop|restart|condrestart|status}

MySql

srv6# /etc/init.d/mysql
Usage: /etc/init.d/mysql start|stop|restart|reload

Firewall

On managed Liquidweb servers the firewall of choice is APF. The APF firewall interacts with the iptablesservice.  If any configuration changes are made to APF the service must be restarted in order for the changes to take effect.

srv6# /etc/init.d/iptables
Usage: /etc/init.d/iptables {start|stop|restart|condrestart|status|panic|save}

srv6# /etc/init.d/apf
usage: /etc/init.d/apf [start|stop|restart]

Cron

On linux the cron service controls the scheduled tasks that run on the server.

srv6# /etc/init.d/crond
Usage: /etc/init.d/crond {start|stop|status|reload|restart|condrestart}

System Logging

The syslog service controls the system and kernel logging for the server.

srv6# /etc/init.d/syslog
Usage: /etc/init.d/syslog {start|stop|status|restart|condrestart}

===

Related Blog Post

Create, collaborate, and turn your ideas into incredible products with the definitive platform for digital design.

How to create cPanel backup from command line

12 December 2022

How to create cPanel backup from command line

This article explains how you can create cPanel backup from the command line, using your own username and password.

Read More
How to install Webuzo Panel on linux Server

12 December 2022

How to install Webuzo Panel on linux Server

Webuzo is a popular alternative to cPanel, a widely used web hosting control panel developed by cPanel, Inc.

Read More
What are NFT Domains?

02 February 2022

What are NFT Domains?

NFT domains are new web extensions that are deployed using ERC 721 and Polygon Network, except .zil which uses Zilliqa.

Read More
How to Delete a MySQL® Database

01 January 2022

How to Delete a MySQL® Database

This document describes how to manually delete a MySQL® database from a cPanel & WHM server. This is useful if, for exa

Read More
How to get Transfer Authorization Code from GoDaddy

11 November 2021

How to get Transfer Authorization Code from GoDaddy

To transfer your domain with us then must need EPP Code.

Read More

Got a question!

Contact us at