Litespeed: Issue with cPanel Awstats

Discussion in 'General' started by jackwilliams, May 23, 2012.

  1. jackwilliams

    jackwilliams New Member

    Hello,

    I am running a shared server with litespeed. It was working fine till this march. However, now the AWSTATS are not updated properly. It is not updated properly also when i try to update manually it is giving huge errors.

    ++++++++
    # /scripts/runweblogs xxxxxxx
    Log checker loaded ok..
    ==> cPanel Log Daemon version 25.0
    ==> Loaded RRDs: version 1.4004
    Processing xxxxxxx...
    Run Logs domain: xxxxxxx.com.sg BW Limit: 52428800000 Domains: [extranet.xxxxxxx.com mail.xxxxxxx.com mail1.xxxxxxx.com ssl.xxxxxxx.com ssl1.xxxxxxx.com ssl2.xxxxxxx.com vpn2463.xxxxxxx.com webmail.xxxxxxx.com.sg xxxxxxx.com wiselypc.com.sg promis.xxxxxxx.com mail2.xxxxxxx.com]
    [2012-05-22 17:32:03 +0800] Process bandwidth for xxxxxxx
    [2012-05-22 17:32:04 +0800] Processing exim stats for xxxxxxx....
    [2012-05-22 17:32:04 +0800] ...Done
    [2012-05-22 17:32:26 +0800] Disk Usage for xxxxxxx on /dev/mapper/VolGroup00-LogVol00 (502908/5120000)
    [2012-05-22 17:32:26 +0800] WEBLANG english
    [2012-05-22 17:32:26 +0800] Archive Status: 1
    [2012-05-22 17:32:26 +0800] About to fork for xxxxxxx [ALL DOMAINS: extranet.xxxxxxx.com, mail.xxxxxxx.com, mail1.xxxxxxx.com, ssl.xxxxxxx.com, ssl1.xxxxxxx.com, ssl2.xxxxxxx.com, vpn2463.xxxxxxx.com, webmail.xxxxxxx.com.sg, xxxxxxx.com, wiselypc.com.sg, promis.xxxxxxx.com, mail2.xxxxxxx.com, xxxxxxx.com.sg]
    [2012-05-22 17:32:26 +0800] Create/Update database for config "/home/xxxxxxx/tmp/awstats/awstats.xxxxxxx.com.sg.conf" by AWStats version 7.0 (build 1.971)
    [2012-05-22 17:32:26 +0800] From data in log file "/usr/local/apache/domlogs/xxxxxxx.com.sg.bkup"...
    [2012-05-22 17:32:26 +0800] Error: Couldn't open server log file "/usr/local/apache/domlogs/xxxxxxx.com.sg.bkup" : Permission denied
    [2012-05-22 17:32:26 +0800] Setup ('/home/xxxxxxx/tmp/awstats/awstats.xxxxxxx.com.sg.conf' file, web server or permissions) may be wrong.
    [2012-05-22 17:32:26 +0800] Check config file, permissions and AWStats documentation (in 'docs' directory).
    Complete

    ++++++++.

    I found the root cause of this issue. The apache domlogs are running with nobody:nobody permission. It should be "root:username".

    ++++++++
    root@host [/usr/local/apache]# ll |grep domlogs/
    drwx--x--x 404 root wheel 516096 May 23 11:40 domlogs/
    root@host [/usr/local/apache]#

    User account:
    -rw-r----- 2 nobody nobody 4450 May 23 11:15 xxxxxxx.com
    -rw-r--r-- 1 nobody nobody 229 May 23 11:15 xxxxxxx.com-bytes_log
    -rw-r--r-- 1 root root 1 Feb 20 2010 xxxxxxx.com-bytes_log.offset
    ++++++++

    Could you please let me know how to change this or fix this issue?
  2. webizen

    webizen New Member

    is PHP suEXEC (Admin CP -> Configuration -> Server -> General) enabled or not?
  3. jackwilliams

    jackwilliams New Member

    Hello,

    Yes, the suEXE is enabled. Please refer the snapshot. Is there any other possible solutions for this issue?

    Attached Files:

  4. webizen

    webizen New Member

    can you switch back to Apache and see if the problem persists?
  5. jackwilliams

    jackwilliams New Member

    Hello,

    I could see that if I switch to apache it is giving the following error.
    ++++++++++
    LiteSpeed Web Server Control Operation ... Switch to Apache

    LSWS Stopped.
    Apache is not up within 30 secs, try again by force kill litespeed.
    Apache is still not up.

    Failed to switch to Apache! Please either start LiteSpeed or manually switch to Apache!

    Apache is not started may be caused by configuration error. To manually check this problem, please ssh to your server and check:

    Try stop LiteSpeed if lshttpd still running:
    killall -9 lshttpd

    remove the lsws wrapper if the original one is found:

    restore Apache httpd if /usr/local/apache/bin/httpd_ls_bak exists.
    mv -f /usr/local/apache/bin/httpd_ls_bak /usr/local/apache/bin/httpd

    restore cPanel restart httpd script if /scripts/restartsrv_httpd_ls_bak exists.
    mv -f /scripts/restartsrv_httpd_ls_bak /scripts/restartsrv_httpd

    run the restart command manually: /scripts/restartsrv_httpd and check the error.
    ++++++++

    I have tried to kill the process and tried to do the same thing. But still i get the above error when i switch to apache.

    I have found one more possible cause that the PHP is working with lsphp
    ++++++++
    # /usr/local/lsws/fcgi-bin/lsphp5 -i | grep Configuration
    Configuration File (php.ini) Path => /usr/local/lsws/lsphp5/lib
    Loaded Configuration File => /usr/local/lsws/lsphp5/lib/php.ini
    Configuration
    ++++++++

    Normally, the litespeed PHP with cPanel will point to the default location php.ini.
    ++++++++
    # /usr/local/lsws/fcgi-bin/lsphp5 -i | grep Configuration
    Configuration File (php.ini) Path => /usr/local/lib
    Loaded Configuration File => /usr/local/lib/php.ini
    ++++++++

    What can I do now?
  6. webizen

    webizen New Member

    These are command to run from shell to get Apache to start and lsws to stop.
    There is no need to switch to Apache in plugin.

    maybe your cwd is in /usr/local/lsws/lsphp5/lib. the php.ini in current dir will take precedence. so it is not an issue.
  7. jackwilliams

    jackwilliams New Member

    Hello,

    I did the the following to start apache.
    ++++++++
    # ps -aux |grep litespeed
    Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
    root 118891 0.4 0.3 55992 27040 ? S< 11:53 0:00 litespeed (lshttpd)
    nobody 118894 0.6 0.3 56860 28164 ? S< 11:53 0:00 litespeed (lshttpd)
    root 119296 2.1 0.3 55996 27044 ? S< 11:54 0:00 litespeed (lshttpd)
    nobody 119298 0.0 0.3 55928 26916 ? S< 11:54 0:00 litespeed (lshttpd)
    nobody 119299 0.6 0.3 56356 27624 ? S< 11:54 0:00 litespeed (lshttpd)
    root 119344 0.0 0.0 64356 876 pts/3 SN+ 11:54 0:00 grep litespeed

    # kill -9 118894 119296 119298 119299 119389

    # ps -aux |grep lshttpd
    Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
    root 119614 0.0 0.0 64352 868 pts/3 SN+ 11:54 0:00 grep lshttpd

    Stopped litespeed
    # /etc/init.d/lsws stop

    Moved apache binary
    # ll /usr/local/apache/bin/httpd_ls_bak
    -rwxr-xr-x 1 root root 1446322 May 5 13:21 /usr/local/apache/bin/httpd_ls_bak*
    # ll /scripts/restartsrv_httpd
    -rwxr-xr-x 1 root root 4432 Apr 6 02:55 /scripts/restartsrv_httpd*


    # /scripts/restartsrv_httpd
    #

    # netstat -plane |grep :80 |grep LISTEN
    tcp 0 0 112.140.185.239:80 0.0.0.0:* LISTEN 0 383665297 141492/litespeed (l
    tcp 0 0 112.140.185.238:80 0.0.0.0:* LISTEN 0 383665296 141492/litespeed (l
    tcp 0 0 112.140.185.217:80 0.0.0.0:* LISTEN 0 383665295 141492/litespeed (l
    tcp 0 0 112.140.185.216:80 0.0.0.0:* LISTEN 0 383665294 141492/litespeed (l
    tcp 0 0 112.140.185.215:80 0.0.0.0:* LISTEN 0 383665293 141492/litespeed (l
    tcp 0 0 112.140.185.221:80 0.0.0.0:* LISTEN 0 383665292 141492/litespeed (l
    tcp 0 0 112.140.185.220:80 0.0.0.0:* LISTEN 0 383665291 141492/litespeed (l
    tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 0 383665290 141492/litespeed (l
    tcp 0 0 180.210.205.251:80 0.0.0.0:* LISTEN 0 383665289 141492/litespeed (l

    Even tried this by killing all the lshttpd process. and starting the apache binary
    # /usr/local/apache/bin/apachectl start
    [OK] Send SIGUSR1 to 664016

    Nothing helps
    ++++++++

    What can I do now? server is not getting switched to apache and awstats is not getting fixed too. Litespeed version is 4.1.12.

Share This Page