المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : السي بانال WHM/CPanel كيفية عمل ريستارت لجميع Restart All Service using Command Line



Rise Company
05-11-2021, 23:40
السي بانال WHM/CPanel كيفية عمل ريستارت لجميع السيرفس restart whm all services
Restart Services On a cPanel Server - Restart All Service using Command Line

Restart cPanel Service using Command Line

Did some changes on cPanel/WHM configs and want to restart the cPanel Service?
This can be done using a single command from the root user of the WHM Server.
Restarting cPanel will trigger the restart to all the services lik tail watch, MySQL server, etc on cPanel server.

Procedure


Log in to the root of the WHM Server.
Run the following command to restart the cPanel Service.

service cpanel restart

The above command with restart the cPanel service using terminal.

----------------------------------------------------
Restart cPanel services using the


/usr/local/cpanel/scripts/restartsrv script

If a service will not restart from WHM, then you can use the /usr/local/cpanel/scripts/restartsrv service command to attempt to restart the service from the command line. When you run this command, replace service with the correct value for that service, we have included all of the possible services you can
restart with this script below with an example

Restart Apache on a cPanel Server


/usr/local/cpanel/scripts/restartsrv apache

Restart Bind on a cPanel Server


/usr/local/cpanel/scripts/restartsrv bind

Restart cPanel’s TailWatch log processing service


/usr/local/cpanel/scripts/restartsrv chkservd

Restart ClamAV on a cPanel Server


/usr/local/scpanel/scripts/restartsrv clamd

Restart the cPanel Log Daemon


/usr/local/scpanel/scripts/restartsrv cpanellogd

Restart cPanel’s WebDav Server


/usr/local/scpanel/scripts/restartsrv cpdavd

Restart cPHulk


/usr/local/scpanel/scripts/restartsrv cphulk

Rebind IPv6 Addresses
Run this script with the –list flag to list all of the server’s bound IPv6 addresses.


/usr/local/cpanel/scripts/restartsrv cpipv6

Restart cPanel’s cpsrvd daemon


/usr/local/cpanel/scripts/restartsrv cpsrvd

Restart cPanel’s crond daemon


/usr/local/cpanel/scripts/restartsrv crond

Restart cPanel’s dnsadmin daemon


/usr/local/cpanel/scripts/restartsrv dnsadmin

Restart the Dovecot mail server


/usr/local/cpanel/scripts/restartsrv dovecot

Restart the Entropy chat client


/usr/local/cpanel/scripts/restartsrv entropychat

Restart Exim


/usr/local/cpanel/scripts/restartsrv exim

Restart Exim Mail Statistics Tracker


/usr/local/cpanel/scripts/restartsrv eximstats

Restart FTP on a cPanel Server


/usr/local/cpanel/scripts/restartsrv ftpd or ftpserver

Restart the Apache Web Server


/usr/local/cpanel/scripts/restartsrv httpd

Restart IMAP on a cPanel Server


/usr/local/cpanel/scripts/restartsrv imap

Restart inetd (super-server) on a cPanel Server


/usr/local/cpanel/scripts/restartsrv inetd

Restart the IP Address aliasing software


/usr/local/cpanel/scripts/restartsrv ipaliases

Restart the Mailman Server


/usr/local/cpanel/scripts/restartsrv mailman

Restartthe MyDNS Server


/usr/local/cpanel/scripts/restartsrv mydns

Restart the MySQL Database Server


/usr/local/cpanel/scripts/restartsrv mysql

Restart the BIND Nameserver Software


/usr/local/cpanel/scripts/restartsrv named

Restart the NSD Nameserver daemon


/usr/local/cpanel/scripts/restartsrv nsd

Restart the Passive OS Fingerprinting Service


/usr/local/cpanel/scripts/restartsrv p0f

Restart the PostgreSQL Database Service


/usr/local/cpanel/scripts/restartsrv postgres or postgresql

Restart the Queueprocd daemon


/usr/local/cpanel/scripts/restartsrv queueprocd

Restart the Open-Source Lod daemon


/usr/local/cpanel/scripts/restartsrv rsyslogd

Restart the Apache Spam Assassin™ daemon


/usr/local/cpanel/scripts/restartsrv spamd

Restart SSH on a cPanel Server


/usr/local/cpanel/scripts/restartsrv sshd

Restart the Log forwarder daemon


/usr/local/cpanel/scripts/restartsrv syslogd

Restart cPanel’s TailWatch log processing service


/usr/local/cpanel/scripts/restartsrv tailwatchd

Restart the Apache Tomcat service


/usr/local/cpanel/scripts/restartsrv tomcat

Restart the Open-Spource Super-Server daemon


/usr/local/cpanel/scripts/restartsrv xinetd

المرجع:
https://docs.cpanel.net/whm/scripts/the-restartsrv-script/
https://docs.cpanel.net/whm/server-status/service-status/
https://www.basezap.com/restart-cpanel-service-using-command-line/
https://blog.first2host.co.uk/restart-cpanel-services/

Rise Company
06-11-2021, 00:21
The restartsrv Script

The /usr/local/cpanel/scripts/restartsrv script restarts a service.
If a service won’t restart from WHM, use this script to restart a service from the command line.

Run the script

To run this script on the command line, use the following format, where service is the service’s name (https://docs.cpanel.net/whm/scripts/the-restartsrv-script/#services):
/usr/local/cpanel/scripts/restartsrv_service

Use the following options with this script:



Options
Description
Example


check
Checks whether the service is running.
--check


graceful
Gracefully restart the service.
--graceful


hard
Perform a hard stop and restart for the service.
--hard


notconfigured-ok
The unconfigured service will exit with a non-fatal error.
--notconfigured-ok


reload
Reload the service.
--reload


restart
Perform a soft restart for the service.
--restart


start
Start the service.
--start


stop
Stop the service.
--stop


help
Display the script’s help documentation.
--help




Services

This script restarts the following services:



[*=center]apache or httpd — The Apache® web server daemon.
[*=center]apache_php_fpm — The Apache PHP-FPM service.
[*=center]bind — The Berkeley Internet Name Domain (BIND) (https://docs.cpanel.net/knowledge-base/cpanel-product/cpanel-glossary#berkeley-internet-name-domain-bind) nameserver daemon.
[*=center]chkservd or tailwatch — cPanel & WHM’s TailWatch log processing service.
[*=center]clamd — The ClamAV® antivirus daemon.
[*=center]cpanalysticsd — The cPanel Analytics (https://docs.cpanel.net/knowledge-base/cpanel-product/cpanel-analytics) daemon.
[*=center]cpanellogd — The cPanel log and bandwidth processor daemon.
[*=center]cpanel_ccs — The cPanel Calendar and Contacts server (https://docs.cpanel.net/knowledge-base/cpanel-developed-plugins/calendar-and-contacts-server) service.
[*=center]cpanel_dovecot_solr — The Apache Solr™ service.
[*=center]cpanel_php_fpm — The cPanel PHP-FPM service.
[*=center]cpdavd — cPanel & WHM’s WebDAV (https://docs.cpanel.net/knowledge-base/cpanel-product/cpanel-glossary#webdav) daemon.
[*=center]cpgreylistd — cPanel’s Greylisting (https://docs.cpanel.net/knowledge-base/cpanel-product/cpanel-glossary#greylisting).
[*=center]cphulkd — The cPHulk (https://docs.cpanel.net/knowledge-base/cpanel-product/cpanel-glossary#cphulk) service.
[*=center]cpipv6 — Binds or rebinds the server’s IPv6 addresses.
[*=center]cpsrvd or cpanel — The cPanel server daemon.
[*=center]crond — The Cron daemon. Note:
While Debian® systems (Ubuntu®) use the cron daemon, you can use crond as the service name when running the script.
[*=center]dnsadmin — The cPanel Domain Name System (DNS) admin cache service.
[*=center]dovecot — The Dovecot (https://www.dovecot.org/) mail server.
[*=center]exim — The Exim (https://www.exim.org/) mail exchanger.
[*=center]ftpd, ftpd, ftpmagic, or ftpserver — The configured FTP service (ProFTPD or Pure-FTPd).
[*=center]imap, pop, or pop3 — The Dovecot Internet Mail Access Protocol (IMAP) (https://docs.cpanel.net/knowledge-base/cpanel-product/cpanel-glossary#imap) daemon.
[*=center]ipaliases — The IP address aliasing software.
[*=center]lmtp — The Local Mail Transport Protocol (LMTP) service.
[*=center]mailman — The Mailman (http://www.list.org/) service.
[*=center]mydns — The MyDNS server. Important:
We deprecated MyDNS in cPanel & WHM version 78. We strongly recommend that you use PowerDNS instead.
[*=center]mysql or mysqld — The MySQL® (https://www.mysql.com/) service.
[*=center]named — The BIND nameserver daemon.
[*=center]nscd — The Name Service Cache service.
[*=center]p0f — The passive OS fingerprinting (https://docs.cpanel.net/knowledge-base/cpanel-product/cpanel-glossary#passive-os-fingerprinting-p0f) service.
[*=center]pdns or powerdns — The PowerDNS (https://docs.cpanel.net/knowledge-base/dns/how-to-use-cpanels-powerdns) service.
[*=center]postgres or postgresql — The PostgreSQL® (https://www.postgresql.org/) database service.
[*=center]proftpd — The ProFTP (https://docs.cpanel.net/knowledge-base/cpanel-product/cpanel-glossary#proftpd) server daemon.
[*=center]pureftpd — The Pure-FTPd (https://docs.cpanel.net/knowledge-base/cpanel-product/cpanel-glossary#pure-ftpd) server daemon.
[*=center]queueprocd — The TaskQueue (https://docs.cpanel.net/whm/server-status/task-queue-monitor) Processor daemon.
[*=center]rsyslog or rsyslogd — The system log service that monitors the web server and system activity.
[*=center]spamd — The Apache SpamAssassin™ daemon.
[*=center]sshd or openssh — The Secure Shell (SSH) daemon.
[*=center]tailwatchd or chkservd — cPanel’s TailWatch (https://docs.cpanel.net/knowledge-base/cpanel-product/tailwatch) log processing daemon.
[*=center]tomcat — The Apache Tomcat® service (https://docs.cpanel.net/ea4/tomcat/tomcat).


For more information about these services, read our cPanel & WHM Service Daemons (https://docs.cpanel.net/knowledge-base/cpanel-product/the-cpanel-service-daemons) documentation.

Example

To perform a hardrestart for a service, use the restart and hard options. For example, to perform a hard restart for the named service:
/usr/local/cpanel/scripts/restartsrv_named --restart --hard

المرجع:
https://docs.cpanel.net/whm/scripts/the-restartsrv-script/

Rise Company
06-11-2021, 00:33
اهم الاوامر ربيستارت سيرفس



/usr/local/cpanel/scripts/restartsrv_apache
/usr/local/cpanel/scripts/restartsrv_apache_php_fpm
/usr/local/cpanel/scripts/restartsrv_cpanel_php_fpm
/usr/local/cpanel/scripts/restartsrv_dnsadmin
/usr/local/cpanel/scripts/restartsrv_mydns
/usr/local/cpanel/scripts/restartsrv_mysql


اهم الاوامر تفريغ الرام


echo 3 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared'

Rise Company
06-11-2021, 00:36
الكود الكامل المفضل لعمله على السيرفر كل فترة
وخاصة عند عمل باك شامل للسيرفر و جميع الحسابات يسبب خلل فى بعض services
لذلك ننصح بهذا الكود اسبوعيا او كل فترة لحصول على افضل اداء من السيرفر


/usr/local/cpanel/scripts/restartsrv_apache
/usr/local/cpanel/scripts/restartsrv_apache_php_fpm
/usr/local/cpanel/scripts/restartsrv_cpanel_php_fpm
/usr/local/cpanel/scripts/restartsrv_dnsadmin
/usr/local/cpanel/scripts/restartsrv_mydns
/usr/local/cpanel/scripts/restartsrv_mysql
echo 3 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared'