Search for the Solution?
How to Restart Services in cPanel using SSH Access
Taking Server Control via SSH: How to Restart Services in cPanel Using SSH: Litespeed, Apache, MySQL, Exim, and More
While cPanel provides a user-friendly graphical interface for managing your web hosting environment, sometimes you need to delve into the command line for more advanced tasks. Restarting services is one such operation that can be efficiently performed via SSH (Secure Shell). This guide equips you with the knowledge and commands to restart various essential services in your cPanel environment using SSH, providing greater control and flexibility in managing your server.
Why Restart Services?
Restarting a service essentially involves stopping it and then starting it again. This action can be crucial for several reasons:
- Applying Configuration Changes: After making changes to a service’s configuration files, restarting the service ensures the new settings are applied.
- Troubleshooting Issues: If a service is malfunctioning or encountering errors, restarting it can often resolve the problem.
- Improving Performance: Restarting a service can clear its cache and memory, potentially improving its performance.
- Security Updates: After applying security updates or patches, restarting the service ensures the updates are implemented and your server is protected.
Accessing Your Server via SSH
Before you can restart services, you need to establish an SSH connection to your server.
-
Open Terminal: Open a terminal window on your local computer (Linux/macOS) or a command prompt (on Windows).
-
Connect via SSH: Use the following command to connect to your server, replacing
your\_server\_ip
with your server’s IP address or hostname:ssh your_cpanel_username@your_server_ip
-
Enter Password: Enter your cPanel account password when prompted.
Restarting Essential Services
1. LiteSpeed Web Server
LiteSpeed is a high-performance web server known for its speed and efficiency. To restart LiteSpeed, use the following command:
systemctl restart lsws
2. Apache Web Server
Apache is another popular web server often used in cPanel environments. To restart Apache, use the following command:
systemctl restart httpd
3. MySQL/MariaDB Database Server
MySQL or MariaDB are the database servers that power many web applications, including WordPress. To restart MySQL/MariaDB, use the following command:
systemctl restart mysql
4. Exim Mail Server
Exim is a mail transfer agent (MTA) responsible for sending and receiving emails. To restart Exim, use the following command:
systemctl restart exim
5. Dovecot IMAP/POP3 Server
Dovecot is a secure IMAP and POP3 server that allows users to access their email accounts. To restart Dovecot, use the following command:
systemctl restart dovecot
6. PHP-FPM
PHP-FPM (FastCGI Process Manager) is a process manager for PHP that improves performance and resource utilization. To restart PHP-FPM, use the following command:
systemctl restart php-fpm
7. SSH Server
The SSH server allows you to connect to your server securely. To restart the SSH server, use the following command:
systemctl restart sshd
Important Considerations
- Root Access: Some services might require root access to restart. If you don’t have root access, contact your hosting provider for assistance.
- Service Names: The exact service names might vary slightly depending on your server’s configuration and operating system.
- Impact on Website: Restarting certain services, like the web server or database server, can temporarily disrupt your website’s availability. Plan service restarts during off-peak hours to minimize any impact on your visitors.
MyGlobalHost: Simplifying Server Management
Managing server services can be complex, especially for those new to command-line interfaces. MyGlobalHost offers managed VPS and dedicated server solutions where our expert team can assist you with restarting services and other server management tasks.
Choose MyGlobalHost for hassle-free server management and reliable web hosting solutions.