LiteSpeed compatibility issue with cPanel > cPanel blocking LiteSpeed

Discussion in 'Install/Configuration' started by vivek, Mar 2, 2008.

  1. vivek

    vivek New Member

    Hello

    It has been found that , LiteSpeed is not compatible with cPanel/WHM anymore from the WHM version , ( WHM 11.15.0 cPanel 11.18.1-C21314 ) (updated before 2 or 3 days, I am using Current build,but there may be same change in RELEASE and STABLE Build also )

    Whenever WHM creates/removes a domain , WHM will kill ALL process on port 80 and then restart httpd

    But it was not like that before.
    Before this build , when WHM creates a domain

    It will not kill the 80 process, but
    it will restart httpd only.

    So that If litespeed is running on port 80, this will not affect litespeed.


    I will appreciate litespeed guys takes this as seriously and release a fix

    It has been declared by cPanel.net official

    Here is the some of conversations between me and cpanel.net

    Code:
    Hello,
    
     You can set your apache to run on different port, but any other webserver you want to run, we do not provide support for it.  As for setting on different port, you can set that in the WHM for this.
    
    --
    Russell Rademacher
    cPanel
    Customer Support Representative - Level 2

    Code:
    I dont want support for litespeed from cPanel.
    Only thing I want to know that, why cpanel is killing non-apache process from port 80?
    
    It was not like that before 2-3 days. 
    
    Some signal is killing litespeed and starting httpd
    
    I dont want to run apache anymore since it is causing high memory usage. And with litespeed , all websites are opening super fast, much much better than apache...
    I dont want to run apache on different port and I dont want to uninstall apache permanently. I just want to stop apache and start lsws
    
    Vivek

    Code:
    Hello,
    
     I am not sure if that is possible, since it is all tied into the service manager which checks port 80 to make sure apache is running, and from account management by creation and deletion of accounts.  That where it checks and run the updates for the restarts and if it find something running on port 80, it kills it.
    --
    Russell Rademacher
    cPanel
    Customer Support Representative - Level 2
    

    Code:
    Hi
    
    Where can I edit the code of service manger so that I can comment out the kill line?
    Vivek
    
    Code:
    Hello,
    
     You just disable the monitoring of apache in the WHM in the Service Manager.  That all.
    
    Russell Rademacher
    cPanel
    Customer Support Representative - Level 2
    Code:
    I did it. But , 
    Whenever WHM creates/removes a domain , whm/cpanel kills all processes on port 80 and then restarts apache.
    
    But previously it was not like that, It was,
    whenever whm creates a domain, it will not kill the processes on 80. but it will only restart apache.
    
    Because of this issues, I am not able to use a great webserver,better than apache called litespeed on my server.
    
    Can you recommend this to your tech's or co-workers and please let me know how to comment out the kill line in whm/cpanel configuration.
    
    This is really a big problem for me, because I have already paid for litespeed and now, I cant use it because of cpanel modification.
    
    
    Vivek

    Code:
    Hello,
    
     I will send it up to developers about it, but there been lot of major changes underneath the hood for cPanel and I highly doubt that you are going to be able to use litespeed, since it is not supported webserver for cPanel.
    
    --
    Russell Rademacher
    cPanel
    Customer Support Representative - Level 2


    So, tell me what will we do ? anyone having such issues?
    May be, because I did a /scripts/upcp recently and it updates all cpanel core files.

    I really love to use LiteSpeed, but what will do if cpanel is blocking it?

    :(

    Thank you
    Vivek
    SunTex Hosting
    Last edited: Mar 8, 2008
  2. vivek

    vivek New Member

    Suggestion :

    What about changing the

    "service httpd restart" command , so that whenever cpanel issue this command, litespeed will restart.

    also
    /etc/rc.d/init.d/httpd restart - > restart litespeed instead of httpd


    Vivek
  3. vivek

    vivek New Member

    :(

    I just tried this

    cd /etc/rc.d/init.d/
    mv httpd httpd.old
    mv lsws lsws.old
    cp lsws.old httpd

    and service httpd start is now starting LiteSpeed.
    Then I tried to add a domain, and cpanel killed all 80 processes , but failed to reload httpd(lsws now)

    Any other solution ?
  4. vivek

    vivek New Member

    Hm.. looks like one man show!
    Anybody there for answering me ? :p
  5. vivek

    vivek New Member

    Hm..

    I switched back to WHM STABLE version and it seems lsws is working fine

    WHM 11.15.0 cPanel 11.18.1-S20683

    I disabled automatic cPanel update option.
  6. mistwang

    mistwang LiteSpeed Staff

    We will come up with a solution soon. Just stay with the WHM STABLE version for now.
  7. vivek

    vivek New Member

    New mail from tech.


    Howdy,

    cPanel calls /scripts/restartsrv_httpd when restarting httpd. If you wanted to make any modifications to accommodate your customized setup, this would be the place to start. Note that if you do make changes to this file, you would need to make it immutable to prevent overwrites in future updates. Also, modifying this script would void any support we could provide for issues it may cause, which I suppose is irrelevant since you're running an unsupported daemon any how :)

    If you have any further questions concerning this, please let us know!
    --

    Regards,
    Stephen Bee
    Technical Support
    cPanel
  8. mistwang

    mistwang LiteSpeed Staff

    I need a copy of /scripts/restartsrv_httpd from the new WHM release, can you send me one?

    Thanks!
  9. vivek

    vivek New Member

    Hi there!
    I am sending this from my vps, since I have stable version on my dedicated


    Code:
    #!/usr/bin/perl
    # cpanel12 - restartsrv_httpd                Copyright(c) 1997-2007 cPanel, Inc.
    #                                                           All rights Reserved.
    # copyright@cpanel.net                                         http://cpanel.net
    # This code is subject to the cPanel license. Unauthorized copying is prohibited
    
    use lib '/scripts';
    use strict;
    use RestartSrv;
    use POSIX;
    
    setuppath();
    
    my ( $system, $nodename, $release, $version, $machine ) = POSIX::uname();
    my ( $restart, $check, $status, $verbose ) = parseargv();
    
    my $iscript      = '';
    my $service      = 'httpd';
    my $processowner = '';
    my $disabled     = ( -e '/etc/httpddisable' || -e '/etc/apachedisable' || -e '/etc/httpdisable' ) ? 1 : 0;
    
    ( $processowner, $service ) = servicefixup( $system, $service );
    
    system '/scripts/ensure_conf_dir_crt_key';
    
    if ( $restart && !$disabled ) {
        my $lock_file = '/var/run/restartsrv_httpd.lock';
        lock_file($lock_file);
    
        $iscript = getinitfile( $service, $system );
    
        #--restart or nothing (restart service)
        if ($iscript) {
            if ($verbose) {
                print "Init script $iscript located.\n";
                system( $iscript, 'stop' );
            }
            else {
                nooutputsystem( $iscript, 'stop' );
            }
            doomedprocess( $service, $verbose );
    
            cleanup();
    
            system $iscript, 'start';
        }
        else {
            if ($verbose) {
                print "Init script /usr/local/apache/bin/apachectl located.\n";
            }
    
            doomedprocess( $service, $verbose );
    
            cleanup();
    
            system '/usr/local/apache/bin/apachectl', 'startssl';
        }
    
        unlink $lock_file if -e $lock_file;
    
    }
    elsif ($status) {
    
        #--status (show ps)
        if ($disabled) {
            print "$service is disabled\n";
        }
        else {
            print check_service( $service, $processowner );
        }
    }
    elsif ($check) {
        exit if ($disabled);
        if ( check_service( $service, $processowner ) eq '' ) {
            print "$service is not running\n";
        }
    }
    
    sub cleanup {
    
     {
    
        # Clean up
        if ( -e '/usr/local/apache/logs/httpd.scoreboard' ) {
            unlink '/usr/local/apache/logs/httpd.scoreboard' or warn "Unable to remove: $!";
        }
        if ( -e '/usr/local/apache/logs/httpd.pid' ) {
            unlink '/usr/local/apache/logs/httpd.pid' or warn "Unable to remove: $!";
        }
        if ( -e '/usr/local/apache/logs/rewrite_lock' ) {
            unlink '/usr/local/apache/logs/rewrite_lock' or warn "Unable to remove: $!";
        }
    }
    
    



    Vivek
    Last edited: Mar 3, 2008
  10. vivek

    vivek New Member

    Just checked the stable version's file.
    Both are same.
    :?
  11. mistwang

    mistwang LiteSpeed Staff

    That script won't kill lshttpd, so it is something else.
  12. mistwang

    mistwang LiteSpeed Staff

    I create a simple proof of concept shell script, acting as Apache to LSWS wrapper, which replaces Apache executable. If some one help us test and prove that it works, we will add code to automate everything.

    It will be the ultimate solution for all hosting control panels.
  13. vivek

    vivek New Member

    Hello

    Please contact me via yahoo,gmail,msn chat, I will help you to test the script

    getvivekv at gmail.com
    getvivekv at yahoo.com
    getvivekv at msn.com

    Vivek
    Last edited: Mar 5, 2008
  14. vivek

    vivek New Member

    Hi

    Or , I can setup a VPS for testing purpose, and can install cPanel with 14 days trial license. You can check the script on it.

    Thank you
    Vivek
  15. aww

    aww New Member

    For the record, RELEASE is affected the same way.
    I'm on RELEASE and it's acting the same way for the past two days.

    Only build I don't know if it will help is STABLE.

    Before I take that drastic step to rollback I'd love some confirmation will it provide a temporary workaround...
  16. travisbell

    travisbell New Member

    FYI -- We too are experiencing this issue.

    Has there been any progress in figuring out what with the latest versions of cPanel are causing this?
  17. vivek

    vivek New Member

    Yea. Mr.George (mistwang) is with me right now and testing a script on my server.

    I hope he will find a fix soon.

    Vivek
  18. aww

    aww New Member

  19. vivek

    vivek New Member

    That is not a good one.
    Just downgrade your cPanel to STABLE build. and also disable upcp via WHM

    Vivek
  20. mistwang

    mistwang LiteSpeed Staff

    Here is the cure for this problem. Now, you need to manually apply it, we are working on an automated solution.

    Use the following shell script to replace Apache httpd executable, backup Apache httpd executable to httpd_ls_bak
    Code:
    #!/bin/sh
    
    ARGS="$@"
    ARG1="$1"
    
    LSWS_HOME=/opt/lsws
    
    APACHE=/usr/local/apache/bin/httpd_ls_bak
    
    
    LSWS=$LSWS_HOME/bin/lswsctrl
    PARAM_LOG=$LSWS_HOME/logs/ap_cmd_param.log
    
    echo "$@" >> $PARAM_LOG
    
    ulimit -v unlimited
    
    if [ "x$ARG1" = 'x-DSSL' ]; then
       shift
       ARG1=$1
    fi
    
    if [ "x$ARG1" = 'x' ]; then
        $LSWS start
        
    elif [ "x$ARG1" = 'x-k' ]; then
        ARG2=$2
        case $ARG2 in
        start|startssl|sslstart|start-SSL)
        $LSWS start
        ;;
        stop|graceful-stop)
        $LSWS stop
        ;;
        restart|graceful)
        $LSWS restart
        ;;
        *)
        $APACHE $ARGS
        esac
    else
        $APACHE $ARGS
    fi
    
    ERROR=$?
    exit $ERROR
    
    
    You need to make sure LSWS_HOME and APACHE matches your installation, roughly the follow steps are required

    Code:
    cd /usr/local/apache/bin
    mv httpd httpd_ls_bak
    vi httpd
    <copy/edit the script>
    chmod 0755 httpd
    

    ATTENTION: You need to manually download and update to the latest 3.3.7 release package


    No longer need to enable "Auto Reload On Changes" to apply Apache configuration changes anymore. The control panel will restart LSWS through the wrapper script after finishing updating Apache configuration files.

    I knew that WHM may overwrite the script when you rebuild Apache, you need to be careful about this. We are working on a solution to automatically install the script and monitor it, if control panel change it, it will be changed back immediately. It is going to be in 3.3.8 release, maybe this weekend.

    Thanks for Vivek's help with testing the solution.:)

Share This Page