Enable autorestart in cPanel Service Manager

#1
Hello,

we have the "http" service in WHM > Service Configuration > Service Manager enabled as suggested here: https://www.litespeedtech.com/suppo...d_does_not_restart_when_configuration_changes

Litespeed went down recently (doesn't appear to be a bug, it was shutdown by I don't know what, that is a different issue) and we got the following email:

The service “httpd” appears to be down.

Server ...
Primary IP Address ...
Service Name httpd
Service Status failed ⛔
Notification The service “httpd” appears to be down.
Service Check Method The system failed to connect to this service’s TCP/IP port.
Reason Unable to connect to port 80 on 127.0.0.1: Connection refused: Died
Number of Restart Attempts 1
Startup Log No startup log
Log Messages 2016-03-12 07:14:02.955 [INFO] [127.0.0.1:59146] File not found [/usr/local/apache/htdocs/server-status]
2016-03-12 07:13:46.523 [INFO] [::1:56181] File not found [/usr/local/apache/htdocs/whm-server-status]
2016-03-12 07:12:51.603 [INFO] [127.0.0.1:53377] File not found [/usr/local/apache/htdocs/server-status]
2016-03-12 07:12:13.953 [INFO] [::1:55893] File not found [/usr/local/apache/htdocs/whm-server-status]
Memory Information
Used 5.11 GB
Available 10.45 GB
Installed 15.56 GB
Load Information 1.00 1.97 4.22
Uptime 206 days, 4 hours, 22 minutes, and 3 seconds
IOStat Information avg-cpu: %user %nice %system %iowait %steal %idle
22.37 0.22 6.11 2.33 0.00 68.96
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda 132.65 2736.80 2505.30 48753710630 44629683540
sdb 43.86 1791.60 140.75 31915858175 2507354545
sdc 6.13 526.09 1200.83 9371904028 21391749218
dm-0 348.89 2736.66 2504.88 48751191116 44622173768
dm-1 0.07 0.12 0.42 2141048 7454408
Top Processes
PID Owner CPU % Memory % Command
24388 f... 99.11 0.23 /usr/local/cpanel/3rdparty/bin/perl /usr/local/cpanel/3rdparty/bin/awstats.pl -config=... -LogFile=/usr/local/apache/domlogs/...-ssl_log.bkup -update
2249 mysql 55.53 24.72 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/....err --open-files-limit=28692 --pid-file=/var/lib/mysql/....pid
11990 root 1.92 0.59 /usr/bin/newrelic-daemon -c /etc/newrelic/newrelic.cfg --pidfile /var/run/newrelic-daemon.pid -no-pidfile
24410 root 1.78 0.16 tailwatchd - chkservd - crond check
20022 root 0.98 0.16 linode-longview

The chkservd process attempts to connect to “127.0.0.1:80” in order to validate that this service is functioning. If you blocked connections with iptables or the “Host Access Control” interface in WHM, this failure may be a false positive.

To resolve this issue, either open the firewall to allow connections as the root user to “127.0.0.1:80” or disable checks for this service in WHM’s “Service Manager” interface with the “Configure Monitor Settings” link below.
However the process has not been started again. Could you please let us know how to enable the autorestart? Is that not solved by the Litespeed WHM plugin?

I already asked cPanel support for this and they don't have a solution. They pointed me to the /etc/chkservd/chkservd.conf file, but don't know what should be put into it and any change would also be overwritten by the Service Manager.

Thanks,
Martin
 
#3
Hello Pong,

yes, both are checked.

cPanel support posted how this check looks like:

service[httpd]=80,GET / HTTP/1.0,HTTP/1..,killall -TERM httpd;sleep 2;killall -9 httpd;/etc/rc.d/init.d/httpd stop;/etc/rc.d/init.d/httpd startssl;/usr/local/apache/bin/apachectl startssl;/etc/rc.d/init.d/httpd start;/usr/local/apache/bin/apachectl start

The format is: SERVICE = PORT, SEND, RESPONSE, RE-START COMMAND

Should that work with Litespeed? I tried to run it and it appears Litespeed has been restarted indeed:

root@hosting [~]# tail -n 10000 /usr/local/apache/logs/error_log | grep NOTICE | grep "Server Stopped"

2016-03-16 04:36:52.108 [NOTICE] [lshttpd:26863] Server Stopped!
2016-03-16 04:49:27.399 [NOTICE] [lshttpd:15888] Server Stopped!
2016-03-16 04:49:28.946 [NOTICE] [lshttpd:15776] Server Stopped!

root@hosting [~]# tail -n 10000 /usr/local/apache/logs/error_log | grep NOTICE | grep "Loading LiteSpeed"

2016-03-16 04:35:24.763 [NOTICE] Loading LiteSpeed/5.0.14 Enterprise ...
2016-03-16 04:49:13.004 [NOTICE] Loading LiteSpeed/5.0.14 Enterprise ...
2016-03-16 04:49:18.023 [NOTICE] Loading LiteSpeed/5.0.14 Enterprise ...
2016-03-16 04:49:23.046 [NOTICE] Loading LiteSpeed/5.0.14 Enterprise ...

Actually the time values look a bit off. I'm not sure what exactly to check for in the log.

Thanks,
Martin
 

Pong

Administrator
Staff member
#4
Server processes can be checked through:
ps -ef | grep litespeed
while apache can be checked through
ps -ef | grep httpd

Do you use easy apache 4 or 3?

Anyway, make force upgrade to the latest version:
/usr/local/lsws/admin/misc/lsup.sh -f -v 5.0.14

Switch to apache by running:
/usr/local/lsws/admin/misc/cp_switch_ws.sh apache
then switch back to LiteSpeed by running:
/usr/local/lsws/admin/misc/cp_switch_ws.sh lsws


test the server restart like apache restart
service httpd restart

It should restart litespeed server.

To see if the above can fix your restart issue.
 
Last edited:
#5
Hello Pong,

we are already using LiteSpeed/5.0.14 Enterprise.

I tried "service httpd restart" and I can see "2016-03-18 06:13:00.170 [NOTICE] Server Restart Request via Signal..." in
/usr/local/apache/logs/error_log so I assume this restarting works.

However - when I execute "service httpd stop" the web serving doesn't stop.

So I'm not sure if the chksrvd checks this properly or not. Do you have some experience with this or not?

Thanks,
Martin
 

Pong

Administrator
Staff member
#6
A version might have different builds. A good practice is alway to upgrade at the begining. switch script is not just to swtich between web serer, it will install necessary rapper or other stuff if anything missing, then switch.

Please do follow exactly steps to see if it helps.

If problem persist, we may need tmp root access to have further investigate. Create ticket in our ticketing system with such credentials.
 
Top