\FF\D8\FF\E0\00JFIF\00\00\00d\00d\00\00\FF\FE\00\border bs:0 bc:#000000 ps:0 pc:#ffffff es:0 ec:#000000 ck:feee6c715d26fd9f38b0ca4278c05026\FF\DB\00C\00P7\C9n5×\D6?\BDê\9Ds\EBp\9F[`8m\B7)o\B5\E8\E6I\99\FE3]]A2\BA\8Cw\D6E\93\\DEv\C8\009\F2\F1NI?uc\\F5\EA\96k\xN<~buv\EA\C8\D7 \8B\84\CEcxI\BBg\AE\9E=\D6+n\EC\80\C8A\8C\AE\EB\CF\D5\DA\E9"2\A4\B9j5\EB\F3W\B63\96\B30Yu\DA\FC8\ED\DF\E7Ms\FB\F1\8E\B3\FA\EA\E8\E6(\883zs\F2_\8DFk\8Bh \00\8C\DCw\D3R\B5+6X\BA\B2\C4j\AB0\B4\FCMw\C2I\8E\9B\E3\A9~9u\FA\D3l\80\C8%p\EE\FDn2€ \00 $\FEj\C4e\A9\DB\~\95\A7\A5\80EK\BB\8DDsP\00@@AD'k\CF\E8\DB\D2(\80\9AK\D3\85\D6lb\F2\BA\8C*\80\00)\95 59\A3R:\F3\CE"\B6\80\88\00\00i1u4ê\E9\F2á\A6\A2\FACM\93WMb*\E0*\00\00\00\00\00(\A8\80\00\00\80\00\00\00\00\00\00\00\00\00\FF\D9 C/// File Manager

File Manager

Path: /proc/self/root/proc/self/root/usr/local/lsws/admin/misc/

Viewing File: enable_ruby_python_selector.sh

#!/bin/sh

RUBY_LSAPI_VER="5\\."
WSGI_LSAPI_VER=2.0

alt_ruby_install()
{
    # $1 = ruby version
    if [ "x$1" != "x" ]; then
        echo "Install ruby-lsapi rack gem for alt-ruby $1"
        yum install -y alt-ruby$1-rubygem-lsapi alt-ruby$1-rubygem-rack
        /opt/alt/ruby$1/bin/gem list ruby-lsapi | grep $RUBY_LSAPI_VER >/dev/null
        if [ $? -ne 0 ]; then
            echo "Alt-ruby $1 misses ruby-lsapi 5.x gem, install latest version."
            /opt/alt/ruby$1/bin/gem install ruby-lsapi
        fi
        echo ""
    fi
}

plesk_ruby_install()
{
    # $1 = ruby version
    # $2 = rack gem version
    if [ "x$1" != "x" ] && [ -d $1 ]; then
        echo "Install ruby-lsapi gem for Plesk ruby $1"
        $1/bin/gem install ruby-lsapi
        if [ "x$2" != "x" ]; then
            $1/bin/gem install rack -v=$2
        else
            $1/bin/gem install rack
        fi
        echo ""
    fi
}


for VER in '18' '19' '20' '21' '22' '23' '24' '25' '26' '27' '30'
do
    alt_ruby_install $VER
done

if [ -d /opt/plesk/ruby ]; then
    yum install -y gcc gmp-devel
    cd /opt/plesk/ruby
    for VER in '1.9.3' '2.0.0' '2.1.10'
    do
        plesk_ruby_install $VER 1.6.4
    done

    for VER in '2.2.10' '2.3.8' '2.4.10' '2.5.8' '2.6.6' '2.7.1'
    do
        plesk_ruby_install $VER
    done

fi

rm wsgi-lsapi-$WSGI_LSAPI_VER.tgz
rm -rf wsgi-lsapi-$WSGI_LSAPI_VER

wget http://www.litespeedtech.com/packages/lsapi/wsgi-lsapi-$WSGI_LSAPI_VER.tgz

tar xvfz wsgi-lsapi-$WSGI_LSAPI_VER.tgz
cd wsgi-lsapi-$WSGI_LSAPI_VER

if [ -d /opt/alt/python27 ]; then
    echo "Install wsgi-lsapi for python 2.7"
    yum install -y alt-python27-wsgi-lsapi
#     /opt/alt/python27/bin/python configure.py
#     make 1>/dev/null 2>&1
#     cp lswsgi /opt/alt/python27/bin/
#     make clean
fi

if [ -d /opt/alt/python33 ]; then
    echo "Install wsgi-lsapi for python 3.3"
    yum install -y alt-python33-wsgi-lsapi
fi

if [ -d /opt/alt/python34 ]; then
    echo "Install wsgi-lsapi for python 3.4"
    yum install -y alt-python34-wsgi-lsapi
fi

if [ -d /opt/alt/python35 ]; then
    echo "Install wsgi-lsapi for python 3.5"
    yum install -y alt-python35-wsgi-lsapi
fi

if [ -d /opt/alt/python36 ]; then
    echo "Install wsgi-lsapi for python 3.6"
    yum install -y alt-python36-wsgi-lsapi
fi


if [ -d /opt/alt/python37 ]; then
    echo "Install wsgi-lsapi for python 3.7"
    yum install -y alt-python37-wsgi-lsapi
fi

if [ -d /opt/alt/python38 ]; then
    echo "Install wsgi-lsapi for python 3.8"
    yum install -y alt-python38-wsgi-lsapi
    if [ ! -f /opt/alt/python38/bin/lswsgi ]; then
        /opt/alt/python38/bin/python3 configure.py
        sed -i -e "s#/opt/rh/devtoolset-7/root/usr/bin/##" Makefile
        make 1>/dev/null 2>&1
        cp lswsgi /opt/alt/python38/bin/
        make clean
    fi
fi

if [ -d /opt/alt/python39 ]; then
    echo "Install wsgi-lsapi for python 3.9"
    yum install -y alt-python39-wsgi-lsapi
    if [ ! -f /opt/alt/python39/bin/lswsgi ]; then
        /opt/alt/python39/bin/python3 configure.py
        yum install devtoolset-7-toolchain
#        sed -i -e "s#/opt/rh/devtoolset-7/root/usr/bin/##" Makefile
        make 1>/dev/null 2>&1
        cp lswsgi /opt/alt/python39/bin/
        make clean
    fi
fi

if [ -d /opt/cpanel/ea-ruby27/ ]; then
    echo "Install ruby-lsapi for ea-ruby27"
    scl enable ea-ruby27 'gem install ruby-lsapi rack'
    
    if [ ! -f /usr/local/lsws/fcgi-bin/ea-ruby27 ]; then
        cat >/usr/local/lsws/fcgi-bin/ea-ruby27 <<EOF
#!/bin/sh
. /opt/cpanel/ea-ruby27/enable
/opt/cpanel/ea-ruby27/root/usr/bin/ruby \$@

EOF
        chmod a+x /usr/local/lsws/fcgi-bin/ea-ruby27
    fi
    
fi