Category: CloudLinux

  • Set unlimited resources for a user in cloudlinux

    Set unlimited resources for a user in cloudlinux

    To set unlimited resources for a user in cloudlinux, run the following command:

    lvectl set-user user --unlimited

    Back to cloudlinux

  • How to install ImunifyAV+

    ImunifyAV+ is an anti-malware software for Cpanel/Plesk servers. This is paid version of ImunifyAV.

    To install ImunifyAV+, run

    If you have a key-based license

    wget https://repo.imunify360.cloudlinux.com/defence360/imav-deploy.sh -O imav-deploy.sh
    bash imav-deploy.sh --key YOUR_KEY
    

    If you have an IP-based license for ImunifyAV+, use IPL as the license key

    wget https://repo.imunify360.cloudlinux.com/defence360/imav-deploy.sh -O imav-deploy.sh
    bash imav-deploy.sh --key IPL 
    

    See ImunifyAV

  • Connect to backend failed: connect to lsphp failed: 110

    Connect to backend failed: connect to lsphp failed: 110

    On a CloudLinux Server, websites stopped working with the error message “Service Unavailable”. On checking error_log in /usr/local/apache/logs, found following error message

    [Fri Jul 09 15:32:37.884950 2021] [lsapi:error] [pid 1639593:tid 47853204383488] [client 207.46.13.54:46915] mod_lsapi: [host ronnie.serverok.in] [req GET / HTTP/1.1] Connect to backend failed: connect to lsphp failed: 110
    

    The problem was due to the server got booted using the default CentOS kernel instead of CloudLinux Kernel.

    [root@server ~]# uname -a
    Linux server.serverok.in 3.10.0-1062.9.1.el7.x86_64 #1 SMP Thu May 27 10:10:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
    [root@server ~]#
    

    If you were using Cloudlinux kernel, “uname -a” command will show kernel with “lve” in the name. Example 3.10.0-962.3.2.lve1.5.56.el7.x86_64

    To see the list of kernels available, run

    awk -F\' '$1=="menuentry " {print i++ " =  "$2}' /etc/grub2.cfg
    

    Example

    [root@server ~]#  awk -F\' '$1=="menuentry " {print i++ " =  "$2}' /etc/grub2.cfg
    0 =  CloudLinux (3.10.0-962.3.2.lve1.5.56.el7.x86_64) 7.9 (Boris Yegorov)
    1 =  CloudLinux (3.10.0-1062.9.1.el7.x86_64) 7.9 (Boris Yegorov)
    2 =  CloudLinux (3.10.0-962.3.2.lve1.5.27.el7.x86_64) 7.9 (Boris Yegorov)
    3 =  CloudLinux (0-rescue-21361cf887984f57a840ce7ea6a3f75c) 7.9 (Boris Yegorov)
    [root@server ~]#
    

    To set default kernel, run

    grub2-set-default 0
    

    This will set kernel entry to the first entry.

    Verify default kernel with

    grub2-editenv list
    

    Example

    [root@server ~]# grub2-editenv list
    saved_entry=0
    [root@server ~]#
    

    Reboot the server with

    reboot
    

    Once rebooted, verify the server is booted with CloudLinux kernel.

  • Cpanel CloudLinux set all users to use alt-php

    If your cpanel server have cloudlinux + PHP Selector installed, you need to set all site to use inherit PHP before you can use PHP Selector.

    This can be done in MultiPHP Manager or using command line

    for i in $(cut -d: -f1 /etc/userdatadomains );do whmapi1 php_set_vhost_versions version=inherit vhost-0=$i;done
    

    Tis command will set all web sites to use inherit PHP.

    To set all site to use alt-PHP 7.4, run

    selectorctl --change-to-version=7.4 --version=native
    

    This will change PHP version for all sites that use native PHP to alt-PHP 7.4

    Or you can use

    cd /var/cpanel/users
    ls -1 | awk '{ print "selectorctl --set-user-current=7.4 --user="$1 }' | sh
    

    See cloudlinux

  • CageFS command not working for user

    I have flvtool2 installed on the server. Path to binary file location was added in file /etc/cagefs/conf.d/vshare.cfg

    [root@server22 ~]# cat /etc/cagefs/conf.d/vshare.cfg 
    [vshare]
    comment=vShare Youtube Clone Requirements
    paths=/usr/bin/ffmpeg, /usr/bin/mencoder, /usr/bin/mplayer, /usr/bin/flvtool2, /usr/bin/lame, /usr/bin/yamdi, /usr/bin/qt-faststart, /usr/bin/MP4Box, /usr/bin/mediainfo, /usr/bin/neroAacEnc
    [root@server22 ~]# 
    

    The binary program works properly when running as root, but it fail when switching to a user that use CageFS.

    [root@server22 ~]# /usr/bin/flvtool2 -V
    FLVTool2 1.0.6
    [root@server22 ~]# su - socialwe
    Last login: Thu May 28 06:33:33 UTC 2020 on pts/0
    [socialwe@server22 ~]$ /usr/bin/flvtool2 -V
    :1:in `require': cannot load such file -- rubygems.rb (LoadError)
    from :1:in `'
    [socialwe@server22 ~]$
    

    The problem is fixed by editing file /etc/cagefs/cagefs.mp

    vi /etc/cagefs/cagefs.mp
    

    Add following lines

    !/usr/lib64/ruby/
    !/usr/share/rubygems/
    !/usr/share/ruby/
    !/usr/local/share/ruby/
    

    Now remount cagefs with

    cagefsctl --remount-all
    

    See cagefs

  • cagefsctl

    Enable CafeFS for all cpanel users

    cagefsctl --enable-all