Cloud Linux
Cloud Linux
Documentation
© 2018 CloudLinux Inc
2 CloudLinux Documentation
Table of Contents
Installation
................................................................................................................................... 9
Converting
...................................................................................................................................
Existing Servers 9
Advanced Options
..........................................................................................................................................................
for cldeploy 10
Explanation Of Changes
.......................................................................................................................................................... 11
Installing
...................................................................................................................................
new servers 12
CloudLinux
...................................................................................................................................
OS Images 12
Xen Images .......................................................................................................................................................... 12
Net Install
................................................................................................................................... 13
Installing
...................................................................................................................................
on H-Sphere Server 14
Converting from..........................................................................................................................................................
mod_fastcgi to mod_fcgid 14
Virtuozzo
...................................................................................................................................
and OpenVZ 17
Getting
...................................................................................................................................
Trial License 18
Registering
...................................................................................................................................
CloudLinux Server 19
CloudLinux
...................................................................................................................................
on DigitalOcean 19
CloudLinux
...................................................................................................................................
on Linode 20
Servers
...................................................................................................................................
with LILO boot loader 21
cPanel
...................................................................................................................................
EasyApache 4 21
FAQ .......................................................................................................................................................... 23
Uninstalling
...................................................................................................................................
CloudLinux 24
Limits
................................................................................................................................... 25
Understanding
...................................................................................................................................
LVE 26
Command-line
...................................................................................................................................
Tools 28
lvectl .......................................................................................................................................................... 29
lveps .......................................................................................................................................................... 30
lvetop .......................................................................................................................................................... 31
cldetect .......................................................................................................................................................... 32
SPEED
...................................................................................................................................
Limits 32
CPU Limits
................................................................................................................................... 33
Memory
...................................................................................................................................
Limits 34
IO Limits
................................................................................................................................... 35
IOPS ...................................................................................................................................
Limits 35
Entry ...................................................................................................................................
Processes Limit 35
Number
...................................................................................................................................
of Processes Limit 35
Network
...................................................................................................................................
Limits 35
Compatibility
...................................................................................................................................
Matrix 37
Integration
...................................................................................................................................
Components 38
LVE PAM module
.......................................................................................................................................................... 38
cPanel
...................................................................................................................................
LVE Manager 51
LVE Manager Options
.......................................................................................................................................................... 57
Server Processes
..........................................................................................................................................................
Snapshots 57
LVE Plugins Branding
.......................................................................................................................................................... 60
User Message
...................................................................................................................................
for PHP version 60
Reseller Limits
................................................................................................................................... 64
Installation
...................................................................................................................................
and Requirements 66
How to
...................................................................................................................................
Enable and Disable Reseller Limits 66
Hoster...................................................................................................................................
Interface 68
Current Usage Tab
.......................................................................................................................................................... 69
Users Tab .......................................................................................................................................................... 70
Statistics Tab .......................................................................................................................................................... 73
Options Tab .......................................................................................................................................................... 75
Packages Tab .......................................................................................................................................................... 77
Selector Tab .......................................................................................................................................................... 78
Reseller
...................................................................................................................................
Interface 79
Current Usage Tab
.......................................................................................................................................................... 79
Historical Usage..........................................................................................................................................................
Tab 80
Users Tab .......................................................................................................................................................... 81
Statistics Tab .......................................................................................................................................................... 83
Options Tab .......................................................................................................................................................... 85
Packages Tab .......................................................................................................................................................... 87
LVE-Stats 2
................................................................................................................................... 87
Installation
................................................................................................................................... 88
Configuration
................................................................................................................................... 89
LVE Stats2 and..........................................................................................................................................................
MySQL DB Server 91
LVE Stats 2 and..........................................................................................................................................................
PostgreSQL 93
Customize lve-stats-2
..........................................................................................................................................................
notifications 95
Command-line
...................................................................................................................................
Tools 97
lveinfo .......................................................................................................................................................... 98
lvechart .......................................................................................................................................................... 101
dbgovchart .......................................................................................................................................................... 101
lve-read-snapshot
.......................................................................................................................................................... 102
lve-create-db .......................................................................................................................................................... 103
cloudlinux-top.......................................................................................................................................................... 103
cloudlinux-statistics
.......................................................................................................................................................... 106
Plugins
................................................................................................................................... 110
Creating
...................................................................................................................................
a Plugin for LVE Stats 2 111
Introduction .......................................................................................................................................................... 111
3
4 CloudLinux Documentation
Installation
................................................................................................................................... 124
Unistalling
...................................................................................................................................
CageFS 125
Managing
...................................................................................................................................
Users 125
Command-line
...................................................................................................................................
Tools 126
Running
...................................................................................................................................
Command Inside CageFS 128
Sanity
...................................................................................................................................
Check 128
CageFS
...................................................................................................................................
Quirks 129
Configuration
................................................................................................................................... 130
File System Templates
.......................................................................................................................................................... 130
Excluding Files.......................................................................................................................................................... 131
Excluding Users .......................................................................................................................................................... 131
Mount Points .......................................................................................................................................................... 132
Per user virtual
.........................................................................................................................................................
mount points 132
Split by Username
......................................................................................................................................................... 133
Mounting .........................................................................................................................................................
user’s home directory inside CageFS 134
Base Home Directory
.......................................................................................................................................................... 134
PostgreSQL support
.......................................................................................................................................................... 135
PAM Configuration
.......................................................................................................................................................... 136
Executing By Proxy
.......................................................................................................................................................... 136
Custom /etc directory
.......................................................................................................................................................... 137
Moving cagefs-skeleton
..........................................................................................................................................................
directory 138
Moving /var/cagefs
..........................................................................................................................................................
directory 138
TMP directories .......................................................................................................................................................... 139
Syslog .......................................................................................................................................................... 141
Excluding mount ..........................................................................................................................................................
points 141
Control
...................................................................................................................................
Panel Integration 142
cPanel .......................................................................................................................................................... 142
Plesk .......................................................................................................................................................... 143
ISPManager .......................................................................................................................................................... 145
MySQL Governor
................................................................................................................................... 146
Installation
................................................................................................................................... 147
Removing
...................................................................................................................................
MySQL Governor 148
Modes
...................................................................................................................................
Of Operation 148
Configuration
................................................................................................................................... 148
Starting
...................................................................................................................................
And Stopping 150
Mapping
...................................................................................................................................
a User to Database 151
Log Files
................................................................................................................................... 151
Change
...................................................................................................................................
MySQL version 152
Command-line
...................................................................................................................................
Tools 152
dbtop .......................................................................................................................................................... 153
dbctl .......................................................................................................................................................... 154
lveinfo --dbgov.......................................................................................................................................................... 155
dbgovchart .......................................................................................................................................................... 157
Backing
...................................................................................................................................
Up MySQL 159
abrt plugin
................................................................................................................................... 160
Troubleshooting
................................................................................................................................... 160
PHP...................................................................................................................................
Selector 160
Installation
................................................................................................................................... 160
LiteSpeed support
.......................................................................................................................................................... 161
ISPmanager support
.......................................................................................................................................................... 166
Configuration
................................................................................................................................... 166
Setting Default..........................................................................................................................................................
Version and Modules 167
Individual PHP.ini
..........................................................................................................................................................
files 167
Substitute global
..........................................................................................................................................................
php.ini for individual customer 167
Managing interpreter
..........................................................................................................................................................
version 168
Including PHP Selector
..........................................................................................................................................................
only w ith some packages (cPanel) 169
PHP Extensions .......................................................................................................................................................... 170
FFmpeg .......................................................................................................................................................... 170
Native PHP Configuration
.......................................................................................................................................................... 170
Command-line
...................................................................................................................................
Tools 171
selectorctl .......................................................................................................................................................... 171
Integrating With
..........................................................................................................................................................
Control Panels 176
Removing
...................................................................................................................................
PHP Selector 178
Using
...................................................................................................................................
PHP Selector 178
Custom
...................................................................................................................................
PHP.ini options 180
End ...................................................................................................................................
user directories 182
Compiling
...................................................................................................................................
your own extensions 183
Roll your
...................................................................................................................................
own PHP 183
Detect
...................................................................................................................................
User's PHP Version 184
PHP...................................................................................................................................
Selector without CageFS 184
"Global”
...................................................................................................................................
php.ini Options for all Alt-PHP Versions 186
Bundled
...................................................................................................................................
PHP Extensions 186
PHP 4.4 Extensions
.......................................................................................................................................................... 187
PHP 5.1 Extensions
.......................................................................................................................................................... 187
PHP 5.2 Extensions
.......................................................................................................................................................... 188
PHP 5.3 Extensions
.......................................................................................................................................................... 188
PHP 5.4 Extensions
.......................................................................................................................................................... 189
PHP 5.5 Extensions
.......................................................................................................................................................... 190
PHP 5.6 Extensions
.......................................................................................................................................................... 191
PHP 7.0 Extensions
.......................................................................................................................................................... 191
5
6 CloudLinux Documentation
Installation
................................................................................................................................... 202
End ...................................................................................................................................
User Access 203
Command
...................................................................................................................................
Line 207
Hide...................................................................................................................................
Python and Ruby Selector Icons 207
Trac ................................................................................................................................... 208
Trac w ith MySQL
.......................................................................................................................................................... 211
Redmine
................................................................................................................................... 211
Easy...................................................................................................................................
Apache 4 219
Node.js Selector
................................................................................................................................... 219
Overview
...................................................................................................................................
& Requirements 220
Installation
................................................................................................................................... 220
Command
...................................................................................................................................
Line Interface 221
User...................................................................................................................................
Interface 226
Node.js
...................................................................................................................................
Deployment 233
Remote Usage..........................................................................................................................................................
of Node.js Interpreters 233
Remote Usage..........................................................................................................................................................
of the cloudlinux-selector Utility 236
inodes Limits
................................................................................................................................... 236
cl-quota
................................................................................................................................... 239
General Provisions
.......................................................................................................................................................... 240
Setting Limits and
..........................................................................................................................................................
Integration w ith Panel Packages 240
Limits Inheritance
.......................................................................................................................................................... 242
Caching and Synchronizing
..........................................................................................................................................................
the Limits 242
Quotas DB File.......................................................................................................................................................... 242
CLI Options/Examples
.......................................................................................................................................................... 243
Kernel Settings
................................................................................................................................... 245
Virtualized
...................................................................................................................................
/proc filesystem 245
SecureLinks
................................................................................................................................... 247
Symlink Ow ner..........................................................................................................................................................
Match Protection 247
Link Traversal..........................................................................................................................................................
Protection 248
ptrace
...................................................................................................................................
Block 249
Xen XVDA
...................................................................................................................................
detection 249
TPE ...................................................................................................................................
Extension 249
IOLimits
...................................................................................................................................
latency 250
Hybrid
...................................................................................................................................
Kernel 250
Reading
...................................................................................................................................
LVE usage 251
flashcache
................................................................................................................................... 252
OOM...................................................................................................................................
Killer for LVE Processes 253
File System
...................................................................................................................................
Quotas 253
Apache mod_lsapi
................................................................................................................................... 253
Installation
................................................................................................................................... 261
Uninstall
................................................................................................................................... 266
Troubleshooting
................................................................................................................................... 266
FAQ...................................................................................................................................
on mod_lsapi 272
Installing
...................................................................................................................................
mod_lsapi for Plesk 276
CRIU...................................................................................................................................
Support 278
File...................................................................................................................................
Change API 282
General
................................................................................................................................... 282
Usage
...................................................................................................................................
and Integration 282
Installation
...................................................................................................................................
and Configuration 283
Configuration
...................................................................................................................................
Details 284
Low-level
...................................................................................................................................
access 286
mod_proctitle
................................................................................................................................... 286
How ...................................................................................................................................
to Read mod_proctitle Information 287
Tuning
...................................................................................................................................
Parameters 287
Additional Packages
................................................................................................................................... 288
Git for
...................................................................................................................................
cPanel 288
alt-suexec
................................................................................................................................... 288
tuned-profiles-cloudlinux
................................................................................................................................... 290
Integration Guide
................................................................................................................................... 291
Detecting
...................................................................................................................................
and Working with CloudLinux 291
Displaying
...................................................................................................................................
CPU, Memory & IO limits 292
Integrating
...................................................................................................................................
LVE Limits with Packages 293
Partner Portal
................................................................................................................................... 294
IP Reseller
...................................................................................................................................
Partner UI 294
CloudLinux Network
................................................................................................................................... 306
Managing
...................................................................................................................................
Licenses 306
Managing
...................................................................................................................................
Servers 308
Cancel
...................................................................................................................................
Licenses 310
7
8 CloudLinux Documentation
Overview
................................................................................................................................... 312
Installation
...................................................................................................................................
& Configuration 312
Installation and..........................................................................................................................................................
Update 312
Configuration of..........................................................................................................................................................
Product 313
Configuration of..........................................................................................................................................................
Add-on 313
Management
................................................................................................................................... 314
Link Via Add-on.
..........................................................................................................................................................
Optional License 315
Link Products ..........................................................................................................................................................
Directly 316
Link Via Configurable
..........................................................................................................................................................
Options 317
Link Add-ons Directly
.......................................................................................................................................................... 318
Order .......................................................................................................................................................... 318
Admin Area .......................................................................................................................................................... 319
Client Area .......................................................................................................................................................... 320
Licenses List .......................................................................................................................................................... 322
Add-on Licenses
..........................................................................................................................................................
List 322
Common
...................................................................................................................................
Problems 323
Deprecated
................................................................................................................................... 323
LVE-Stats
...................................................................................................................................
0.x 323
Storing statistics
..........................................................................................................................................................
in MySQL 327
Storing statistics
..........................................................................................................................................................
in PostgreSQL 330
Compacting in..........................................................................................................................................................
multi-server settings 333
OptimumCache
................................................................................................................................... 333
Installation .......................................................................................................................................................... 334
Using w ithout ..........................................................................................................................................................
ploop 336
Marking Directories
.......................................................................................................................................................... 336
Configuration File
.......................................................................................................................................................... 338
Command-line..........................................................................................................................................................
Interface 339
cloudlinux-collect
.......................................................................................................................................................... 340
Uninstall OptimumCache
.......................................................................................................................................................... 343
Troubleshooting.......................................................................................................................................................... 344
Hardware Compatibility
................................................................................................................................... 347
Downloading Documentation
................................................................................................................................... 347
1 Installation
Converting existing servers
o Explanation Of Changes
CloudLinux OS Images
o Xen Images
Net Install
CloudLinux on DigitalOcean
CloudLinux on Linode
cPanel EasyApache 4
Uninstalling CloudLinux
Once you have rebooted, you are running CloudLinux kernel with LVE enabled.
The script automatically detects and supports the following control panels: cPanel with EA3, Plesk,
DirectAdmin, InterWorx. It will install CloudLinux kernel, Apache module, PAM module, command line
tools as well as LVE Manager.
ISPmanager 5 has native support for CloudLinux. To deploy CloudLinux on a server with ISPmanager 5,
you would need to purchase CloudLinux license directly from ISPSystems and follow ISPmanager's
deployment guide.
Note. If you are converting Hyper-V server, please, mak e sure you upgrade to the latest CentOS 6.9 or
CentOS 7.4 first.
Usage:
To disable installation of LVE Manager and mod_hostinglimits, please use --conversion-only option.
To disable installation of kernel & CLN registration, please use --components-only option.
Examples:
The kernel is not removed - to prevent condition when server has no kernels and wouldn't boot. The
command line to remove the kernel is provided.
On cPanel servers, rebuild of Apache with EasyApache will complete the conversion back, but doesn't
have to be performed immediately.
On DirectAdmin servers, rebuild of Apache with custombuild will complete the conversion back, but
doesn't have to be performed immediately.
Note: Once you install server from the ISO, mak e sure you register your system and then run yum
update.
VMware
Alibaba Cloud
Xen
Like:
name = "cl6-sample"
uuid = "4230bccf-5882-2ac6-7e1c-0e2a60208001"
maxmem = 1024
memory = 1024
vcpus = 1
bootloader = "/usr/bin/pygrub"
on_poweroff = "destroy"
on_reboot = "restart"
on_crash = "restart"
vfb = [ "type=vnc,vncunused=1,key=en-us" ]
disk = [ "tap:aio:/var/lib/xen/images/cl6-sample.img,sda,w" ]
vif = [ "mac=00:16:3e:23:09:10,bridge=xenbr0,script=vif-bridge" ]
where:
Disk Images
Alternatively you can configure your PXE server using following folder as reference: http://
repo.cloudlinux.com/cloudlinux/6.6/install/x86_64/images/pxeboot/
2. During the CloudLinux installation select URL as installation source and enter URL: http://
repo.cloudlinux.com/cloudlinux/6.6/install/x86_64/ and continue with installation.
To install CloudLinux 5.10 instead of 6.6 use the following URL: http://repo.cloudlinux.com/
cloudlinux/5.10/netinstall/x86_64/
Same URLs can be used to install para-virtualized Xen using either command-line or virt manager.
[Please note, that CageFS and PHP Selector are not supported for H-Sphere]
Requirements
There is no need to install mod_hostinglimits -- it comes built in with H-Sphere. Once you load kernel
from CloudLinux with liblve 0.8 or later -- it will get enabled.
[H-Sphere 3.6.3+]
Step 1:
<IfModule mod_hostinglimits.c>
SkipErrors Off
AllowedHandlers cgi-script %php% fcgid-script application/x-miva-compiled
DenyHandlers hs-php5-script hs-php53-script hs-php54-script
Include /hsphere/local/config/httpd2/fcgi.conf
</IfModule>
#######
Step 4:
apache_version=2
apache_mpm=prefork
apache_fastcgi
apache_fcgid
PHP version/mode: php_fastcgi*
Step 1:
$ wget http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid-hsphere/
usemodule.phpmode.patch
$ patch /hsphere/local/config/scripts/usemodule.phpmode usemodule.phpmode.patch
Step 3:
Step 5:
Configure physical server from H-Sphere admin > E.Manager > P.Servers > server_name [parameters]
icon, settings should be:
apache_version = 2
apacha_fastcgi = yes
apache_status = yes
Step 9:
Note. After updating H-Sphere software on web server with CloudLinux you need to re-apply step 2
(patch usemodule.phpmode ) and restart apache with /hsphere/shared/scripts/apache-restart
script.
CloudLinux provides limited support for OpenVZ and Virtuozzo. At this stage only the following
functionality works:
CageFS
PHP Selector
max entry processes
mod_lsapi
MySQL Governor
Installation
Note. Mak e sure all containers are stopped prior to doing this operation. Or reboot the server after the
install.
Please mak e sure you have vzk ernel-headers and vzk ernel-devel pack ages installed. If no - install them
with yum:
After this is done, you can add LVE support for any container on a node, at any time.
To make CloudLinux work inside VZ container, VZ node has to be enabled. This should be done for any
container where LVE support needs to be added:
$ vzctl set CT_ID --devnodes lve:rw --save
To disable LVE support for Container:
$ vzctl set CT_ID --devnodes lve:none --save
Inside container, follow standard CL installation procedures: http://docs.cloudlinux.com/index.html?
converting_existing_servers.html
Note. Some servers require increasing fs.ve-mount-nr on host node, otherwise CageFS will throw errors.
On a host node:
1. add "fs.ve-mount-nr = 15000" to /etc/sysctl.conf;
2. apply it with 'sysctl -p' command.
In very rare cases the value should be increased higher, up to 50000.
If you have any issues getting activation key or if you have any questions regarding using your trial
subscription -- contact [email protected] and we will help.
DigitalOcean doesn't support custom kernels. The droplet (VM) always runs DigitalOcean's kernel.
CloudLinux requires its own kernel. To enable CloudLinux work on DigitalOcean droplets, we provide
ability to boot into CloudLinux kernel using kexec functionality.
cldeploy script checks for presence of /etc/digitalocean. If the file detected, we assume that this
is DigitalOcean droplet;
kexec-tools are installed;
kexec script will be created in /etc/rc.d/init.d/ and set to run right after rc.sysinit.
When executed, script /etc/rc.d/init.d/kexec detects latest installed CloudLinux kernel, and loads that
kernel.
If the system cannot boot into CloudLinux kernel (due to any reason), subsequent reboot will skip kexec,
allow droplet to boot into DigitalOceans' kernel.
To install CloudLinux 7 on Linode KVM server you should perform the following steps:
1. Deploy CL to your Linode following the steps from this section: http://docs.cloudlinux.com/
index.html?converting_existing_servers.html
After reboot you will have fully operational CloudLinux 7 system and can proceed with other configuration
you need.
1. Deploy CL to your Linode following the steps from this section: http://docs.cloudlinux.com/
index.html?converting_existing_servers.html
Please note that you will need to update /boot/grub/menu.lst manually after every kernel update.
3. Switch boot settings to pv-grub-x86_64 and switch off “Auto-configure networking” in Linode settings.
In case if you will migrate to KVM later you will need only switch the boot settings to GRUB 2.
To do that:
1. Make sure grub and kernel packages are not excluded. Edit file /etc/yum.conf and check exclude=
line for presence of kernel* grub*.
/sbin/grub-install /dev/sda
6. Reboot and check that you are running CloudLinux. uname -r should show something like: 2.6.18-
294.8.1.el5.lve0.7.33.
ea-php51 and ea-php52 have no PHP-FPM support. Please use mod_lsapi instead.
If EasyApache 4 was installed earlier on your CentOS server and you would like to migrate to
CloudLinux:
If EasyApache 4 was not installed earlier on your CentOS server and you would like to migrate to
CloudLinux:
2. Run:
cd ~; wget https://repo.cloudlinux.com/cloudlinux/sources/cloudlinux_ea3_to_ea4; sh
cloudlinux_ea3_to_ea4 --convert
(Find examples of cloudlinux_ea3_to_ea4 script usage below).
Install EasyApache4 on clean CloudLinux from ISO image or migrate to EasyApache4 on existings
CloudLinux servers:
1. Install cPanel.
2. Run:
cd ~; wget https://repo.cloudlinux.com/cloudlinux/sources/cloudlinux_ea3_to_ea4; sh
cloudlinux_ea3_to_ea4 --convert
(Find examples of cloudlinux_ea3_to_ea4 script usage below).
er
-a, --altphp Install/Update alt-php
Examples:
1.12.1 FAQ
When do we need to call
cd ~; wget https://repo.cloudlinux.com/cloudlinux/sources/cloudlinux_ea3_to_ea4;
sh cloudlinux_ea3_to_ea4 --convert
script?
The main difference between EasyApache 3 and EasyApache 4 for CloudLinux is the repositories used
for Apache RPM packages. For this reason, we need to use packages from the cl-ea4 repository or cl-
ea4-testing beta for EasyApache 4. Running this script we update all native ea-* packages from
CloudLinux repository. In this case, non-native packages for Apache include mod_lsapi and alt-mod-
passenger (CloudLinux feature). So, if mod_lsapi or alt-mod-passenger (or both) were installed on
EasyApache3, the script should be run with additional options as it described on the link https://
docs.cloudlinux.com/cpanel_easyapache_4.html.
Also, our script starts cPanel EasyApache 3 migration to EasyApache 4 Process. Read more about
Profile changes, Apache changes, PHP changes on the link https://documentation.cpanel.net/display/
EA4/The+EasyApache+3+to+EasyApache+4+Migration+Process
When cPanel is installed with EasyApache 4 on a clean CloudLinux (or it was CentOS converted to
CloudLinux), the installation of the ea-* packages comes from the EA4 cPanel repository. Most
packages from the EA4 cPanel repository are not compatible with CloudLinux packages and this can
lead to various errors. For this reason, we need to run this script to update the ea-* packages from the
CloudLinux repository.
If there was a need to return back EasyApache 4 packages from the EA4 cPanel repository, we need to
run:
cd ~; wget https://repo.cloudlinux.com/cloudlinux/sources/cloudlinux_ea3_to_ea4;
sh cloudlinux_ea3_to_ea4 --restore-cpanel-ea4-repo
When do we need to call
cd ~; wget https://repo.cloudlinux.com/cloudlinux/sources/cloudlinux_ea3_to_ea4;
sh cloudlinux_ea3_to_ea4 --revert
script?
Revert back is possible only if EasyApache 3 was previously installed, and then converted to
EasyApache 4. If cPanel was originally installed with EasyApache 4, there is no way to convert to
EasyApache 3.
At the end, the script will provide instructions on how to finish the conversion back to CentOS. That will
require removal of CloudLinux kernel (manual step), and installation of CentOS kernel (if needed).
Before the reboot the following command should be executed for restoring Apache and httpd.conf without
mod_hostinglimits:
For EasyApache 3:
/scripts/easyapache --build
For EasyApache 4:
/usr/local/bin/ea_install_profile --install /etc/cpanel/ea4/profiles/cpanel/
default.json
Please note that some of the packages from CloudLinux repo will still be present. They are the same as
CentOS packages, and don't have to be removed. They will be updated in the future from CentOS
repositories, as new versions come out.
2 Limits
CloudLinux has support for the following limits:
Note. It is always better to disable VMEM limits (set them to 0) in your system at all because they are
deprecated in CloudLinux 6/7 system and are causing unexpected issues.
Bellow you can find recommendations for your typical shared hosting setup. The recommendations don't
depend on the power of your server. They only depend on how "fast" you want your hosting accounts to
be.
SPEED=100%
PMEM=512MB
VMEM=0
IO=1024KB/s
IOPS=1024
NPROC=100
EP=20
SPEED=200%
PMEM=1GB
VMEM=0
IO=4096KB/s
IOPS=1024
NPROC=100
EP=40
Today, a single site can consume all CPU, IO, Memory resources or Apache processes - and bring the
server to a halt. LVE prevents that. It is done via collaboration of Apache module, PAM module and
kernel.
The kernel makes sure that all LVEs get fair share of the server's resources, and that no customer can
use more then the limits set for that customer.
Today we can limit CPU, Memory (virtual and physical), IO, number of processes as well as the number
of entry processes (concurrent connections to apache).
Each LVE limits amount of entry processes (Apache processes entering into LVE) to prevent single site
exhausting all Apache processes. If the limit is reached, then mod_hostinglimits will not be able to place
Apache process into LVE, and will return error code 508. This way very heavy site would slow down and
start returning 508 errors, without affecting other users.
If the site is limited by CPU or IO, then the site will start responding slower.
If the site is limited by memory or number of processes limits, then the user will recieve 500 or 503
errors that server cannot execute the script.
To use LVE you should have CloudLinux kernel installed, and LVE module loaded. You can check the
kernel by running the following command:
$ uname -r
You should see something like 2.6.18-294.8.1.el5.lve0.8.60. The kernel should have lve in its name. To
see if lve kernel module is loaded run:
$ lsmod|grep lve
lve 46496 0
Starting from kernels lve1.4.x iolimits module is a part of kmod-lve and could not be used separately.
You can toggle LVE on/ff by editing /etc/sysconfig/lve and setting LVE_ENABLE variable to yes or no.
You can toggle IO limits by editing /etc/sysconfig/iolimits and setting IO_LIMITS_ENABLED variable to
yes or no.
You need to reboot the server, after you set this option to make the changes live.
The best way to control LVE limits is using LVE Manager in your favorite control panel. Alternatively, you
can use command line tool lvectl to control limits.
The limits are saved in /etc/container/ve.cfg
Example:
<?xml version="1.0" ?>
<lveconfig>
<defaults>
<cpu limit="25"/>
<ncpu limit="1"/>
<io limit="1024"/>
<mem limit="262144"/>
<other maxentryprocs="200"/>
<pmem limit="262144"/>
<nproc limit="0"/>
</defaults>
<lve id="532">
<cpu limit="30"/>
<ncpu limit="5"/>
</lve>
</lveconfig>
Sets CPU limit to 25%, IO limit to 1024KB/s, virtual memory limit to 1GB (memory limit is set as a
number of 4096 bytes pages), physical memory limit to 1GB, CPU cores per LVE to 1, maximum entry
processes to 200 and no limit for number of processes for all LVEs. It also sets the limit of 30% and
number of processes limit to 5 for LVE with ID 532.
lveps
lvetop
cldetect
lve-stats
lve-stats 2
o Installation
o Configuration
lveinfo
lvechart
dbgovchart
lve-read-snapshot
lve-create-db
o Plugins
Introduction
Plugin Configuration
Types of Plugins
Examples of Plugins
Collector
Analizer
Persistor
Notifier
o /var/lve/info file
o Troubleshooting
2.2.1 lvectl
lvectl is the primary tool for LVE management. To use it, you have to have administrator access. lvectl
is a part of lve-utils package.
Comm
ands:
apply apply config settings to specified LVE
apply all apply config settings to all the LVEs
apply-many to apply LVE limits to multiple distinct LVEs (uids of users are read from stdin)
set set parameters for a LVE and/or create a LVE
set-user set parameters for a LVE and/or create a LVE using username instead of ID
list list loaded LVEs
list-user list loaded LVEs, display username instead of user id
limits show limits for loaded LVEs
delete delete LVE and set configuration for that LVE to defaults
delete-user delete LVE and set configuration for that user to defaults
destroy destroy LVE (configuration file remains unchanged)
destroy all destroy all LVE (configuration file remains unchanged)
destroy-many to destroy LVE limits to multiple distinct LVEs (uids of users are read from stdin)
package-set set LVE parameters for a package
package-list list LVE parameters for packages
package- delete LVE parameters for a package
delete
paneluserslim show current user's limits for control panel
its
limit limit PID into specified LVE. Parameters PID LVE_ID
Examples
2.2.2 lveps
lveps tool shows information about running LVEs, processes and threads belonging to them, CPU/
memory/IO usage consumed by LVEs and their individual processes/threads. LVE is only reported if it is
considered active (at least one thread belongs to that LVE or was running during measurement in
dynamic mode).
Usage: lveps [-p] [-n] [-o <fmt1:width1,...>] [-d] [-c <time>] [-s <style>] [-t] [-h]
Options:
-p to print per-process/per-thread statistics
-n to print LVE ID istead of username
-o to use formatted output (fmt=id,ep,pid,tid,cpu,mem,io)
-d to show dynamic cpu usage instead of total cpu usage
-c to calculate average cpu usage for <time> seconds (used with -d)
-r to run under realtime priority for more accuracy (needs privileges)
-s to sort LVEs in output (cpu, process, thread, mem, io)
-t to run in the top-mode
-h to print this brief help message
Command like lveps -p will display processes running inside 'active' LVEs.
CPU The number of seconds LVE/process/thread has been running (each CPU/core is counted
separately), or the average CPU load (100% is all CPU resources) if used with -d.
MEM The number of megabytes of resident memory in use by LVE/process/thread (shared memory is
not included).
IO The number of kilobytes read and written in sum by LVE, or kb/sec if used with -d.
ID LVE ID or username.
EP The number of entry processes inside LVE.
COM Command name for this process.
PID PID of the process.
PNO The number of processes belonging to the LVE.
TID TID of the thread.
TNO The number of threads belonging to the LVE.
DO The number of disk operations belonging to the LVE from the time it was created.
DT Total amount of disk transfer in megabytes from LVE creation time.
IOPS The number of I/O operations per second
2.2.3 lvetop
lvetop utility allows to monitor LVE usage:
ID EP PNO TNO SPEED MEM IO IPOS
testus 0 1 1 0% 7 0 0
er1
testus 0 0 0 5% 0 3 0
er2
testus 1 2 2 0% 102 2727 0
er3
testus 0 1 1 0% 12 84 1
er4
testus 0 2 2 1% 52 0 0
er5
lvetop fields:
2.2.4 cldetect
[lve-utils 1.2-10+]
cldetect is used to detect installed software, and adjust CloudLinux options accordingly.
cldetect -h
-h | --help show this message
--detect-cp prints control panel and its version
(CP
--detect-cp-full prints control panel, version and panel specific data
(CP
Sp
--detect-cp-nameonly prints control panel name (CP_NAME)
--get-admin-email prints control panel admin email
(CP
--cxs-installed check if CXS is installed. Returns 0 if installed,
1 o
--cpanel-suphp-enabled check if suPHP is enabled in cPanel.
Ret
--detect-litespeed check if LiteSpeed is installed. Returns 0 if installed,
1 o
--detect-postgresql check if PostGreSQL is installed. Returns 0 if installed, 1
--print-apache-gid prints current apache gid
--print-da-admin prints DirectAdmin admin user
--set-securelinks-gid changes /etc/sysctl.conf if apache gid != 48 (default)
--set-nagios changes /etc/sysctl.conf if nagios is installed
--cl-setup check if CloudLinux is installing.
Ret
--update-license updates license
--update-new-key updates license with new key
--check-license :check license. Returns OK if license is not older than
3 d
-q:check license. Returns 0 if license is not older than
3 d
--no-valid-license-screen Returns no valid license found screen.
--license-out-of-date-email Returns License out of Date Email.
--check-openvz Returns enviroment id.
CPU SPEED limit allows to set CPU limit in terms of % of a single core, or as a fixed number of Hz.
--speed=XXmhz would automatically detect CPU speed of each core, and adjust the CPU scheduler to
make sure user cannot go over that limit.
For example, on 1ghz CPU, setting of --speed=2ghz would mean 2 cores, while on 4ghz CPU same
setting would mean 1/2 of a core.
This should allow hosting companies to set same approximate performance level limits across different
hardware using single setting.
Note. We strongly recommend setting CPU speed limits not less than 100%. As such limits cause CPU
context switching which leads to increased %sys.
CPU Limits are set by CPU and NCPU parameters. CPU specifies the % of total CPU of the server
available to LVE. NCPU specifies the number of cores available to LVE. The smallest of the two is used
to define how much CPU power will be accessible to the customer. For example:
1 core,
Cores Per Server CPU Limit NCPU Limit Real limit
1 25% 1 25% of 1 core
2 25% 1 50% of 1 core
2 25% 2 50% of 1 core
4 25% 1 100% of 1 core (full
core)
4 25% 2 1 core
4 50% 1 1 core
4 50% 2 2 cores
8 25% 1 1 core
8 25% 2 2 cores
8 50% 2 2 cores
8 50% 3 3 cores
When user hits CPU limit, processes within that limit are slowed down. For example, if you set your
CPU limit to 10%, and processes inside LVE want to use more then 10% they will be throttled (put to
sleep) to make sure they don't use more then 10%. In reality, processes don't get CPU time above the
limit, and it happens much more often then 1 second interval, but the end result is that processes are
slowed down so that their usage is never above the CPU limit set.
Virtual memory limit corresponds to the amount of memory processes can allocate within LVE. You can
see individual process virtual memory usage by monitoring VIRT column in top output for the process.
When process tries to allocate more memory, CloudLinux checks if the new total virtual memory used
by all processes within LVE is more then a limit set. In such case CloudLinux will prevent memory from
being allocated and increments fVMEM counter. In most cases, but not all of them - this causes
process to fail. For CGI/PHP scripts it will usually cause 500 and 503 error.
Note. It is recommended to disable VMEM limits (set them to 0) in your system at all because they are
deprecated in CloudLinux 6 and 7 system and can cause unexpected issues.
Physical memory limit corresponds to the amount of memory actually used by end customer's
processes. You can see individual process physical memory usage by monitoring RES column in top
output for the process. Because similar processes (like PHP) share a lot of their memory, physical
memory usage is often much lower then virtual memory usage.
Additionally physical memory includes shared memory used by the customer, as well as disk cache.
In case of disk cache -- if user is starting to lack physical memory, the memory used for disk cache will
be freed up, without causing any memory faults.
When LVE goes over physical memory limit, CloudLinux will first free up memory used for disk cache,
and if that is not enough, it will kill some of the processes within that LVE, and increment fPMEM
counter. This will usually cause web server to serve 500 and 503 errors. Physical memory limit is a
much better way to limit memory for shared hosting.
Troubleshooting
Checking personal users disk cache (If lveinfo shows memory usage but there
are no processes there)
If you see no processes under some user, but lve manager keeps telling it is using some memory, then
most probably memory is taken by users disk cache. To check personal users disk cache (if lveinfo
shows memory usage but not processes there):
cat /proc/bc/XXX/meminfo
…
Cached: 67300 kB
…
2.6 IO Limits
IO limits restrict the data throughput for the customer. They are in KB/s. When limit is reached, the
processes are throttled (put to sleep). This makes sure that processes within LVE cannot go over the
limit,. Yet don't stop working, nor getting killed -- they just work slower when the limit is reached.
The IO limits will only affect DISK IO, and will have no effect on network. It also doesn't take into
consideration any disk cache accesses. So, even if file is loaded from disk cache 1000 times -- it will
not be counted towards IO limits.
The process enter's into LVE when there is a new HTTP request for CGI/PHP.
This limit was created to prevent DoS attacks against web server. One of the fairly popular attacks is to
tie up all the Apache connections by hitting some slow page on a server. Once all Apache slots are
used up, no one else will be able to connect to the web server, causing it to appear to be down. The
issue is worsened by CPU limits, as once site starts to get slow due to CPU limit -- it will respond to
requests slower and slower, causing more and more connections to be tied up.
To solve that, we have created entry processes (often called concurrent connections) limit. It will limit the
number of concurrent connections to Apache, causing web server to serve error 508 page (Resource
Limit Reached), once there number of concurrent requests for the site goes above the limit.
Network traffic bandwidth control and accounting systems in CloudLinux 6 allows for each LVE
container:
All outgoing IP packets generated inside LVE container and marked with LVE identifier. Traffic control
utility tc from iproute2 package uses this marker to set required bandwidth.
Note. CloudLinux doesn’t limit the network traffic itself, it only mark s IP pack ets with specific LVE id.
Example 1:
2. All packets marked with LVE id will be processed by class 1:1 (rate 10kbit).
Example 2:
1. As an example we create class with HTB qdiscs and rate 100mbit and class 1:10 will be used by
default:
2. For class 1:1 we create two branches with rate 5 mbit and 10 kbit accordingly, with classid 1:10 and
1:20.
tc class add dev eth3 parent 1:1 classid 1:10 htb rate 5mbit
tc class add dev eth3 parent 1:1 classid 1:20 htb rate 10kbit
3. All packets marked with LVE id=2121 are processed by 10 kbit class.
tc filter add dev eth3 protocol ip parent 1: prio 1 handle 2121 fw flowid 1:20
More info about tc and its syntax can be found on the link http://tldp.org/HOWTO/Traffic-Control-
HOWTO/index.html
Traffic accounting
Traffic accounting is performed for each LVE container. Network statistics is collected at /proc/lve/list
file. Network-related data found at fields:
Note. The current version of CloudLinux network control system doesn’t limit network traffic volume for a
specific period of time (for example 3GB per day), it limits only network bandwidth.
Note. Network limits are supported only for processes inside LVE. By default it does not limit static
content, but only PHP/cgi scripts processed by Apache and processes launched over ssh etc.
1. Requires patched version of MPM-ITK. CL httpd RPM has ITK worker with the patch. Patch is also
available at: http://repo.cloudlinux.com/cloudlinux/sources/da/cl-apache-patches.tar.gz
2. CloudLinux 7 and CloudLinux 6 kernels only.
3. The DirectAdmin and CloudLinux PHP provide patched version. For other PHP distributions, please,
use patches available here: http://repo.cloudlinux.com/cloudlinux/sources/da/cl-apache-patches.tar.gz
Installation:
# yum install pam_lve
After you install RPM, add following line to PAM config file for the required application:
session required pam_lve.so 500 1 wheel,other
In this line:
500 stands for minimum UID for which LVE will be setup. For any user with UID < 500, LVE will not be
setup. If CageFS is installed, use:
cagefsctl --set-min-uid UID to setup minimum UID. The parameter in PAM files will be ignored in
that case.
1 stands for CageFS enabled (0 -- cagefs disabled)
3rd optional argument defines group of users that will not be placed into LVE or CageFS. Starting with
pam_lve 0.3-7 you can specify multiple groups, coma separated
For example, to enable LVE for SSH access, add that line to /etc/pam.d/sshd. To enable LVE for SU,
add that line to /etc/pam.d/su
By default module will not place users with group wheel into lve. If you want to use different group to
define users that will not be placed into LVE by pam_lve - pass it as 3rd argument.
For preventing cases when user enters under usual user (using ssh) and then tries to enter as super
user (via sudo or su) - pam_sulve was created, which tries to enter to LVE=1 and leaves it right away. If
action fails, user gets message:
LVE Wrappers provide two tools for placing programs inside LVE: lve_wrapper and lve_suwrapper
/bin/lve_wrapper – can be used by any non-root user, as long as that user is in group lve (see /etc/
groups file).
Syntax:
lve_wrapper <command_to_run>
Example:
$ lve_wrapper make install
The program will be executed within LVE with ID matching user's id.
/bin/lve_suwrapper – can be used by root user or any user in group lve (see /etc/groupsfile) to execute
command within specified LVE
Syntax:
Example:
# lve_suwrapper 10000 /etc/init.d/postgresql start
When running MPM ITK, you should disable mod_hostinglimits. All the functionality needed by MPM ITK
is already built into the patch.
This can be overwritten via LVEId or LVEUser parameter on the Directory level. Note that those
parameters will not work with mod_fcgid and mod_cgid. The order of detection looks as follows:
LVEId
LVEUser
SuexecUserGroup
suPHP_UserGroup
RUidGid
AssignUserID
Note. LVE doesn't work for mod_include #include due to its "filter" nature.
Example:
LoadModule hostinglimits_module modules/mod_hostinglimits.so
<IfModule mod_hostinglimits.c>
AllowedHandlers cgi-script php5-script php4-script
SecureLinks On
</IfModule>
Additional notes
mod_hostinglimits (since version 1.0-22) supports min-uid - cagefsctl --set-min-uid=600. Min UID is
read on Apache start/restart and stored in the memory during apache runtime. If min UID has changed,
you should restart Apache for mod_hostinglimits applying new min UID value. Full min UID is
supported only with APR.
The following message should appear: [notice] mod_hostinglimits: found apr extention version 3. This
means that the correct APR is installed with mod_hostinglimits.
mod_hostinglimist has variable for Apache CustomLog format string - %{LVE_ID}y. How to use:
LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" req for lve %{LVE_ID}y"
combined
cPanel Installed by default during EasyApache build. Requires lve-stats & lve-utils packages to
be installed.
DirectAdmin Can be built using custombuild:
$ yum install liblve-devel
$ cd /usr/local/directadmin/custombuild
$ ./build update
$ ./build set cloudlinux yes
$ ./build apache
$ ./build rewrite_confs
if you run suphp, then run the following:
$ ./build suphp
Directives
SecureLinks
Description: Makes sure that for any virtual hosts, only files owned by user specified via
SuexecUserGroup or other ways as described above are served. For files owned by any
other user apache will return Access Denied error. The directive will not affect VirtualHost
without user id specified, or with uid < 100
Syntax: SecureLinks On
Default: SecureLinks Off
Prevents apache from serving files not owned by user, stopping symlink attacks against php config files.
Example:
SecureLinks On
SkipErrors
Example:
SkipErrors Off
AllowedHandlers
Description: List of handlers that should be placed into LVE, support regexp
Syntax: AllowedHandlers cgi-script %^php% my-script
Default: none
Context: server config
This directive allows to list handlers which will be intercepted and placed into LVE.
Example:
Description: List of handlers that should not be placed into LVE, support regexp
Syntax: DenyHandlers text/html
Default: none
Context: server config
This directive works together with AllowHandlers, to exclude some handlers from being allowed in LVE.
Example:
Default: 508
Context: directory config
Specifies ErrorCode to use on LVE error (like too many concurrent processes running). The message
that will be displayed by default is:
Resource Limit Is Reached
The website is temporarily unable to server your request as it exceeded resource limit.
Please try again later.
You can redefine error message using ErrorDocument directive
Example:
LVEErrorCode 508
ErrorDocument 508 508.html
LVEid
Description: Allows to setup separate LVE ID on per directory level. If not set, user ID of a
corresponding user is used.
Syntax: LVEId number
Default: User Id is used
Context: directory config
Example:
<Directory "/home/user1/domain.com/forums">
LVEId 10001
</Directory>
LVEUser
Example:
<Directory "/home/user1/domain.com/forums">
LVEUser user1
</Directory>
LVEUserGroupID
If the option enabled, group ID will be used instead of a user ID. Apache will display the following string
in error logs:
mod_hostinglimits: use GroupID instead of UID
mod_hostinglimits: found apr extension version 2
mod_hostinglimits: apr_lve_environment_init_group check ok
If a compatible apr library is not found, the following error message will be display in error logs.
<Directory "/home/user1/domain.com/forums">
LVEUserGroupID On
</Directory>
LVERetryAfter
Specifies interval for Retry-After header. The Retry-After response-header field can be used to indicate
how long the service is expected to be unavailable to the requesting client.
Example:
LVERetryAfter 180
LVESitesDebug
Example:
<Directory "/home/user1/domain.com/forums">
LVESitesDebug abc.com yx.cnet
</Directory>
LVEParseMode
In CONF mode, standard way to extract LVE ID is used (SuexecUserGroup, LVEId, or similar directives)
.
In PATH mode, username is extracted from the home directory path. The default way to match
username is via the following regexp: /home/([^/]*)/. Custom regexp can be specified in LVEPathRegexp.
Example:
LVEParseMode CONF
LVEPathRegexp
Description: Regexp used to extract username from the path. Used in conjuction with
LVEParseMode PATH
Syntax: LVEPathRegexp regexp
Default: /home/([^/]*)/
Context: directory config
Example:
LVEPathRegexp /home/([^/]*)/
LVELimitRecheckTimeout
Descriptio Timeout in milliseconds, a site will return EP without lve_enter for LA decreasing after this
n: time
Syntax: LVELimitRecheckTimeout number
Default: 0
Context: httpd.conf, virtualhost
Example:
LVELimitRecheckTimeout 1000
LVEUse429
Descript Use 429 error code as code returned on max entry limits (on/off).
ion:
Syntax: LVEUse429 on
Default: off
Context: httpd.conf, virtualhost
Example:
LVEUse429 on
Available for RPM based panels, EasyApache 4 and DirectAdmin.
2.12.4.1 Redis Support for HostingLimits
Redis support provides a way to query Redis database for LVE id, based on domain in the HTTP
request. Given a database like:
xyz.com 10001
bla.com 10002
....
The module will retrieve corresponding LVE id from the database.
LVERedisSocket
Example:
LVERedisSocket /var/run/redis.sock
LVERedisAddr
Example:
Number of seconds to wait before attempting to reconnect to Redis after the last unsuccessful attempt
to connect.
Example:
LVERedisTimeout 120
https:/IP:2087/cpsess_YOURTOKEN/cgi/CloudLinux.cgi?cgiaction=jsonhandler&handler=list
For commands like set, destroy & delete, where you need to specify LVE (user) ID, like
lveid=500 (matches user ID 500).
Example:
https://IP:2087/cpsess_YOURTOKEN/cgi/CloudLinux.cgi?
cgiaction=jsonhandler&handler=set&lveid=500&speed=30%&io=2048
https://IP:2087/cpsess_YOURTOKEN/cgi/CloudLinux.cgi?
cgiaction=jsonhandler&handler=set&lveid=500&speed=300Mhz&io=2048
https://IP:2087/cpsess_YOURTOKEN/cgi/CloudLinux.cgi?
cgiaction=jsonhandler&handler=set&lveid=500&speed=3Ghz&io=2048
[Note that speed limit can be specified in several units of measure - %, MHz, GHz. The figures will be
different according to the unit of measure.]
Output:
{"status":"OK"}
To do 'set default', use lveid=0, like:
https://IP:2087/cpsess_YOURTOKEN/cgi/CloudLinux.cgi?
cgiaction=jsonhandler&handler=set&lveid=0&speed=30%&io=2048
handler=apply-all
handler=destroy-all
You can use the following commands that allow to specify user name instead of user ID:
set-user Set parameters for a LVE and/or create a LVE using username instead of ID.
list-user List loaded LVEs, display username instead of user ID.
delete- Delete LVE and set configuration for that user to defaults.
user
If the limits for users are set with cPanel LVE Extension, then turnkey billing solutions can be applied
(e.g. WHMCS).
cPanel LVE Extension allows to control LVE limits for packages via cPanel hosting packages control
interface and via cPanel WHM API. It simplifies integration with existing billing systems for cPanel (like
WHMCS for example).
To add LVE Settings to standard cPanel package, go to Pack ages and choose Add a Pack age.
Note. You can find the information on how to add a pack age in official cPanel documentation on the
link :
https://documentation.cpanel.net/display/ALD/Add+a+Package
Tick LVE Settings checkbox in the bottom of the page to open LVE Settings form.
Note that your changes to LVE Settings will appear in the system after a little while.
You can edit limits in any convenient way for you - in Edit a Package section, in LVE Manager or even
To edit package extensions, choose Pack ages and click Edit a Pack age. Choose a package from the
Package list and click Edit.
LVE Manager
To edit package extensions in LVE Manager, in Server Configuration choose CloudLinux LVE Manager.
Open Pack ages tab and click pencil (edit) icon.
WHM API
To learn how to work with package extensions limits using WHM API, please read the official cPanel
documentation:
https://documentation.cpanel.net/display/SDK/Guide+to+Package+Extensions+-
+Data+Behavior+and+Changes
Note. LVE Package extension does not allow to control LVE limits for reseller packages. Even though
LVE limits for reseller packages are displayed in Edit Package menu and their values can be changed,
no changes will be applied (will be ignored).
3 LVE Manager
LVE Manager is a plugin for most popular control panels including cPanel, Plesk, DirectAdmin and
ISPmanager (InterWorx coming soon). It allows you to control and monitor limits, and set limits on per
package bases.
LVE Manager is installed by default on most servers. If it is missing you can always install it by running:
$ yum install lvemanager
Current usage tab - allows monitoring users resource usage at the moment;
Users tab with the list of all users allows viewing and managing all the users limits;
Statistics tab displays the statistics of resource usage for proper timeframe or proper users;
Options tab - allows setting LVE Faults email notifications for users;
Packages allows managing packages limits;
Selector tab.
Current usage
1. Choose Current usage tab to monitor users resource usage at the moment displayed in the table.
Current usage table provides the information on the usage of Speed, memory, IO, IOPS, Number of
Processes, and Entry Processes.
Resource usage values are being refreshed every 10 seconds which is set in Auto-refresh field. You can
refresh the table manually by clicking Refresh now or you can freeze the values by clicking pause
button. Usage values will not change until the next manual refresh.
Tick Hide MySQL usage checkbox to hide the information on MySQL usage.
To expand the list of users click on the number above and in the dropdown choose the number of user to
be displayed on the page.
Users
Choose Users tab to view the list of all users of the system and manage their limits.
Click Filter by to apply filters. The following filters available in the dropdown:
Username.
Domain.
LVE ID.
Actions column:
o SPEED
o PMEM
o VMEM
o EP
o IO
o IOPS
o NPROC
o INODES
Statistics
Options Tab
An administrator can set email notifications for users and resellers in cases of limits faults. Choose
Options tab to manage LVE Faults email notifications.
In LVE Faults email notifications section check proper checkboxes to set the required type of
notification:
In Faults to include section check proper checkboxes to include proper limits to the notifications:
In Minimum number of Faults to notify section enter proper number of faults required for the notification
to be sent for:
Me - for an administrator;
User - for a User;
Set the frequency of email notifications sending in Notify me every.. hours/days section.
Packages Tab
Packages tab allows setting the limits for as many users as you need by editing packages of proper
limits. Each account belonging to a proper package adheres to those limits.
To modify package limits click on a pencil icon in Action column in a proper package row. The following
limits for this package are available for setting:
When limits are set click Save to apply changes or Cancel to close the window.
Selector tab
In Selector is section choose Enabled or Disabled from dropdown list to enable or disable PHP Selector.
In Default PHP version choose a proper PHP version or Native from dropdown list to apply.
Choose default modules from the list for a proper PHP version or for native.
lve_hideexten Hides (when =1) range of php extensions for user in Select PHP version.
sions
lve_hideusers Hides (when =1) LVE statistics in cPanel Stats Bar (UI).
tat
lve_showinode Displays (when =1) used inodes in cPanel (UI).
usage
lve_hide_sele Turns off UI PHP Selector (Select PHP Version option).
ctor
Snapshots allow users to investigate the reason of account hitting its limits. Several snapshots are
generated for each incident. An incident is a state when faults are generated in a close time period. The
time period is configurable. By default, if faults are generated in 300 seconds time period, we consider
them as a single incident.
/etc/sysconfig/lvestats.config/SnapshotSaver.cfg
1. Go to cPanel interface, and select “CPU and Concurrent Connection Usage” in paper_latern theme:
3. Select a date:
NOTE: The list of processes in a snapshot is close but not similar to the real processes list when faults
were generated. It happens because of delay when the faults are happened and the snapshot is taken by
the system.
It is possible to apply branding to the LVE Plugins in cPanel end users’ interface. To brand the cPanel
end users' interface please do the following:
Create a script that will patch LVE Manager files (with branding data, for example, image and logo)
after every update of lvemanager rpm package;
For example, if you need to add the following message "Don`t use this php version" to PHP version 4.4,
you should create the following file:
/opt/alt/php44/name_modifier:
echo 'Don`t use this php version' > /opt/alt/php44/name_modifier
As a result LVE Manager will automatically pick up this message and will show it in web-interface to
administrator (Figure 1.1 for cPanel, Figure 1.2 for DirectAdmin) and to user (Figure 2.1 for cPanel,
Figure 2.2 for DirectAdmin). You can add messages to other PHP versions this way as well.
Figure 1.1
Figure 1.2
Figure 2.1
Figure 2.2
*For cPanel and DirectAdmin only.
4 Reseller Limits
Overview
Reseller limits is a feature that allows hosters to set limits for the resources each reseller can operate
with. Hoster also provides controls to the reseller on what resources each reseller’s end user will have.
Reseller limits set by a hoster limit the total amount of resources resellers’ end users can consume
altogether.
When a hoster has set reseller limits for the particular reseller he provides the reseller with an ability to
set limits for his end users within the Reseller Interface.
Types of Users
Starting from the version 3.0-18 LVE Manager operates with four types of users and their resource
usage limits.
End User is a type of user that purchases hosting directly from a hoster and uses it for his own
purposes;
Reseller is a type of user that buys hosting from a hoster and resells it to his end users;
Reseller’s End User is a type of user that purchases hosting from a reseller and uses it for his own
purposes.
Reseller’s End User (no Reseller limit) is a type of user that purchases hosting from a reseller and
uses it for his own purposes but does not have limits set by a reseller. These limits are set by the
hoster.
Types of Limits
See the comparison Table with types of limits.
Reseller limits he limits the group of resellers' end users including reseller's end user with the same
name as the reseller.
Reseller's end user can hit reseller limit when end user's limit is bigger than reseller's limit. In such
case end user will be limited by reseller limit.
Reseller limit can be hit when all resellers’ end users in total use as much resources as reseller limit.
Reseller's end user can hit his limit when end user limit is lower than reseller limit. In such case end
user will be limited by his limit.
Reseller Limits are only supported in kernel starting with the version 3.10.0-714.10.2.lve1.5.3.el7 for
CloudLinux 7 kernel and 3.10.0-714.10.2.lve1.5.3.el6h for CloudLinux 6 Hybrid kernel.
Please note, that if you are using CloudLinux 6 kernel you would have to migrate to CloudLinux 6 Hybrid
kernel first in order to be able to use new Reseller Limits functionality.
Installation
Use the detailed instruction below:
1. Install CloudLinux 7 or CloudLinux 6 Hybrid on a new server. Follow the instructions described here.
Or you can convert your CentOS 6.x or CentOS 7.x system to CloudLinux 6 or CloudLinux 7
respectively. To do this, follow the instructions described on the link.
2. If you have installed the CloudLinux 6, please convert it to the CloudLinux 6 Hybrid Kernel. Follow the
instructions described here.
3. Install LVE Manager with Reseller Limit support or update it up to version 3.0-18 (or later) by running
the following commands:
yum install kernel lve cagefs lvemanager lve-utils lve-stats --disableexcludes=main
yum update
reboot
For CloudLinux 6 Hybrid Kernel with Reseller Limit support, please run the following commands:
yum update
reboot
Note. If check box Make the account own itself (i.e., the user can modify the account) is not
selected when creating Reseller in cPanel WHM, then user account Reseller will belong to root, not to
reseller Reseller. In such case, the user Reseller will be managed by the root. So, LVE limits specified
by the root will be applied to the user Reseller. User Reseller will not be limited by Reseller limits.
When the check box is selected, user Reseller will be limited by Reseller limits (in addition to personal
user limits set by Reseller).
4. Give privileges to the proper Reseller account to make all features work.
5. Go to the Users tab and choose a particular reseller you want to enable Reseller limits for and click
on the pencil icon.
6. In the pop-up window move the slider Manage Limits. Click AGREE for the question Are you sure you
want to enable limits, set limits for that reseller if you you want them to be different from the default
limits, otherwise default server limits will be applied. Than click the Save button.
Please note, that resellers’ end users can use as much resources in total as it is provided for that
particular reseller by a hoster. The summary usage of all end users that belong to that particular reseller
will not exceed the amount of resources provided to reseller by a hoster. If no Reseller Limits are set,
reseller’s end user will be limited by default limits set by a hoster.
1. Go to the Users tab, choose a particular reseller and click on the pencil icon.
2. In the pop-up window move the slider Manage Limits. Click AGREE for the question Are you sure you
want to disable limits. Than click the Save button.
Please note, that if you disable Reseller limits everything will work the same as before. All the end user
limits set by the reseller will be saved. But all custom default reseller limits will be disabled.
Hoster credentials allow to control limits for hosters’ end users and resellers. To control reseller end user
limits Hoster has to log in as Reseller.
Current Usage tab allows to monitor users and resellers resource usage at the moment.
Users tab with the list of all users and resellers allows viewing and managing all the users and
resellers limits.
Statistics tab displays the statistics of resource usage for particular timeframe or particular user.
Options tab allows to set LVE faults email notifications for hoster, users, and resellers.
Packages tab allows to manage resellers packages limits;
Selector tab allows to control PHP Selector settings.
Current Usage table provides information on usage of SPEED (All and MySQL), memory (MEM), data
throughput (IO) (All and MySQL), read/write operations per second (IOPS), number of processes (PNO),
and entry processes (EP).
Resource usage values are being refreshed every 10 seconds by default which is set in Auto-refresh
field. You can set Auto-refresh time by choosing a value from the drop-down. You can refresh the table
manually by clicking Refresh now or you can freeze the values by clicking pause button. Usage values
will not change until the next manual refresh. To unfreeze click on unpause button. The countdown will
continue.
Tick Hide MySQL usage checkbox to hide the information on MySQL usage.
The list of users can be filtered by Username and Domain. Hoster can view all types of users: End
users, Resellers, Reseller’s end users, Reseller’s end users (no Reseller limit). But hoster can only
manage End users, Resellers, and Reseller’s end users (no Reseller limit). To manage Reseller’s end
users hoster should login as a reseller.
In the drop-down Show top you can choose the number of user to be displayed on the page.
To filter the list by user type click Manage and in the drop-down choose:
To filter the list by Username, Domain, LveID click Filter by and choose the value in the drop-down.
Note that a hoster can view the list of resellers’ end users and their limits, but can not manage resellers’
end users limits (if those are set by reseller).
A hoster can view the limits of all types of users and manage the limits for hosters’ end users and
resellers’ end users (only those with Reseller Limits disabled).
Tick Show users with CageFS enabled to show users with CageFS file system enabled.
Tick Show only ignored users to show users with ignored MySQL Governor.
Actions column
Click on a pencil icon in Actions column to edit limits for a particular user. The following actions are
available:
Enable/disable CageFS;
Reset - to reset limits to default values;
Apply Do not limit to set the limits to unlimited;
Setting the limits values:
o SPEED
o SPEED MYSQL
o VMEM
o PMEM
o IO
o MySQL IO
o IOPS
o EP
o NPROC
o INODES (hard and soft) (for end users and resellers’ end users (with no Reseller Limits), if a hoster
has enabled Initial quotas in cPanel settings).
Click on History icon to view the history of a particular user resource usage. Choose time frame to view
the history for a particular time period.
Click Show button and select columns from the drop-down to set which parameters should be displayed
in the table.
Click Manage to choose type of users to be displayed - End users, Resellers, Resellers’ end users or
Resellers’ end users (no Reseller limit) by ticking checkbox in the drop-down.
Click on a chart icon in View column to view the detailed resource usage history for a particular account.
Use timeframe drop-down to view the history for a particular period of time.
In LVE Faults Email Notifications section tick the required checkboxes to set a type of notification.
Notify Panel Administrator - notify hoster when his end users have exceeded minimum number of faults
set for particular limits.
Notify Reseller - notify reseller when his end users have exceeded minimum number of faults set for
particular limits.
Notify Customers - notify hosters’ end users when they have exceeded limits.
Notify Reseller's customers - notify resellers’ end users when they have exceeded limits.
In Faults to include section tick the checkboxes to include required limits to the notifications.
Set the frequency of email notifications sending in Notify …. every.. days/hours/minutes/seconds
section.
In Minimum number of Faults to notify section enter the number of faults required for the notification to
be sent for Panel Admin & Reseller and User.
In Inodes limits section you can reset inode limits to default values and tick Show end-user inode usage.
In User interface settings section tick the required checkboxes to apply user interface settings.
In MySQL Governor settings section you can customize MySQL Governor.
To modify package limits click on a pencil icon in Actions column in a particular package row. The
following limits for this package are available for setting:
When limits are set click Save to apply changes or Cancel to close the window.
In Selector is choose Enabled or Disabled from the drop-down to enable or disable PHP Selector.
In Default PHP version choose PHP version or Native from the drop-down to apply.
Choose default modules from the list for a particular version of PHP or for native.
Log in under a particular reseller credentials to have access to the following functionality:
Current Usage tab - allows to monitor resellers’ end users resource usage at the moment;
Historical Usage tab - allows to control resellers’ end users resource usage history;
Users tab with the list of all resellers’ end users allows to view and manage all the reseller’s end user
limits;
Statistics tab displays the statistics of resource usage for particular timeframe or particular reseller's
end user;
Options tab allows to set LVE Faults email notifications.
Packages tab allows to manage reseller’s end user packages limits.
Please note that reseller can manage all his end users via Reseller Interface. Reseller cannot manage
INODE or MYSQL limits, neither his own nor for his users.
Reseller cannot manage INODE or MYSQL limits. Neither his own, nor for his users.
The bottom line star in the table displays the total reseller resource usage. It means, that all the usage
of resellers’ end users and of his own is displayed as a summary for each parameter.
When reseller’s end user reaches the limits set by hoster for the reseller, this will be displayed on the
chart. Please note, that in this case reseller’s end user would not necessarily reaches his limits set by
the reseller. These faults are not displayed on the chart.
On the Historical Usage page the reseller is also able to see the list of Top 5 Reseller’s end users
(based on resource usage, for the same period as charts/overall usage). Click on a History icon in the
Actions column to view resource usage statistics for particular user.
Click on LVE Statistics link in the top of the Top 5 list to go to the Statistics page to view or manage the
rest of users.
You can filter the list by Username, Domain, LVE ID. Tick Show only ignored users checkbox to display
only users with MySQL Governor disabled.
Actions column
Click on a pencil icon in Actions column to edit limits for a particular user. The following actions are
available:
Statistics table can be filtered by Timeframe, Limit, Top LVEs, LVE approaching limit, Fault LVE.
Use Charts icon in the View column to view detailed resource usage charts for a particular period of time.
In LVE Faults email notifications section tick appropriate checkboxes to set the required type of
notification.
Notify me on users faults - notify reseller when his users have exceeded limits.
Notify Customers - notify resellers’ end users when they have exceeded limits.
Notify me when I hit my limits - notify reseller when overall resource usage limits are reached.
In Faults to include section tick checkboxes to include particular limits to email notifications.
In Minimum number of Faults to notify section enter the number of faults required for the notification to
be sent for reseller and customer. You can also set the reseller notification frequency.
Set the frequency of sending the reseller email notifications in Notify Reseller Every ... days/hours/
minutes/seconds section.
Click on a pencil icon in a package row to set the following limits for a package:
SPEED limit;
Physical memory (PMEM) (can be set as unlimited by setting 0);
I/O limits;
IOPS limits;
Concurrent connections (EP) limits.
5 LVE-Stats 2
Why is it needed?
Old LVE-statistics store averages as integer numbers, as % of CPU usage. If user used 100% of CPU
for 1 second within an hour, it is only 1-2% for a minute, and 0 for 5 minutes. Data in old LVE-
statistics is aggregated to 1-hour intervals. So, such peak load will not be recorded and we need to
store data with much higher precision.
100% CPU usage in old lve statistics means “all cores”. On 32 core servers usage is not visible for
most users (as they are limited to 1 core).
Old LVE-statistics does not provide a way to determine a cause of LVE faults, i.e. what processes are
running when user hits LVE limits.
Notifications in old LVE-statistics are not accurate because they are based on average values for
CPU, IO, IOPS.
Old LVE-statistics functionality is hard to extend.
5.1 Installation
Installation
SQLite database file is located in /var/lve/lvestats2.db, data from old lve-stats (ver. 0.x) are being
migrated automatically in the background. Migrating process can last 2-8 hours (during this time lags
are possible when admin is trying to check statistics, at the same time users will not be affected).
Migrating the latest 30 days, SQLite DB stable migration is provided.
Currently new lve-stats supports all databases available in CloudLinux (except PosgreSQL for CL5).
Downgrade
If you have any problems after update, downgrade lve-stats2 to the previous stable version by running:
yum downgrade lve-stats
and contact CloudLinux support at https://helpdesk.cloudlinux.com
Note. You may need to rename *.rpmsave files to original ones in order to restore settings for old lve-
stats (/etc/sysconfig/lvestats, /etc/sysconfig/cloudlinux-notify).
5.2 Configuration
Configuration
connect-string - connection string for PostGreSQL and MySQL database, has the following form:
connect_string = USER:PASSWORD@HOST[:PORT]/DATABASE
Default port is used for specific database, if port is not specified (typical port is 3306 for MySQL and
5432 for PostGreSQL). Connection string is not used for sqlite database.
server_id - sets the name of the server (at most 10 characters). This option is to use with centralized
database (PostGreSQL or MySQL). For use with sqlite database, value of this option should be
"localhost" (without quotes).
plugins – path to directory containing custom plugins for lve-stats (default path /usr/share/lve-stats/
plugins).
db_timeout - period of time to write data to database (in seconds); default value is 60 seconds.
timeout - timeout for custom plugins (seconds). If plugin execution does not finish within this period,
plugin is terminated. Default value is 5 seconds.
interval - duration of one cycle of lvestats-server (seconds). This should be less than total duration of
execution of all plugins. Default value is 5 seconds. Increasing this parameter makes precision of
statistics worse.
keep_history_days - period of time (in days) to keep history in database. Old data is removed from
database automatically. Default value is 60 days.
mode – sets compatibility output mode (compatibility with older lveinfo version). Value “v1” (without
quotes) enables compatibility with old version of lveinfo. “v2” value enables “extended” output mode, but
can break LVE plugins for control panels (statistics in LVE Manager, Resource Usage, etc). Support of
v2 mode will be added to LVE plugins in the recent future. When mode parameter is absent, later version
of lveinfo is implied.
period_between_incidents - Minimal interval of time between incidents (in seconds). If minimal interval
of time between LVE faults is greater than value specified, than new "incident" will begin and new
snapshots will be saved. Default value is 300 seconds.
snapshots_per_minute - Maximum number of snapshots saved per minute for specific LVE id (default
is 2).
max_snapshots_per_incident - Maximum number of snapshots saved for one "incident". Default is 10.
NOTIFY_INCLUDE_RESELLER_CUSTOMER – Y=notify all users, N=notify only hoster's users (whos reseller
is root), default = N;
NOTIFY_CPU – notify about CPU faults when customer hits 100% of his CPU limit (Y/N, default N);
NOTIFY_IO - notify about IO faults when customer hits 100% of his IO limit (Y/N, default N);
NOTIFY_IOPS - notify about IOPS faults when customer hits 100% of his IOPS limit (Y/N, default N);
If MySQL Server is not installed, then install it according to control panel documentation.
(CloudLinux 6)
(CloudLinux 7)
2. Database Setup
a.
CREATE DATABASE db_lvestats2;
creating server DB. Also, check Note below.
b.
CREATE USER 'lvestats2'@'localhost' IDENTIFIED BY 'lvestats2_passwd';
creating a user for LVE Stats 2 server to work under. Also, check Note below.
c.
GRANT ALL PRIVILEGES ON db_lvestats2.* TO 'lvestats2'@'localhost';
granting all the privileges for all DB tables to the user. Use the username and DB name from points a.
and b. above.
d.
FLUSH PRIVILEGES;
refreshing privileges information.
Note. DB name, username and their passwords above are given for an example - you can use any of
your choices. Using old DB from LVE Stats version 1 is also acceptable as LVE Stats2 uses different
tables and the old information will not be corrupted.
If you need to provide access to LVE Stats information utilities (lveinfo, lvechart, lve-read-snapshot) for
different users, then we recommend creating one more DB user with read-only privilege to guarantee
information security. It can be done by running the following commands in administrative utility:
a.
CREATE USER 'lvestats2_read'@'localhost' IDENTIFIED BY 'lvestats2_read_passwd';
creating a user (check Note above).
b.
GRANT SELECT ON db_lvestats2.* TO 'lvestats2_read'@'localhost';
granting read-only privilege to the user.
c.
FLUSH PRIVILEGES;
refreshing privileges information.
If LVE Stats2 server is set correctly (see information below), the information utilities will work under this
user.
If you need to provide access to information utilities to other users, then in order to guarantee information
security you should do the following:
а) Assign permission 600 to the main configuration file (/etc/sysconfig/lvestats2), so that it could be read
only by LVE Stats 2 server and by utilities that run under root.
These steps allow hiding main DB user username/password from other system users.
If there is no need in such access differentiation, then /etc/sysconfig/lvestats2 file access permission
should be 644, so that it could be read by all users and could be changed only by root.
! # $ & ' ( ) * + , / : ; = ? @
[ ]
%21 %23 %24 %26 %27 %28 %29 %2A %2B %2C %2F %3A %3B %3D %3F %40 %5B %
5D
After that сonnect_string will look as follows:
сonnect_string=lvestats2:%5BYou_P%40%24%24%5D%3A@localhost/db_lvestats2
For control panels use proper documentation for installation on the links: сPanel, Plesk.
(CloudLinux 6)
yum install postgresql-server postgresql
service postgresql initdb
service postgresql start
chkconfig postgresql on
(CloudLinux 7)
yum install postgresql-server postgresql
postgresql-setup initdb
systemctl start postgresql
systemctl enable postgresql
1.2. Setup.
1. In /var/lib/pgsql/data/pg_hba.conf config file change user authentication mode. Add the following lines
(place before all other authentication parameters):
# IPv4 local connections for lve-stats-2.x
host dblvestat all 127.0.0.1/32 password
# IPv6 local connections for lve-stats-2.x
host dblvestat all ::1/128 password
These lines enable user authentication by the password for IP4/IP6 connections. You can set other
modes if needed.
2. In utility run:
a.
CREATE DATABASE dblvestat;
creating server DB. Also, check Note below.
b.
CREATE USER lvestat WITH password 'passw';
creating a user for LVE Stats 2 server to work under. Also, check Note below.
c.
GRANT ALL privileges ON DATABASE dblvestat TO lvestat;
granting lvestat user all privileges for work with dblvestat DB.
Note. DB name, username and their passwords above are given for an example - you can use any of
your choices. Using old DB from LVE Stats version 1 is also acceptable as LVE Stats 2 uses different
tables and the old information will not be corrupted.
3. Lve-stats-2.x Setup
After making changes in configuration files, for DB primary initialization (creating tables, indexes, etc)
run:
/usr/sbin/lve-create-db
There is no need to create anything in the DB manually. When done, restart server by running:
service lvestats restart
If you need to provide access to LVE Stats information utilities (lveinfo, lve-read-snapshot) for other
users (or if CageFS is disabled), then in order to guarantee DB security the following steps are required:
\connect dblvestat;
GRANT SELECT ON lve_stats2_history, lve_stats2_history_gov, lve_stats2_history_x60,
lve_stats2_incident, lve_stats2_servers, lve_stats2_snapshot, lve_stats2_user TO
lvestat_read;
b. Assign root ownership and permission 600 to the main configuration file (/etc/sysconfig/lvestats2), so
that it could be read only by LVE Stats 2 server and by utilities that run under root.
These steps allow hiding main DB user username/password from other system users.
If there is no need in such access differentiation, then /etc/sysconfig/lvestats2 file access permission
should be 644, so that it could be read by all users and could be changed only by root.
! # $ & ' ( ) * + , / : ; = ? @
[ ]
%21 %23 %24 %26 %27 %28 %29 %2A %2B %2C %2F %3A %3B %3D %3F %40 %5B %
5D
After that сonnect_string will look as follows:
сonnect_string=lvestats2:%5BYou_P%40%24%24%5D%3A@localhost/db_lvestats2
The templates for notifications are located in /usr/share/lve/emails/LOCALE , where LOCALE - is the
directory with localization name (language codes are formed according to ISO 639-1 and ISO 639-2). By
default the templates for English are set: /usr/share/lve/emails/en_US .
The notification is formed as Multipart content type [RFC1341(MIME)]. The plain text is taken from the
.txt files, html version - from the .html template. In case when only one template is present (.txt or .html)
the notification is sent as a Non-multipart content type notification. It is better to use Multipart content
type notifications because when a mail client can not display an html-format message, then it will be
displayed as plain text version.
To localize notifications copy standard templates into directory with the proper locale name and translate
the template. Also you can customize the main template making proper changes into it.
TONAME “Customer” Notification receiver user name. Taken from profile in the
control panel, by default - “Customer” for user,
“Administrator” for administrator, “Reseller” for reseller.
TOMAIL “[email protected]” Notification receiver email address.
STATS ascii - table with the list of users that exceeded limits.
Available only for admins and resellers.
Sender’s email address by default is administrator email address from control panel settings (root@
{hostn_name} if there is no email in the control panel).
For example:
Default subject is “Hosting account resources exceeded”. It can be changed for each template (and for
localized templates as well). To change subject, in the very beginning of the file (no blank lines allowed
in the beginning of the template) add the field Subject: , leave two blank lines after it and add template
body.
Customized subjects can be taken only from the templates with the resolution *.txt (admin_notify.txt,
reseller_notify.txt, user_notify.txt). Changes apply without lvestats restart.
For backward compatibility the subject can be also changed with the key NOTIFY_FROM_SUBJECT in the
config /etc/sysconfig/lvestats.config/StatsNotifier.cfg
Dear {{TONAME}},
Your {{DOMAIN}} web hosting account exceeded one or more of its resources within the
last {{PERIOD}}.
{% if epf %}Exceeded the maximum of {{lep}} concurrent website connections. Your
website was not available {{epf}} times because of this problem.
{% endif %}{% if pmemf %}Exceeded the physical memory limit of {{lpmem}}KB. Your
website was not available {{pmemf}} times because of this problem.
{% endif %}{% if vmemf %}Exceeded the virtual memory limit of {{lvmem}}KB. Your
website was not available {{vmemf}} times because of this problem.
{% endif %}{% if nprocf %}Exceeded the number of processes limit of {{lnproc}}. Your
website was not available {{nprocf}} times because of this problem.
{% endif %}{% if cpuf %}You reached limit of {{lcpu}} of total server CPU usage
{{cpuf}} times. Your website was forced to load slower to reduce its CPU usage.
{% endif %}{% if iof %}You reached limit of {{lio}}KB/s disk io rate {{iof}} times.
The disk io speed for your account was slowed as a result of this problem.
{% endif %}{% if iopsf %}You reached limit of {{liops}} I/O operations {{iopsf}}
times. The disk io speed for your account was slowed as a result of this problem.
{% endif %}
To view full details about your web hosting account's resource usage, including the
time of each incident listed above, please click the link below and log into your
cpanel hosting control panel, then click the "Resource Usage" link under the "Logs and
Statistics" section.
http://{{DOMAIN}}:2083
5.3.1 lveinfo
[lve-stats-2.2-2]
Optional arguments:
total_nproc_faults NprocF total number of max processes faults (LVE version >=
6)
total_io_faults IOf total number of max io faults (LVE version >= 6)
iops_avg aIOPS average io operations (LVE version >= 8)
iops_max mIOPS max io operations (LVE version >= 8)
total_iops_faults IOPSf total number of max io operations faults (LVE version
>= 8)
any_faults anyF total number of faults of all types
-b ALIAS [ALIAS
...] show LVEs with usage (averaged) within 90 percent of the limit
--by-usage ALIAS available values:
[ALIAS ...]
ALIAS ALIAS ALIAS DESCRIPTION
cpu_avg cpu aCPU average CPU usage
cpu_max cpu_max mCPU max CPU usage
vmem_avg vmem aVMem average virtual memory usage
vmem_max vmem_ma mVMem max virtual memory usage
x
mep_avg mep aEP average number of entry processes (concurrent
connections)
mep_max mep_max mEP max number of entry processes (concurrent
connections)
pmem_avg pmem aPMem average physical memory usage (LVE version >= 6)
pmem_max pmem_ma mPMem max physical memory usage (LVE version >= 6)
x
nproc_avg nproc aNproc average number of processes (LVE version >= 6)
nproc_max nproc_m mNproc max number of processes (LVE version >= 6)
ax
io_avg io aIO average io usage (LVE version >= 6)
io_max io_max mIO max io usage (LVE version >= 6)
iops_avg iops aIOPS average io operations (LVE version >= 8)
iops_max iops_ma mIOPS max io operations (LVE version >= 8)
x
-p 0..100, -- defines percentage for --by-usage option; default 90
percentage 0..100
--style {user,admin}deprecated, not used.
-l LIMIT, --limit max number of results to display, 10 by default, if 0 no limit
LIMIT
-c [PATH], --csv save statistics in CSV format; "-" by default (output to screen)
[PATH]
-j, --json display output in JSON format
--server_id used with central database for multiple servers, default
SERVER_ID "localhost"
--servers-info Show servers LVE versions"
--show-all full output (show all limits); brief output is default;
equivalent --show-columns all
-show-columns
COLUMN_NAME show only the listed columns; "all" for all supported columns
[COLUMN_NAME ...]
COLUMN_NAME DESCRIPTION
From Show start period statistics
To Show end period statistics
ID LVE Id or username
aCPU Average CPU usage
uCPU The percentage of user-allocated resource CPU
mCPU deprecated
lCPU CPU Limit
CPUf Out Of CPU usage Faults
aEP Average Entry Processes
5.3.2 lvechart
/usr/sbin/lvechart - creates a chart representing LVE usage for user.
5.3.3 dbgovchart
/usr/sbin/dbgovchart - creates a chart representing MySQL usage for user.
--from= Run report from date and time in YYYY-MM-DD HH:MM format (if not present,
last 10 minutes are assumed)
--to= Run report up to date and time in YYYY-MM-DD HH:MM format (if not present,
reports results up to now)
--period= Time period:
specify minutes with m, h - hours, days with d, and values: today,
yesterday; 5m - last 5 minutes, 4h - last four hours, 2d - last 2 days, as
well as today
--user= mysql username
-- Filename to save chart as, if not present, output will be sent to STDOUT
output=
--show- Show all graphs (by default shows graphs for which limits are set)
all
--server= Server id -- will display record for that server, instead of default
(current).
--style= {admin|user} Set chart style, CPU limits are normalized to 100% in user’s
style
--format= {svg|png} Set chart output format.
5.3.4 lve-read-snapshot
usage: lve-read-snapshot [-h] [--version] [-f FROM [FROM ...]] [-t TO [TO ...]
| -p PERIOD | --timestamp TIMESTAMP]
[-i ID | -u USER] [-l] [-o file] [-j] [--stats]
[--unit unit]
optional arguments:
-h, --help show this help message and exit
--version Version number
-f FROM [FROM ...], --from FROM [FROM ...]
Run report from date and time in YYYY-MM-DD HH:MM
format, if not present last 10 minutes are assumed
(default: 2016-10-24 19:28)
-t TO [TO ...], --to TO [TO ...]
Run report up to date and time in YYYY-MM-DD HH:MM
format, if not present, reports results up to now
(default: 2016-10-24 19:38)
-p PERIOD, --period PERIOD
Time period specify minutes with m, h - hours, days
with d, and values: today, yesterday, 5m - last 5
minutes, 4h - last four hours, 2d - last 2 days, as
well as today (default: 10m)
--timestamp TIMESTAMP
time stamp in unix format for get one snapshot
(default: None)
-i ID, --id ID LVE id to show records for (default: None)
-u USER, --user USER user account to show records for (default: None)
-l, --list show timestamp list only (default: False)
-o file, --output file
Filename to save snaphots report to, if not present,
output will be sent to STDOUT (default: None)
-j, --json Output in json format (default: False)
--unit unit Group stats by time unit. Example values 3h, 24h, 1d,
1w.Other possible value is "auto" for grouping by each
incident. (default: 1d)
One of -u --user or -i --id should be specified
5.3.5 lve-create-db
usage: lve-create-db [-h] [--recreate] [--print-sql]
[--update-serverid-prompt] [--update-serverid-auto]
[--validate]
optional arguments:
-h, --help show this help message and exit
--recreate Drops and recreates database even if tables exists
(default: False)
--print-sql Prints sql and exits, without creating db (default:
False)
--update-serverid-prompt
Update exist server ID or create new one (default:
False)
--update-serverid-auto
Update exist server ID with uuid (default: False)
--validate Check the correctness of the database structure
(default: False)
5.3.6 cloudlinux-top
Usage
Output format
Units of measurement
Errors handling
Examples
Utility provides information about current MySQL and LVE usage of a running system in JSON format.
Usage
cloudlinux_top [-h] [-v] [-j] [--hide-mysql]
[-u USERNAME | -r FOR_RESELLER] [-d DOMAIN] [-m MAX]
[-o ORDER_BY]
Optional arguments.
Output format
{
"mySqlGov": "enabled", # possible values: enabled, error
{
"cpu": {
"all": 50.0, # CPU usage or limit (LVE only)
"mysql": 0.0* # CPU usage or limit (MySQL Governor only)
},
"ep": 1.0, # number of entry processes
"io": {
"all": 0.0, # IO usage or limit (LVE only)
"mysql": 0.0** # IO usage or limit (MySQL Governor only)
},
"iops": 0.0, # IO operations per second
"mem": 258048, # memory usage or limit
"pno": 1.0 # number of processes
}
* you can modify this structure using --show option, see usage examples for details.
** mysql values are only present when MySQL Governor statistics is available and --hide-mysql
options is not used.
Units of measurement
For limits and usage sections we use the following units of measurement.
Errors handling
The format of the error message is the same as in the other cloudlinux- * utilities. When everything is ok,
the result value is success. Otherwise, it contains error message. In case of unexpected errors, the
output will be as follows.
# cloudlinux-top --json
{
"context": {
"error_text": "Very bad error"
},
"result": "An error occured: \"%(error_text)s\"",
"timestamp": 1523871939.639394
}
Examples
5.3.7 cloudlinux-statistics
Usage
Output format
Units of measurement
Errors handling
Examples
cloudlinux-statistics is a CLI utility that provides historical information about resource usage.
Usage
cloudlinux-statistics [-h] [-j] [-v] [--by-usage BY_USAGE]
[--percentage 0..100] [--by-fault BY_FAULT]
[--threshold THRESHOLD] [--server_id SERVER_ID]
[-f FROM] [-t TO] [--period PERIOD]
[--limit LIMIT]
[--show COLUMN_NAME [COLUMN_NAME ...]]
[-o ORDER_BY] [--id ID] [--time-unit TIME_UNIT]
[-r FOR_RESELLER]
Optional arguments.
lts
pmem_faul total number of out of physical memory faults
ts
vmem_faul total number of out of virtual memory faults
ts
-r FOR_RESELLER, --for- show statistics only for given reseller and his users
reseller FOR_RESELLER
--by-usage BY_USAGE show LVEs with usage (averaged) within 90 percent of the
limit available values
FIELD DESCRIPTION
cpu average CPU usage
mysql_cpu average MySQL CPU usage
io average IO usage
mysql_io average MySQL IO usage
iops average IO operations; (LVE version >= 8)
ep average number of entry processes (concurrent
connections)
nproc average number of processes
pmem average physical memory usage
vmem average virtual memory usage
-percentage 0..100 define percentage for --by-usage option; default 90
--by-fault BY_FAULT show only accounts that have some faults for the given
limit
FIELD DESCRIPTION
any faults of all types
cpu CPU usage faults
io max IO usage faults
iops max IO operations faults; (LVE version >= 8)
ep max entry processes faults
nproc max processes faults
pmem out of physical memory faults
vmem out of virtual memory faults
--threshold THRESHOLD in combination with --by-fault, shows only accounts with
the number of faults more than given; default 1
Allows to get information for the given period of time; you can either set --from and --to options, or
just get information for the recent time period using --period option.
--from and --to values are ignored when --period is set.
-f FROM, --from FROM run report from date and time in [YY]YY-MM-DD[ HH:MM]
format; if not present, last 10 minutes are assumed
-t TO, --to TO run report up to date and time in [YY]YY-MM-DD[ HH:MM]
format; if not present, reports results up to now
--period PERIOD time period; specify minutes with m, hours with h, days
with d, and values: today, yesterday; 5m - last 5 minutes,
4h - last four hours, 2d - last 2 days, and today
--id ID get detailed statistics for database record with the given
id
--time-unit TIME_UNIT group statistics using the given time; 1 minute by default.
For example: 1h or 1h30m or dynamic; available only in pair
with --id
Output format
There are two different JSON formats used for summary statistics and detailed statistics.
Summary statistics
# cloudlinux-statistics --json
{
"resellers": [
{
"usage": <lve_section>,
"faults": <lve_section>,
"name": "reseller",
"limits": <lve_section>,
"id": 1000020005
}
],
"timestamp": 1522920637,
"mySqlGov": "enabled", # possible values: ”enabled”, “error”
"result": "success",
"users": [
{
"username": "username",
"domain": "example.com",
"reseller": "reseller",
"limits": <lve_section>,
"faults": <lve_section>,
"usage": <lve_section>,
"id": 20005
}
]
}
Detailed statistics
For both, summary statistics and detailed statistics, <lve_section> is the same and looks like
following*.
{
"ep": {
"lve": 1 # number of entry processes
},
"vmem": {
"lve": 2428928 # virtual memory usage or limit (deprecated)
},
"iops": {
"lve": 0 # io operations per second
},
"io": {
"lve": 0.0, # io usage or limit (lve only)
"mysql": 0.0** # io usage or limit (mysql only)
},
"nproc": {
"lve": 1 # number of processes in lve
},
"cpu": {
"lve": 25.6, # cpu usage (lve only)
"mysql": 0.0* # cpu usage (mysql governor only)
},
"pmem": {
"lve": 360448 # physical memory usage or limit
}
}
Units of measurement
For limits and usage sections we use the following units of measurement.
Errors handling
The format of the error message is the same as in the other cloudlinux- * utilities. When everything is ok,
the result value is success. Otherwise, it contains error message.
# cloudlinux-statistics --json
{
"context": {
"error_text": "Very bad error"
},
"result": "An error occured: \"%(error_text)s\"",
"timestamp": 1523871939.639394
}
Examples
get users that hit IO limit more than 10 times for today
get users that used more than 80% of CPU in last 24 hours
5.4 Plugins
LVE Stats 2z comes with a set of generic plugins:
ln -s /usr/share/lve-stats/plugins.other/res_mem_collector.py /usr/share/lve-stats/
plugins/
service lvestats restart
Plugin Configuration
Types of Plugins
5.5.1 Introduction
LVE Stats 2 complex has scalable architecture, which allows to connect custom plugins.
General Information
LVE Stats server searches for plugins in the directory which is specified with plugins parameter of
server’s /etc/sysconfig/lvestats2 configuration file. Default directory is /usr/share/lve-stats/plugins.
Each plugin must be of a Python class, must be written in Python language and its file must have .py
extension. Files with all other extensions will be ignored. For normal server work access permission 400
is enough; owner – root.
Plugins' classes can be of the same name, but better not, because classes' names can affect the set of
parameters in set_config method. You can find detailed plugins' configuring information below, in
appropriate chapter.
Plugin's class must contain execute() method, which is invoked by the server every 5 seconds (by
default, can be changed by interval parameter of configuration file).
Also set_config method (configuration settings) can be available. You can find more info in Plugins
Configuration chapter.
Additionally the following attributes can be set (plugin class instance variable):
order (integer) - defines plugin's position in the server's plugin list, (more info in Servers Plugin
Arrangement).
timeout (integer or float) – the longest allowable duration of one launch of the plugin (execute method)
. Default value of timeout parameter is 5 seconds.
period (integer) – sets the interval between two launches of execute plugin method in seconds. If not
defined, then plugin runs every 5 seconds (interval parameter in configuration file).
When execute() method of the plugin is invoked, the server creates an attribute now in it, where launch
time is recorded. This value is equal to what a standard Python function time.time() returns. All the
plugins launched one after another receive the same value of now attribute from the server. now is
overwritten before execute() method is invoked.
The previous value of now attribute is not saved by the server. If plugin needs it, it has to save it by itself.
Plugin's class can be inherited from LveStatsPlugin class, which is the part of the server itself. This is
not obligatory, but inheritance can help to avoid different errors in servers work, particularly if a plugin
doesn't contain required execute method.
When the server invokes execute() method of any plugin, it transmits a data dictionary (lve_data
argument) into plugin. The dictionary is common for all the plugins. Any plugin can read, write and
change any data in this dictionary. LVE Stats 2 server doesn't control this area. That is why one must
be careful while developing new plugins, in order not to change or corrupt other plugins' data which can
break their functionality.
If an exception occurs in execute() method, its text and python stack trace is recorded into server log /
var/log/lve-stats and all the changes made to lve_data dictionary before the exception happened are lost.
The keys of the lve_data dictionary are recommended to look like “PluginName_Key”, in order the
plugins do not corrupt other data accidentally.
Server contains some standard plugins which define and use the following keys in the common
dictionary lve_data: LVE_VERSION, stats, old_stats, procs and lve_usage. User plugins can use data
from these keys, but it is recommended not to change them if there is no special need, because it can
break the next plugins in the execution queue.
Key Content
LVE_VERSION LVE version. The same as console command lvectl lve-version produces .
stats Dictionary, that contains lve id’s as keys and LVEStat class objects as values. Every
LVEStat object contains values of usages and limits taken from /proc/lve/list file for
every LVE Id. Dictionary keys – integer lve id, including 0 for “default” LVE. This dictionary
is updated on each iteration of lvestats-server (every 5 seconds by default).
LVEStat – is a standard server class, it can be imported with the command from
lvestats.core.lvestat import LVEStat .
The class is described in the file /opt/alt/python27/lib/python2.7/site-packages/lvestats/
core/lvestat.py.
Here you can find the whole list of data fields and their functions.
old_stats stats content from the previous iteration. Before the first iteration – empty dictionary.
totalHz When LVE_VERSION is 4, real CPU frequency in Hz multiplied by number of cores.
When LVE_VERSION > 4, CPU speed is in conventional units and equals to 1000000000
* cores (1 GHz per core).
procs Quantity of CPU/cores.
lve_usages Contains accumulated LVE statistics for each 5-seconds interval in current minute.
Cleared each minute.
lve_usage Contains aggregated LVE Statistics for “previous” minute to store to database. Overwritten
each minute.
Each plugin’s instance lifetime is from the moment it was loaded till the server stops working. But if
execute() method working time exceeds timeout, the plugin will be terminated and restarted in the next
iteration. All changes to the lve_data dictionary will be lost.
During servers graceful shutdown (restart, server shutdown, commands service lvestats stop ,
service lvestats restart ), each plugin receives SIGTERM signal.
This is useful to correctly unload the plugin (terminate all subsidiary processes, save data to files etc.). If
a plugin doesn't need to “finalize” its execution before termination, then there's no need to implement this
signal handler. Below you can see an example of such handler.
Note: If a plugin implements handler for SIGTERM, then this handler must end with sys.exit(0)
command. Otherwise plugin process will not be terminated correctly and will become orphaned.
On initialization stage the server invokes set_config() method of the plugin and locates there a dictionary
which contains:
Note. An individual configuration file of every plugin is loaded after server configuration file. That is why if
it contains any parameters with names similar to ones of server config, then plugin will use parameters
from its individual config rather than server config parameters.
If a plugin doesn't require any configuration to be done, then set_config method can be sk ipped.
collectors
analyzers
persistors
notifiers
Collectors are designed to collect information; analyzers – to analyze it and form some other data on its
basis; persistors – to save information from the common dictionary into files, databases, etc.; notifiers -
to notify system users about any events.
This division is rather arbitrary. There is an opportunity to execute all the actions on collection, analysis
and saving the information in one and only plugin. But at the same time the division into functionally
independent parts allows to build flexible and easily configurable system for collecting and processing
the data.
Also it is possible to implement the systems of lazy-write, planning of collecting/processing tasks and
notifying users about different events.
Specification:
1. To trace specified file size changes. The name of file being traced must be specified in configuration
file, which allows to change it without modifying the plugin itself. If file size has been changed, it has to
be written as a message into our log. The name of log must be specified in configuration file as well.
2. File size must be checked with default interval (5 seconds), and log notification must be held once a
minute (to avoid resource expend for possibly regular write).
3. System administrator must receive emails with file size at the moment the email was sent. These
notifications must be sent even if the file size hasn’t been changed. Notification emails must be read
periodicity from configuration file as well as sender/receiver emails .
As file size check, fixing the result and notification sending must be held with different periods, then it’s
impossible to realize all the tasks by means of one plugin.
The fact that one minute (60 seconds) is multiple to 5 seconds doesn’t matter in this case, because
default period can be changed in server’s configuration file, but the condition of fixing the result once a
minute is a part of the specification, which can not be violated. In addition, notification email period is
known in advance, as it is specified by user in configuration file.
5.5.5.1 Collector
import os
from lvestats.core.plugin import LveStatsPlugin
# Key name
COLLECTOR_KEY = 'FSizeWatcher_fsize'
COLLECTOR_KEY_FILENAME = 'FSizeWatcher_fname'
def __init__(self):
pass
# Work method
def execute(self, lve_data):
try:
# if monitoring file absent, do nothing
if self.file_to_monitoring is None or not os.path.exists
(self.file_to_monitoring):
return
order attribute is specified as 0 to make this plugin go the first among three. Data collector must always
be the first in plugins logical chain, because it provides all the necessary information for the analyzer
which goes the next. Specific values of яorder can be of any kind, but what is important is that when the
server starts, all the plugins line up in proper sequence: collector – analyzer – persistor.
#file_to_monitoring = /usr/local/cpanel/logs/error_log
file_to_monitoring = /usr/local/cpanel/logs/access_log
Note that file’s name FSize_watcher_collector without .cfg extension matches plugin class name.
file_to_monitoring option is read by plugin in set_config method and contains file’s full name for
monitoring.
Files for monitoring, suggested in the actual example - /usr/local/cpanel/logs/error_log and /usr/local/
cpanel/logs/access_log - are real, these are cPanel control panel logs.
The first file is errors log; the second is appeal log, is refreshed during common work with panel (e.g. if
user email address is changed).
Errors log tracking is more important, but appeal log monitoring allows to illustrate plugins work more in
details, because it is refreshed more often.
Analyzer decides if the file's size has changed and gives a command to persistor to refresh log.
# FSize_watcher_analyzer.py
# Example plugin for monitoring file size.
# Part 2. Analyzer
def __init__(self):
pass
# work method
def execute(self, lve_data):
# Default setting for saver
lve_data[SAVER_DATA_PRESENCE] = 0
# Check presence data
if COLLECTOR_KEY not in lve_data:
return
If file size is not found in data dictionary, then plugin just ends.
Analyzer is unconfigurable, that is why it doesn’t require any configuration file and it doesn’t contain
set_config method.
Plugin starts every 60 seconds (1 minute), because we need data fixation to be performed one time in a
minute.
5.5.5.3 Persistor
Persistor saves information from the common dictionary into files, databases, etc.
# FSize_watcher_saver.py
# Example plugin for monitoring file size and last modification date-time.
# Part 3. Data saver
import signal
import sys
import time
from lvestats.core.plugin import LveStatsPlugin
def __init__(self):
signal.signal(signal.SIGTERM, self.sigterm_handler)
# work method
def execute(self, lve_data):
# do nothing, if log file not defined
if not self.log_file_name:
return
try:
# Check presence data
if SAVER_DATA_PRESENCE not in lve_data or lve_data
[SAVER_DATA_PRESENCE] == 0:
# No data
return
# Get file size from server data dictionary
fsize = lve_data[SAVER_KEY]
# Terminate handler
def sigterm_handler(self, signum, frame):
if self.log_file_name:
try:
# Store data to log file
f = open(self.log_file_name, 'a')
f.write('%s - File watcher saver plugin: TERMINATE\n' %
time.asctime(time.localtime()))
f.close()
pass
except:
# Ignore all errors
pass
# Terminate process
sys.exit(0)
Configuration file /etc/sysconfig/lvestats.config/FSize_watcher_saver.cfg:
# Config file for FSize_watcher_saver.py plugin
# Please define log filename here
log_filename = /var/log/FSize_watcher.log
This plugin starts after analyzer (order=2), checks new file size presence flag, and if positive – writes it
into log. If the flag is cleared (which means the size hasn't changed), then plugin simply ends.
Pay attention on sys.exit(0) command in the end of the handler. Find the information on it in Server
Plugin Arrangement section.
In addition see into examples of file log /var/log/FSize_watcher.log formed by the plugins above:
Tue Feb 3 13:06:24 2015 - FSize_watcher started. Monitoring file: /usr/local/cpanel/logs/access_log,
saving data period=60 sec
Tue Feb 3 13:06:24 2015 - FSize_watcher: file size is 122972890 bytes
Tue Feb 3 13:07:25 2015 - FSize_watcher: file size is 122975507 bytes
Tue Feb 3 13:08:25 2015 - FSize_watcher: file size is 122978124 bytes
Tue Feb 3 13:09:25 2015 - FSize_watcher: file size is 122978997 bytes
Tue Feb 3 13:10:25 2015 - FSize_watcher: file size is 122981033 bytes
Also we can notice that handler SIG_TERM was executed, signaling that plugin received the notification
about server shut-down.
5.5.5.4 Notifier
import time
import smtplib
# Key name
COLLECTOR_KEY_FSIZE = 'FSizeWatcher_fsize'
COLLECTOR_KEY_FILENAME = 'FSizeWatcher_fname'
"""
# work method
def execute(self, lve_data):
if COLLECTOR_KEY_FSIZE not in lve_data or COLLECTOR_KEY_FILENAME not in
lve_data:
return
if not self.email_from or not self.email_to:
f = open(self.log_file_name, 'a')
f.write('%s - FSize_watcher_notifier plugin error: email_from or
email_to not set\n')
f.close()
return
try:
s = smtplib.SMTP('localhost')
s.sendmail(self.email_from, [self.email_to], msg.as_string())
s.quit()
f = open(self.log_file_name, 'a')
f.write('%s - FSize_watcher_notifier plugin: email message was
successfully sent\n' % time.asctime(time.localtime()))
f.close()
except Exception as e:
f = open(self.log_file_name, 'a')
f.write('%s - FSize_watcher_notifier plugin error:\n%s\n' %
(time.asctime(time.localtime()), str(e)))
f.close()
Configuration file /etc/sysconfig/lvestats.config/FSize_watcher_notifier.cfg:
# Config file for FSize_watcher_notifier.py plugin
# Please define email options here
NOTIFY_FROM_EMAIL=user@hostname
NOTIFY_FROM_SUBJECT=Message from FSize_watcher_notifier
NOTIFY_TO_EMAIL=admin@hostname
NOTIFY_PERIOD=12h
Plugin’s index number equals 3 (order=3), that is why notifier starts after the rest. But since it uses only
data formed by collector, then its order may equal any number bigger that collectors order (>0).
Notifier reads the necessary parameters from the configuration (email address, topic, period) and writes
them into its own log as reference.
Plugin’s execute method checks the availability of all the necessary data (email parameters, collectors
data) and sends the message. All the notifications are written into the notifier's own log.
Log example:
Thu Feb 5 11:51:34 2015 - FSize_watcher_notifier plugin: configure
- Period: 60.0
- From: user@hostname
- To: admin@hostname
- Subject: 'Message from FSize_watcher_notifier'
Thu Feb 5 11:51:35 2015 - FSize_watcher_notifier plugin: email message was successfully sent
Thu Feb 5 11:52:35 2015 - FSize_watcher_notifier plugin: email message was successfully sent
Thu Feb 5 11:53:35 2015 - FSize_watcher_notifier plugin: email message was successfully sent
Thu Feb 5 11:54:35 2015 - FSize_watcher_notifier plugin: email message was successfully sent
Thu Feb 5 11:57:00 2015 - FSize_watcher_notifier plugin: configure
- Period: 43200.0
- From: user@hostname
- To: admin@hostname
When writing to this file we make sure that: average CPU/IOPS/MEM is never more then LIMIT for that
resource.
Example:
0,0,20,0,2500,0,262144,0,0,262144,0,0,100,0,0,0,0,1024,1024,0,0,0,0
600,1,20,2492,2500,70,262144,0,0,262144,33,0,100,1,0,0,0,1024,1024,0,5,0,0
200,0,20,0,2500,0,262144,0,0,262144,0,0,100,0,0,0,0,1024,1024,0,0,0,0
500,0,20,0,2500,0,262144,0,0,262144,0,0,100,0,0,0,0,1024,1024,0,0,0,0
First line of the file is 'default limits'.
Fields:
# 0 - id
# 1 - mep (average entry processes)
# 2 - lep (limit ...)
# 3 - cpu_usage (average speed)
# 4 - lcpu (limit spped)
# 5 - mem_usage (average virtual memory)
# 6 - lmem (limit ...)
# 7 - mem_fault (number of virtual memory faults)
# 8 - mep_fault (number of entry processes faults)
LVE_VERSION >=6
# 9 - lmemphy (limit physical memory)
# 10 - memphy (average ...)
# 11 - memphy_fault (faults ...)
# 12 - lnproc (limit number of processes)
# 13 - nproc (average ...)
# 14 - nproc_fault (faults ...)
# 15 - lcpuw (CPU weight -- deprecated not used)
# 16 - io_usage (average IO usage)
# 17 - io_limit (limit ...)
LVE_VERSION >=8
#18 - liops (limit IOPS)
#19 - iops (average IOPS)
5.7 Troubleshooting
Troubleshooting
There is /var/log/lve-stats.log file with additional information (warnings, tracebacks for errors)
6 CageFS
CageFS is a virtualized file system and a set of tools to contain each user in its own 'cage'. Each
customer will have its own fully functional CageFS, with all the system files, tools, etc.
At the same time, user's environment will be fully functional, and user should not feel in any way
restricted. No adjustments to user's scripts are needed. CageFS will cage any scripts execution done
via:
Apache (suexec, suPHP, mod_fcgid, mod_fastcgi)
LiteSpeed Web Server
Cron Jobs
SSH
Any other PAM enabled service
6.1 Installation
Minimum Requirements:
k ernel: CL5 with lve0.8.54 or later, CL6 with lve1.2.17.1 or later, CL7.
7GB of disk space.
Depending on your setup, and number of users, you might also need:
Up to 8MB per customer in /var directory (to store custom /etc directory)
5GB to 20GB in /usr/share directory (to store safe sk eleton of a filesystem)
Warning: If at any time you decide to uninstall CageFS, please, make sure you follow uninstall
instructions
To install CageFS:
That last command will create skeleton directory that might be around 7GB in size. If you don't have
enough disk space in /usr/share, use following commands to have cagefs-skeleton being placed in a
different location:
$ mkdir /home/cagefs-skeleton
$ ln -s /home/cagefs-skeleton /usr/share/cagefs-skeleton
On cPanel servers, if you will be placing skeleton into /home directory, you must configure the following
option in:
cPanel WHM -> Server Configuration -> Basic cPanel/WHM Setup -> Basic Config -> Additional home
directories
Change the value to blank (not default "home")
Without changing this option, cPanel will create new accounts in incorrect places.
CageFS will automatically detect and configure all necessary files for:
cPanel
Plesk
DirectAdmin
ISPmanager
Interworx
MySQL
PostgreSQL
LiteSpeed
Web interface to manage CageFS is available for cPanel, Plesk 10+, DirectAdmin, ISPmanager &
Interworx. Command line tool would need to be used for other control panels.
Once you initialized the template you can start enabling users. By default CageFS is disabled for all
users.
$ /usr/sbin/cagefsctl --remove-all
That command will: Disable CageFS for all customers, unmount CageFS for all users, removes /usr/
share/cagefs-sk eleton & /var/cagefs directories. It will not remove /etc/cagefs directory.
Mode #1 is convenient for production operation, where you want all new users to automatically be added
to CageFS.
Mode #2 is convenient while you test CageFS, as it allows you to enable it on one by one for your
customers.
To start using CageFS you have to select one of the mode of operations:
$ /usr/sbin/cagefsctl --enable-all
or
$ /usr/sbin/cagefsctl --disable-all
or
$ /usr/sbin/cagefsctl --toggle-mode
That will switch the operation mode, preserving current disabled/enabled users.
$ /usr/sbin/cagefsctl --list-enabled
$ /usr/sbin/cagefsctl --list-disabled
$ /usr/sbin/cagefsctl --display-user-mode
Options:
Options:
Common options:
Yet, if user has shell disabled, it wouldn't work. To solve this issue, we have added command:
If you disable CageFS for a user, then cagefs_enter will be executed without proxyexec.
You can forcibly disable cagefs_enter start via proxyexec for all users (regardless if CageFS is enabled
or disabled) by specifying the parameter cagefs_enter_proxied=0 in /etc/sysconfig/cloudlinux.
cagefsctl --sanity-check
1. Check cagefs mount points exists - reads cagefs.mp file and verifies if the directories specified in it
really exist on the disk. To learn more visit https://docs.cloudlinux.com/index.html?mount_points.html
and https://docs.cloudlinux.com/index.html?split_by_username.html
5. Check cagefs users can enter cagefs - chooses two users in the system with enabled CageFS (the
first and the second ones in the unsorted list) and tries to log in to CageFS under their credentials and
see what happens. It runs su -l "$USER" -s /bin/bash -c "whoami" and compares the output
with the $USER and su command retcode estimation.
Note. If log in fails, it can be on different reasons, that can only be determined in manual mode. The
check er only gives the output of the command.
6. Check cagefs proxy commands configs are parsable - tries to load /etc/cagefs/*.proxy.commands
files and parse them to check the syntax. In case of any parsing error the test will fail. To learn more
visit https://docs.cloudlinux.com/index.html?executing_by_proxy.html.
7. Check cagefs virt.mp files syntax - reads all /var/cagefs/*/*/virt.mp files (if any) and checks
their syntax validity. At the moment there are only two checks of the syntax: the file is not empty if it
exists, and the file is not starting with the sub directory definitions (with @). To learn more visit
https://docs.cloudlinux.com/index.html?per_user_virtual_mount_points.html
SKIPPED - the check was skipped as it made no sense in such environment (e.g. wrong control
panel) or can not be performed for some reason (e.g no users with enabled CageFS found). The actual
result does not mean that a problem exists and can be considered as positive.
INTERNAL_TEST_ERROR - the check failed because of a problem inside the checker itself. Must be
reported to the developers.
In case if at least one of the checks resulted neither OK nor SKIPPED then the checker will end with ret
code >0.
6.8 Configuration
File System Templates
Excluding Files
Excluding Users
Mount Points
o Split by Username
PostgreSQL support
PAM Configuration
Executing By Proxy
TMP directories
Syslog
The behavior of the commands (and the files copied into /usr/share/cagefs-skeleton directory) depends
To delete files from CageFS template, remove corresponding .cfg file, and run:
$ /usr/sbin/cagefsctl --update
There is an easy way to add/delete files from particular RPMs into CageFS. That can be done by using
--addrpm and --delrpm options in cagefsctl. Like:
$ cagefsctl --addrpm ffmpeg
$ cagefsctl --update
Please, note that ffmpeg RPM should be installed on the system already.
Please do not edit /etc/cagefs/black .list file because it is replaced during the update of CageFS
package.
This is useful when you need to give each user its own copy of a particular system directory, like:
@/var/run/screen,777
Such entry would create separate /var/run/screen for each user, with permissions set to 777
If you want to change mount points, make sure you re-initialize mount points for all customers:
$ cagefsctl --remount-all
This command will kill all current processes and reset mount points.
* Please, see Split by username feature, as it might be more simpler to implement in some cases.
Starting with CageFS 5.1 you can specify additional directories to be mounted inside user's CageFS.
This can be specified for each user.
To specify virtual mount points for a user, create a file:
/var/cagefs/[prefix]/[user]/virt.mp
Inside that file, you can specify mount points in the following format:
virtdir1,mask
@subdir1,mask
@subdir2,mask
virdir2,mask
@subdir3,mask
@subdir4,mask
>virtdir3,mask
@subdir5,mask
@subdir6,mask
# comments
Note that CageFS will automatically create those files for Plesk 10 & higher.
For example if we have plesk11.5 with two users cltest1, and cltest2:
cltest1 uid 10000 has domains: cltest1.com, cltest1-addon.com and sub1.cltest1.com
cltest2 uid 10001 has domains: cltest2.com, cltest2-addon.com
[CageFS 5.3.1+]
Sometimes you might need to make sure that directory containing all users would show up as
containing just that user inside CageFS. For example, if you have directory structure like:
/home/httpd/fcgi-bin/user1
/home/httpd/fcgi-bin/user2
and execute:
cagefsctl --remount-all
After that each subdirectory of /home/httpd/fcgi-bin will be mounted for appropriate user in CageFS: /
CageFS 6.1-1 (and later) has improved mounting user’s home directory that is applied for users with
home directories like /home/user or /homeN/user (where N = 0,1,..9).
In such case, earlier versions of CageFS always mount user’s home directory to /home/user and create
symlink /homeN -> /home when needed, so user’s home directory can be accessed both via /home/user
and /homeN/user. This quirk leads to some rare incompatibilities between CageFS and other software
(for example OpenCart), because real path of user’s home directory in CageFS and in real file system
can differ.
New CageFS mounts user’s home directory in a way that its real path in CageFS is always the same as
in real file system. Additionally, CageFS searches for symlinks like
/homeX -> /homeY and /homeX/user -> /homeY/user in real system and creates such symlinks in
user’s CageFS when found.
This new mounting mode is enabled by default. You can switch to old mounting mode by executing the
following commands:
# touch /etc/cagefs/disable.home.dirs.search
# cagefsctl --force-update
# cagefsctl --remount-all
Note. New mounting mode will be disabled automatically when "mounting base home directory" mode is
enabled ("mount_basedir=1" setting in /etc/cagefs/cagefs.base.home.dirs file).
If there is no such file, the home directory without last component will be considered as a base dir, like
with
/home/$USERNAME we would create /var/cagefs/[prefix]/$USERNAME/home, and then mount
/home/$USERNAME in there
WIth /home/$USERNAME/data as a home dir, we would assume that /home/$USERNAME is the base
directory, and we would create /var/cagefs/[prefix]/$USERNAME/home/$USERNAME/data and then we
would mount /home/$USERNAME/data -- which would cause each user to see empty base directories
for other users, exposing user names.
When you want to share directory structure among multiple users, you can add following line at the top
of the /etc/cagefs/cagefs.base.home.dirs file. This is useful on the systems that support sites with
multiple users, with different home directories inside main 'site' directory.
mount_basedir=1
For example:
mount_basedir=1
^/var/www/vhosts/[^/]+
* Note: you should execute cagefsctl --remount-all in order to apply changes to CageFS (i.e. remount
home directories).
CageFS works with any PostgreSQL version installed from CloudLinux or CentOS repositories.
PostgreSQL packages fo CloudLinux 7 come from upstream (CentOS) unmodified. PostgreSQL’s socket
is located in /var/run/postgresql directory. This directory is mounted to CageFS by default (in cagefs-5.5-
6.34 or later).
When PostgreSQL has been installed after CageFS install, please add line:
/var/run/postgresql
The steps above are enough to configure CageFS to work with PostgreSQL.
CloudLinux 6:
CageFS provides separate /tmp directory for each end user. Yet, PostgreSQL keeps its Unix domain
socket inside server's main /tmp directory. In addition to that -- the location is hard coded inside
PostgreSQL libraries.
To resolve the issue, CloudLinux provides version of PostgreSQL with modified start up script that can
store PostgreSQL's socket in /var/run/postgres. The script automatically creates link from /tmp to that
socket to prevent PostgreSQL dependent applications from breaking.
In addition to that, CageFS knows how to correctly link this socket inside end user's /tmp directory.
If you are using cPanel, you would also need to modify file: /etc/cron.daily/tmpwatch
to:
flags=-umcl
Where 100 stands for minimum UID to put into CageFS & LVE, and 1 stands for CageFS enabled.
CloudLInux uses proxyexec technology to accomplish this goal. You can define any program to run
outside CageFS, by specifying it in /etc/cagefs/custom.proxy.commands file. Do not edit existing /etc/
cagefs/proxy.commands as it will be overwritten with next CageFS update.
ALIAS:wrapper_name=username:path_to_executable
wrapper_name - the name of wrapper file, which is used as a replacement for executable file
path_to_executable inside CageFS. Wrapper files are located in /usr/share/cagefs/safeprograms. If
wrapper name is not specified, then default wrapper /usr/share/cagefs/safeprograms/
cagefs.proxy.program is used. Also, a reserved word “noproceed” can be used, it will intend that
wrapper is not in use (installed before) - applied for the commands with several ALIAS, as in the
example below.
username - the name of a user on whose behalf path_to_executable will run in the real system. If
username is not specified, then path_to_executable will run on behalf the same user that is inside
CageFS.
path_to_executable - the path to executable file which will run via proxyexec.
Example of crontab command execution with custom wrapper under root (privilege escalation). The
command uses two ALIAS, that is why in the second line “noproceed” is specified instead of wrapper
name.
CRONTAB_LIST:cagefs.proxy.crontab=root:/usr/bin/crontab
CRONTAB_SAVE:noproceed=root:/usr/bin/crontab
Sometimes hosters may have users with non unique UIDs. Thus, proxyexec may traverse users
directory to find a specific one. That behavior turns into inappropriate if users directory is not cached
locally (for example LDAP is in use).
Or to activate it back:
rm /etc/cagefs/proxy.disable.duid
To create custom file in /etc directory for end user, create a directory:
/etc/cagefs/custom.etc/[username]
For example, if you want to create custom /etc/hosts file for USER1, create a directory:
/etc/cagefs/custom.etc/USER1
Inside that directory, create a file hosts, with the content for that user.
If you are making changes for multiple users, you can run:
$ cagefsctl --update-etc
1. If /usr/share/cagefs-sk eleton is not created yet (cagefsctl --init wasn't executed), then execute:
$ mkdir /home/cagefs-skeleton
$ ln -s /home/cagefs-skeleton /usr/share/cagefs-skeleton
$ cagefsctl --init
$ cagefsctl --disable-cagefs
$ cagefsctl --unmount-all
# To ensure that the following command prints empty output:
$ cat /proc/mounts | grep cagefs
# if you see any cagefs entries, execute "cagefsctl --unmount-all" again.
$ mv /usr/share/cagefs-skeleton /home/cagefs-skeleton
$ ln -s /home/cagefs-skeleton /usr/share/cagefs-skeleton
cagefsctl --enable-cagefs
On cPanel servers, if you place skeleton into /home directory, then you should configure the following
option:
In cPanel WHM choose Server Configuration and go to Basic cPanel/WHM Setup, then in Basic Config
change Additional home directories default value to blank (not "home").
Note. If this option is not set, then cPanel will create new accounts in incorrect places.
Verify that /var/cagefs.bak directory does not exist (if it exists - change name "cagefs.bak" to
something else)
$ cp -rp /var/cagefs /new/path/cagefs
$ mv /var/cagefs /var/cagefs.bak
$ ln -s /new/path/cagefs /var/cagefs
$ cagefsctl --enable-cagefs
$ cagefsctl --remount-all
Once a day, using cron job, CageFS will clean up user's /tmp directory from all the files that haven't
been accessed during 30 days.
By default this is done at 03:37 AM, but you can also force the clean up outdated files that match
'chosen period' of all user's /tmp directories without waiting for a job to be launched by cronjob. Just run:
$ cagefsctl --tmpwatch
The following path will be cleaned as well:
tmpwatch_dirs=/dir1,/dir2
After that directories /dir1 and /dir2 inside CageFS will be cleaned automatically.
Note that actual location of those directories in real file system is $USER_HOME/.cagefs/dir1 and
$USER_HOME/.cagefs/dir2.
For cPanel servers, CageFS version 6.0-42 or higher performs cleaning of PHP sessions based on
session.gc_maxlifetime and session.save_path directives specified in proper php.ini files.
session.gc_maxlifetime directive default value is 1440 seconds. Those session files will be deleted, that
were created or had metadata (ctime) changes more time ago than it is specified in
session.gc_maxlifetime.
Note. For new installations of Alt-PHP packages, session.save_path will be changed from /tmp to /opt/
alt/phpNN/var/lib/php/session, where NN corresponds to Alt-PHP version.
alt-php44-4.4.9-71;
alt-php51-5.1.6-81;
alt-php52-5.2.17-107;
alt-php53-5.3.29-59;
alt-php54-5.4.45-42;
alt-php55-5.5.38-24;
alt-php56-5.6.31-7;
alt-php70-7.0.23-5;
alt-php71-7.1.9-5;
alt-php72-7.2.0-0.rc.2.2.
When using EasyApache 3, session.save_path value is normally /var/cpanel/php/sessions/ea3 or /tmp.
Seettings for EasyApache 3 are usualy taken from the file /usr/local/lib/php.ini.
The settings for alt-php are located in /opt/alt/phpXX/etc/php.ini files, where XX corresponds to PHP
version.
The cleaning script cleans php sessions for all PHP versions (ea-php and alt-php) regardless of whether
a version is used or selected via MultiPHP Manager or PHP Selector. When different
session.gc_maxlifetime values are specified for the same session.save_path (for different php versions),
the cleaning script will use the least value for cleaning session.save_path. So, it is recommended to
specify different session.save_path for each PHP version.
Users can define custom value of session.gc_maxlifetime via PHP Selector in order to configure PHP's
garbage collector, but that will not affect the script for cleaning PHP sessions. The script cleans PHP
sessions based on global values of session.gc_maxlifetime and session.save_path directives taken from
files mentioned above. Settings in custom users’ php.ini files are ignored.
For Plesk servers, CageFS version 6.0-52 or higher is provided with a special cron job for removing
obsolete PHP session files. Cleanup script runs once an hour (similar to how it is done in Plesk).
Each time the script runs, it performs the cleanup of the paths:
all the users with UID higher than specified in /etc/login.defs are processed. Each user is processed
independently from one another.
only directories inside CageFS are being cleaned. The paths of the same name in the physical file
system are not processed.
in all the detected directories, all the files with the names that correspond to sess_* search mask are
removed, the rest of the files are ignored.
all non-fatal errors (lack of rights, missing directory) are ignored and do not affect the further work of
the script.
6.8.13 Syslog
By default, /dev/log should be available inside end user's CageFS. This is needed so that user's
cronjobs and other things that user /dev/log would get recorded in the system log files.
lvectl start command saves all mounts from real file system as “default namespace” for later use in
all LVEs. lve_namespaces service executes lvectl start command during startup.
In lve-utils-2.0-26 (and later) there is an ability to exclude specific mounts from namespaces for all
LVEs.
In order to do so, please create a file /etc/container/exclude_mounts.conf with list of mounts to exclude
(one mount per line) as regular expressions, and then execute lvectl start :
# cat /etc/container/exclude_mounts.conf
^/dir1/
^/dir2$
# lvectl start
After that, all new created LVEs will be without /dir2 mount and without mounts that start with /dir1/ (like
/dir1/x, /dir1/x/y, etc). To apply changes to existing LVEs you should recreate LVEs:
# lvectl destroy all
# lvectl apply all
Note. You should recreate all LVEs only once after creating /etc/container/exclude_mounts.conf file.
After that the configuration changes will be applied to all new LVEs automatically.
Initialize CageFS;
6.9.1 cPanel
CageFS plugin for cPanel is located in Plugins section of WHM.
It allows to initialize CageFS, select users CageFS will be enabled for, as well as update CageFS
skeleton.
To enable CageFS for a proper user (users), in CageFS User Manager choose a user from the list on the
right (Disabled users) and click Toggle. The user will move to the list on the left (Enabled users).
To disable a user (users), choose a user from the list on the left (Enabled users) and click Disable
CageFS. The user will move to the list on the right (Disabled users).
6.9.2 Plesk
CageFS comes with a plugin for Plesk 10.x. It allows initializing and updating CageFS template, as well
as managing users and mode of operation for CageFS.
To enable CageFS for a proper user (users), in CageFS User Manager choose a user from the list on the
right (Disabled users) and click Toggle. The user will move to the list on the left (Enabled users).
To disable a user (users), choose a user from the list on the left (Enabled users) and click Disable
CageFS. The user will move to the list on the right (Disabled users).
6.9.3 ISPManager
CageFS comes with plugin for ISP Manager to enable/disable CageFS on per user base. In edit user
section chose Permission tab. Mark CageFS User Mode checkbox and click OK to apply.
7 MySQL Governor
[MySQL Governor 0.8-32+]
MySQL Governor is software to monitor and restrict MySQL usage in shared hosting environment. The
monitoring is done via resource usage statistics per each MySQL thread.
MySQL Governor has multiple modes of operations, depending on the configuration. It can work in
monitor only mode, or it can use different throttling scenarious.
MySQL Governor allows to restrict customers who use too much resources. It supports following limits:
CPU % CPU speed relative to one core. 150% would mean one and a half cores
READ bytes bytes read. Cached reads are not counted, only those that were actually
read from disk will be counted
WRITE bytes bytes written. Cached writes are not counted, only once data is written to
disk, it is counted
You can set different limits for different periods: current, short, med, long. By default those periods are
defined as 1 second, 5 seconds, 1 minute and 5 minutes. They can be re-defined using configuration file.
The idea is to use larger acceptable values for shorter periods. Like you could allow a customer to use
two cores (200%) for one second, but only 1 core (on average) for 1 minute, and only 70% within 5
minutes. That would make sure that customer can burst for short periods of time.
When customer is restricted, the customer will be placed into special LVE with ID 3. All restricted
customers will be placed into that LVE, and you can control amount of resources available to restricted
customers. Restricted customers will also be limited to only 30 concurrent connections. This is done so
they wouldn't use up all the MySQL connections to the server.
7.1 Installation
IMPORTANT: Please make full database backup (including system tables) before you
will do upgrade of MySQL or switch to MariaDB. This action will prevent data losing in
case if something goes wrong.
To install MySQL Governor on your server:
$ yum remove db-governor db-governor-mysql # you can ignore errors if you don't have
those packages installed
$ yum install governor-mysql
$ /usr/share/lve/dbgovernor/mysqlgovernor.py --install
If you are installing CloudLinux on a server running MariaDB already, do instead:
$ yum install governor-mysql
$ /usr/share/lve/dbgovernor/mysqlgovernor.py --mysql-version=mariadbXX
$ /usr/share/lve/dbgovernor/mysqlgovernor.py --install
* The installation currently supports only cPanel, Plesk , DirectAdmin, ISPmanager, InterWorx, Percona
Server 5.6, as well as servers without control panel.
Installation for Percona Server 5.6 [requires MySQL Governor 1.1-22+ or 1.2-21+]:
$ /usr/share/lve/dbgovernor/mysqlgovernor.py --mysql-version=percona56
$ /usr/share/lve/dbgovernor/mysqlgovernor.py --install
** Please, note that MySQL/MariaDB will be updated from CloudLinux repositories.
*** MySQL Governor is compatible only with MySQL 5.x & MariaDB.
**** Please mak e sure to specify your MariaDB version instead of XX as follows:
55 MariaDB v5.5
100 MariaDB v10.0
101 MariaDB v10.1
Starting with MySQL Governor version 1.2 when installing MySQL/MariaDB MySQL Governor asks for a
confirmation of a database version to be installed. To avoid such behavior for the automatic installations,
please use --yes flag.
For example:
$ /usr/share/lve/dbgovernor/mysqlgovernor.py --install --yes
MySQL Governor has multiple modes of operation. Some of them are experimental at this moment.
Mode:
off -- Monitor Only: In this mode MySQL Governor will not throttle customer's queries, instead it will let
you monitor the MySQL usage to see the abusers at any given moment of time (and historically). This
mode is good when you are just starting and want to see what is going on
single -- Single restricted's LVE for all restricted customers (deprecated): In that mode once
customer reaches the limits specified in the MySQL Governor, all customer's queries will be running
inside LVE with id 3. This means that when you have 5 customers restricted at the same time, all
queries for all those 5 customers will be sharing same LVE. The larger the number of restricted
customers - the less resources per restricted customer will be available
abusers - Use LVE for a user to restrict queries (default mode): In that mode, once user goes over
the limits specified in the MySQL Governor, all customer's queries will execute inside that user's LVE.
We believe this mode will help with the condition when the site is still fast, but MySQL is slow
(restricted) for that user. If someone abuses MySQL, it will cause queries to share LVE with PHP
processes, and PHP processes will also be throttled, causing less of a new queries being sent to
MySQL. Requires dbuser-map file
all - Always run queries inside user's LVE: This way there are no need for separate limits for MySQL.
Depending on overhead we see in the future, we might decide to use it as a primary way of operating
MySQL Governor. The benefits of this approach is that limits are applied to both PHP & MySQL at the
same time, all the time, preventing any spikes what so ever. Requires dbuser-map file
If dbuser-map file is absent on the server, "abusers" mode works emulate "single".
With single and abusers mode, once user is restricted, the queries for that user will be limited as long
as user is using more than limits specified. After a minute that user is using less, we will unrestricted
that user.
You can specify modes of operation using dbctl or by changing configuration file.
dbuser-map file is located in /etc/container/dbuser-map
7.4 Configuration
MySQL Governor configuration is located in /etc/container/mysql-governor.xml
Once configuration file is updated, please, restart the MySQL Governor using:
$ service db_governor restart
Example configuration:
<governor>
<!-- db governor will try to split MySQL user names using prefix separator (if present) and statistics will
be aggregated for the prefix (account name) -->
<connector host="..." login="..." password=".." prefix_separator="_"/>
<!-- Intervals define historical intervals for burstable limits. In seconds -->
<intervals short="5" mid="60" long="300"/>
<!-- period (deprecated) - period based restriction that has multiple levels (see above) -->
<!-- limit (by default) - when user hits limits, the account will be marked as restricted and if user does not
hit limit again during "unlimit=1m" account will be unrestricted. This mode doesn't have any additional
levels/penalties. -->
<restrict_mode use="period|limit" unlimit="1m"/>
<!-- killing slow SELECT queries (no other queries will be killed) -->
<!-- if "log" attribute was set all killed queries will be saved in log file -->
<!-- slow parameter in the <limit name="slow" current="30"/> will no be applied without enabling
slow_queries -->
<slow_queries run="on|off" log="/var/log/dbgovernor-kill.log"/>
<!-- Enable or disable saving of statistics for lve-stats - On - enabled, Off-disabled -->
<statistic mode="on|off"></statistic>
<!-- Enable logging user queries on restrict, can be On or Off -->
<!-- Files are saved in /var/lve/dbgovernor-store and being kept here during 10 days -->
<logqueries use="on|off"></logqueries>
<default>
<!-- -1 not use limit(by default, current - required) -->
<limit name="cpu" current="150" short="100" mid="90" long="65"/>
<limit name="read" current="100000000" short="90000000" mid="80000000" long="70000000"/>
<limit name="write" current="100000000" short="90000000" mid="80000000" long="70000000"/>
<!-- Time to kill slow SELECT queries for account, can be different for accounts in seconds(but unit can
be specified) -->
<!-- enabled only when slow_queries run="on" -->
<!-- s -- seconds, m -- minutes, h -- hours, d -- days -->
<limit name="slow" current="30"/>
</default>
<!-- name will matched account name, as extracted via prefix extraction -->
<!-- mysql_name will match exact MySQL user name. If both name and mysql_name are present,
system will produce error -->
<!-- mode restrict -- default mode, enforcing restrictions -->
<!-- mode norestrict -- track usage, but don’t restrict user -->
<!-- mode ignore -- don’t track and don’t restrict user -->
<user name=”xxx” mysql_name=”xxx” mode=”restrict|norestrict|ignore”>
<limit...>
</user>
<!-- debug mode for particular user. The information logged to restrict log. -->
<debug_user name="xxx"/>
</governor>
Traditionally MySQL Governor used prefixes to map user to database. With the latest version, we
automatically generate user -> database user mapping for cPanel and DirectAdmin control panels (other
panels will follow).
Restrict_log
Restrict log is located in /var/log/dbgovernor-restrict.log
Restrictions:
_timestamp_ _username_ LIMIT_ENFORCED _limit_setting_ __current_value_
_restrict_level__ SERVER_LOAD TRACKED_VALUES_DUMP
...
TRACKED_VALUES_DUMP=busy_time:xx,cpu_time:xx,...
SERVER_LOAD= load averages followed by output of vmstat
TRACKED_VALUES_DUMP is available with MEDIUM & LONG format
SERVER_LOAD is available with LONG format
Note. For experienced users only. Changing MySQL version is a quite complicated procedure, it causes
system table structural changes which can lead to unexpected results. Think twice before proceeding.
IMPORTANT: Please make full database backup (including system tables) before you
will do upgrade of MySQL or switch to MariaDB. This action will prevent data losing in
case if something goes wrong.
$ /usr/share/lve/dbgovernor/mysqlgovernor.py --mysql-version=MYSQL_VERSION
$ /usr/share/lve/dbgovernor/mysqlgovernor.py --install
* If you are using cPanel or DirectAdmin -- recompile Apache.
auto default version of MySQL for given OS release (or cPanel settings)
mysql50 MySQL v5.0
mysql51 MySQL v5.1
mysql55 MySQL v5.5
mysql56 MySQL v5.6
mysql57 MySQL v5.7
mariadb55 MariaDB v5.5
mariadb100 MariaDB v10.0
mariadb101 MariaDB v10.1
mariadb102 MariaDB v 10.2
mariadb103 MariaDB v 10.3
percona56 Percona v 5.6
* We don't recommend to downgrade from MySQL v5.6, MariaDB 10.x
Note. Starting from cPanel & WHM version 70 cPanel supports MySQL 5.7:
https://blog.cpanel.com/being-a-good-open-source-community-member-why-we-hesitated-on-mysql-5-7/
Note. cPanel does not officially support MariaDB 10.3, that is why we don’t recommend to use it on
cPanel servers.
Use on your own risk for DirectAdmin and Plesk servers, because downgrade can corrupt your
databases.
MySQL Governor starting from version 1.2-36 (for now, July 4th, 2018 in Beta) supports MariaDB 10.3
installation.
7.9.1 dbtop
Utility to monitor MySQL usage. Requires db_governor to be running. It shows usage for the current, mid
and long intervals.
Options:
Control keys:
Control keys, that sort table, displays into header of table bold and underlined symbol.
Sorted field will be highlighted by *.
CAUSE field shows current stage, reason for restriction and number of seconds before restriction will be
lifted:
Values of column 'CAUSE' - cause of restriction or freezing:
Possible stages: - - OK, 1 - Restriction 1, 2 - Restriction 2, 3 - Restriction 3, 4 -- restriction level 4
Display fields:
Color conventions:
Accounts highlighted in red color means that the account is restricted.
Accounts highlighted in blue color are in cool down period
7.9.2 dbctl
usage: dbctl command [parameter] [options]
commands:
parameters:
options:
The default mode is the "limit" - when a user hits limits, the account will be
marked as restricted and if the user does not hit the limit again during "unlimit=1m
" account will be unrestricted. This mode doesn't have any additional levels/
penalties.
<restrict_mode use="limit" unlimit="1m"/>
Changing the "unlimit" can be done only via the configuration file (see http://
docs.cloudlinux.com/index.html?mysql_governor_configuration.html).
--slow=N limit time (in seconds) for long running SELECT queries
Examples:
$ dbctl set test2 --cpu=150,100,70,50 --read=2048,1500,1000,800
sets individual limits for cpu (current, short, middle period) and read (current, short, middle, long periods)
for user test2
$ dbctl set default --cpu=70,60,50,40
changes default cpu limits.
To unrestrict user:
$ dbctl unrestrict username
To unrestrict all users:
$ dbctl unrestrict-all
To restrict user:
$ dbctl restrict dbgov
To restrict user to level 2 restriction:
$ dbctl restrict dbgov --level=2
To make Governor to ignore user:
$ dbctl ignore username
Delete user's limits, and use defaults instead:
$ dbctl delete username
Show limits as bytes:
$dbctl list --bb
TS : timestamp records
USER : user name
CPU : average CPU usage
READ : average READ usage
WRITE : average WRITE usage
CON : average connections
lCPU : CPU limit
lREAD : READ limit
lWRITE : WRITE limit
RESTRICT : C-cpu restrict, R- read restrict, W- write restrict
Example:
root@cpanel1 [~/ttttt]# lveinfo --dbgov --user=dbgov --period=1d --limit=10
TS USER CPU READ WRITE CON lCPU lREAD lWRITE
RESTRICT
2012-12-06 11:14:49 dbgov 9 0.0 0.0 1 90 1000 1000
7.9.4 dbgovchart
dbgovchart is analog of lvechart tool to create charts representing customer's to MySQL usage
Charts examples:
7.12 Troubleshooting
MariaDB 5.5 and MariaDB 10.0: How to set LimitNOFILE correctly for systemd.
MariaDB 5.5 and MariaDB 10.0 have only /etc/init.d/mysql file for managing the service, but the file
has LSB functions, so it is supported by systemd .
1. Run:
mkdir /etc/systemd/system/mariadb.service.d/
2. Run:
touch /etc/systemd/system/mariadb.service.d/limits.conf
3. Add the following content to the the file /etc/systemd/system/mariadb.service.d/limits.conf :
[Service]
LimitNOFILE=99999
8 PHP Selector
PHP Selector is a CloudLinux component that sits on top of CageFS. It allows each user to select PHP
version and module based on their needs. PHP Selector requires account to have CageFS enabled to
work.
PHP Selector is compatible with the following technologies: suPHP, mod_fcgid, CGI (suexec),
LiteSpeed.
8.1 Installation
The installation of PHP Selector presumes that you already have CageFS & LVE Manager installed.
Use compatibility matrix to check if your Web Server/PHP mode is supporting PHP Selector. If not, you
need a change to one of the supported models.
Update CageFS & LVE Manager with support for PHP Alternatives:
$ yum update cagefs lvemanager
cPanel/WHM: Make sure 'Select PHP version' is enabled in Feature Manager.
For example, alternative php5.2 versions should load /opt/alt/php52/etc/php.ini file and scan /opt/alt/
php52/etc/php.d directory for modules:
Configuration File (php.ini) Path /opt/alt/php52/etc
Loaded Configuration File /opt/alt/php52/etc/php.ini
Scan this dir for additional .ini files /opt/alt/php52/etc/php.d
additional .ini files parsed /opt/alt/php52/etc/php.d/alt_php.ini
Those are default locations for alt-php.
If you need custom PHP settings per user, please change them via "Edit PHP settings" feature of PHP
Selector.
1. CloudLinux (Admin Console --> Configuration --> Server --> General): CageFS
2. Enable SuExec: Server--> General --> PHP SuEXEC --> Yes
3. Go to External App tab, the new lsphp_selector is here.
[Note that you can select any other application or create a custom one.]
For Plesk:
5. Go to Script Handler tab. For required suffixes change the Handler Name to lsphp_selector.
* In order to use PHP Selector and custom php.ini, lsphp5 needs to be in SuEXEC non-daemon mode.
** Some PHP configurations require more memory for SuExec to work properly. If you are getting error
500 after switching suEXEC to non-daemon mode, try to increase Memory Soft Limit and Memory Hard
Limit for external App to at least 650/800M.
*** If you have LiteSpeed installed not in standard location path, please create a symlink : 'ln -s /path/to/
custom/lsws /usr/local/lsws' then run 'cagefsctl --setup-cl-selector'.
Add line:
path phpcgibinary /usr/local/bin/php-cgi-etc
Make sure there is no other lines with path phpcgibinary defined in the file.
Restart ISPmanager:
$ killall ispmgr
After that FCGID wrappers (/var/www/[USER]/data/php-bin/php) for new users will be like this:
#!/usr/local/bin/php-cgi-etc
You might need to edit/modify wrappers for existing users if you want them to be able to use PHP
Selector. You can leave them as is for users that don't need such functionality.
8.2 Configuration
Setting default version and modules
PHP Extensions
FFmpeg
[versions]
php=5.4
[php5.4]
modules=json,phar
[php5.3]
modules=json,zip,fileinfo
Note, that this is 'local' to CageFS, and different users will have different files. The file is not visible in /
etc/cl.php.d outside CageFS. If you would like to view that file, use:
# cagefsctl -e USERNAME
to enter into CageFS for that user. Then type: exit ; to exit from CageFS
This file has to be updated using cagefsctl --rebuild-alt-php-ini after updating alt-php RPMs
Admin can change individual settings for PHP extensions by changing that extension's ini file, like
editing /opt/alt/php54/etc/php.d.all/eaccelerator.ini and then running:
cagefsctl --rebuild-alt-php-ini
to propagate the change.
1. Move default php.ini into /etc directory and create a symlink to it:
$ mv /usr/local/lib/php.ini /etc/php.ini
$ ln -fs /etc/php.ini /usr/local/lib/php.ini
2. Change path to php.ini in /etc/cl.selector/native.conf file to:
php.ini=/etc/php.ini
3. For each user that needs custom php.ini file, create directory /etc/cagefs/custom.etc/
USER_NAME/php.ini.
For example if you want to create custom php.ini for USER1 and USER2 you would create files:
/etc/cagefs/custom.etc/USER1/php.ini
/etc/cagefs/custom.etc/USER2/php.ini
Create such files for each user that should have custom php.ini file.
4.Execute:
$ cagefsctl --force-update
Notes:
2. Users will be able to override settings of those php.ini files (global or custom) via PHP Selector. if
you want to prevent that, you should disable PHP Selector feature.
3. Even if PHP Selector is disabled, user can override php settings by using ini_set() php function in
php script, or by "php -c" command line option.
In reality it only disables the icon in cPanel interface. Yet, in most cases it should be enough in shared
hosting settings.
Once PHP Selector is enabled, you can find it in the Feature Manager. Disabling it in Feature Manager,
will remove the icon for users that are using that particular 'Feature List'
CloudLinux PHP Selector and Alt-PHP can be used in conjunction with Plesk PHP Selector and cPanel
MultiPHP. To be compatible, CloudLinux PHP Selector works as follows: modules that are selected in
CloudLinux PHP Selector are loaded for Alt-PHP version selected in CloudLinux PHP Selector only. For
the rest Alt-PHP versions default module set is loaded (/opt/alt/phpXX/etc/php.d/default.ini). Described
above is default behavior.
Note. If system default PHP version selected in cPanel MultiPHP Manager is not ea-php, then default
module set is loaded for all Alt-PHP versions by default (/opt/alt/phpXX/etc/php.d/default.ini).
When "php.d.location = selector" option is in effect, modules selected via PHP Selector will be
loaded for all alt-php versions.
In LVE Manager 1.0-9.40+ this behavior can be modified so that modules selected in CloudLinux PHP
Selector would be loaded for all Alt-PHP versions (with CageFS enabled), which can be quite useful if
you use ‘per directory’ or ‘per domain’ Alt-PHP configuration and want to select modules using
CloudLinux PHP Selector.
To modify it, create a file /etc/cl.selector/symlink s.rules (read-only for regular users) with the following
content: php.d.location = selector
8.2.7 FFmpeg
Due to possible patent issues CloudLinux does not provide FFmpeg libraries (https://ffmpeg.org/
legal.html). We highly recommend researching if you can legally install FFmpeg extension on your
server. This might differ based on where you and your servers are located. More information can be found
on the link: https://ffmpeg.org/legal.html
For your convenience we provide FFMPEG PHP binding. For them to work, you need to install FFmpeg
package from the “Nux Dextop” repository following the instructions.
php=/usr/bin/php-cgi
php-cli=/usr/bin/php
php.ini=/etc/php.ini
The file is created when installing CageFS on the servers with cPanel, Plesk, DA, Interworx and ISP
Manager, if it is missing. On all other servers the file is not being created at all.
That is why, if the file is not created automatically, then it must be created manually and correct paths
must be written to its directives.
8.3.1 selectorctl
selectorctl is a new tool that replaces cl-selector (which is deprecated and should not be used anymore)
and piniset. It is available starting with CageFS 5.1.3.
Common Options:
--interpreter (-i): chooses the interpreter to work with. Currently only PHP is supported. If omitted, --
interpreter=php is implied.
--version (-v): specifies alternatives version to work with
--user (-u): specifies user to take action upon.
--show-native- prints the version of native interpreter
version (-V):
Global Options:
--list (-l): lists all available alternatives for an interpreter. For instance on server with Alt-
PHP installed, it produces the following output. Columns are: short alternative
version, full alternative version and path to php-cgi binary.
$ selectorctl --list
5.2 5.2.17 /opt/alt/php52/usr/bin/php-cgi
5.3 5.3.28 /opt/alt/php53/usr/bin/php-cgi
5.4 5.4.23 /opt/alt/php54/usr/bin/php-cgi
5.5 5.5.7 /opt/alt/php55/usr/bin/php-cgi
--summary (-S): prints alternatives state summary. Output format: alternative version, state ('e'
for 'enabled', '-' otherwise), chosen as default one or not ('d' for 'default', '-'
otherwise). For example:
$ selectorctl --summary
5.2 e -
5.3 e -
5.4 e -
5.5 e -
native e d
if used with --show-native-version , displays version for native interpreter:
$ selectorctl --summary --show-native-version
5.2 e -
5.3 e -
5.4 e -
5.5 e -
native(5.3) e d
--current (-C): prints currently globally selected default version (it is stored in /etc/cl.selector/
defaults.cfg file):
$ selectorctl --current
native native /usr/bin/php
--set-current (-B): sets specified version as globally default one (in /etc/cl.selector/defaults.cfg
file). For example, to set current default version of PHP to 5.4, use:
$ selectorctl --set-current=5.4
--enable-alternative (-Y): Enables alternative version, removes state=disabled option, if present, from
alternative section. For example to enable PHP 5.2:
$ selectorctl --enable-alternative=5.2
--enable-extensions (-E): enables extensions for particular PHP version by adding comma-separated list
of extensions of modules for alternative in /etc/cl.selector/defaults.cfg.
Requires --version option. For example:
$ selectorctl --enable-extensions=pdo,phar --version=5.2
--disable-extensions (-D): removes extensions for a particular PHP version. Comma-separated list of
extensions will be removed from /etc/cl.selector/defaults.cfg. Requires --
version. Example:
$ selectorctl --disable-extensions=pdo,phar --version=5.2
--replace-extensions (-R): replaces all extensions for particular PHP version to the list of comma
separated extensions. Requires --version option . Example:
$ selectorctl --replace-extensions=pdo,phar --version=5.2
--list-extensions (-G): lists extensions for an alternative for a particular version. Requires --version .
Example:
Plus sign (+) stands for 'enabled', minus (–) for 'disabled', tilde (~) means
compiled into interpreter. Enabled and disabled state relates to presence in /
etc/cl.selector/defaults.cfg file.
All end-user settings are contained in individual user's alt_php.ini files and controlled using selectorctl
command.
Columns are: alternative version, state ('e' for 'enabled', '-' otherwise), chosen as
default one or not('d' for 'default', '-' otherwise), selected as user default one or not
('s' for 'selected', '-' otherwise). If used with --show-native-version , version for
native interpreter is shown in parenthesis:
$ selectorctl --user-summary --user=user1 --show-native-version
5.2 e - -
5.3 e - -
5.4 e - -
5.5 e - -
native(5.3) e d s
--user option is required.
--current (-c): prints currently globally selected default version (in /etc/cl.selector/defaults.cfg
file):
$ selectorctl --current
5.3 5.3.28 /opt/alt/php53/usr/bin/php-cgi
--set-user-current (-b): sets specified version as the one to use for this end user:
$ selectorctl --set-user-current=5.4 --user=user1
changes user symlinks for the PHP interpreter to point to alternative 5.4.
--enable-user- Enables comma-separated list of extensions for the user user. Information is
extensions (-e): saved to alt_php.ini file. Requires --version and --user options.
$ selectorctl --enable-user-extensions=pdo,phar --version=5.2 --
user=user1
--reset-user- Resets extensions for end user to default list of extensions as defined in
extensions (-t): default.cfg. Requires --version and --user options.
$ selectorctl --reset-user-extensions --version=5.2 --user=user1
--list-user-extensions lists enabled user extensions for an alternative. Requires --version and --user
(-g): options.
$ selectorctl --list-user-extensions --version=5.3 --user=user1
xml
xmlreader
xmlrpc
if --all option present, command will list all alternatives extensions marked
enabled or disabled for given user. For example:
$ selectorctl --list-user-extensions --version=5.3 --user=user1 --
all
- xmlreader
- xmlrpc
- xmlwriter
- xrange
+ xsl
Plus sign (+) stands for 'enabled', minus (–) stands for 'disabled'. Enabled and
disabled state relates to presence or absence of corresponding extensions in
user alt_php.ini file.
--add-options (-k): adds options (as in php.ini) to user alt_php.ini file. For example:
$ selectorctl --add-options=log_errors:on,display_errors:on --
version=5.2 --user=user1
adds log_error and display_errors options with values 'on' to user alt_php.ini
file overwriting default values for a user. Requires --version and --user options.
--replace-options (-m): replaces all options in user alt_php.ini file with specified ones. Requires --
version and --user options.
$ selectorctl --replace-options=log_errors:on,display_errors:on --
version=5.2 --user=user1
--delete-options (-x): removes custom options from user alt_php.ini file. Requires --version and --
user options.
$ selectorctl --delete-options=log_errors,display_errors --
version=5.2 --user=user1
--print-options (-P): print options from /etc/cl.selector/php.conf file with default values or ones
overwritten in user's alt_php.ini file.
$ selectorctl --print-options --version=5.2 --user=user1
TITLE:allow_url_fopen
DEFAULT:On
COMMENT:Allows PHP file functions to retrieve data from remote
locations over FTP or HTTP. This option is a great security risk,
thus do not turn it on without necessity.
TYPE:bool
...
--reset-options (-z): removes custom options from alt_php.ini files for ALL users and versions. Backup
files in home folders are cleared.
$ selectorctl --reset-options
The ranges of affected customers or versions can be narrowed with --version or
--user options :
$ selectorctl --reset-options --user=user1,user2 --version=5.3,5.4
--list-users (-L): list users that use particular version of interpreter, specified with --version
option. For example, to see all users that use PHP version 5.3:
$ selectorctl --list-users --version=5.3
--change-to-version (- changes all (or particular user) from one interpreter version to another.
T): $ selectorctl --change-to-version=5.2 --version=5.3
Addtional Options:
--base64 (-Q) Sometimes PHP options values can contain commas and other symbols that break
command line formatting. In such a case convert a key:value pair into base64 and
pass it as value for option-related arguments. For example, to add
disable_functions=exec,popen,system and display_errors=on to user options, do the
following:
$ selectorctl --add-options=`echo disable_functions:exec,popen,system|
base64 -w 0`,`echo display_errors:on|base64 -w 0` --version=5.2 --
user=user1 --base64
Option -w 0 of base64 executable stands for 'disable wrapping of lines'. Without it
base64 output will break the command.
--quiet makes selectorctl continue when it encounter option not found in php.conf. Without it
selectorctl exits with error.
PHP summary:
Command:
/usr/bin/selectorctl --summary
Result:
4.4 e -
5.1 e -
5.2 e -
5.3 e -
5.4 e -
5.5 e -
5.6 e -
7.0 e -
7.1 e -
native e d
Command:
/usr/bin/selectorctl --summary --show-native-version
Result:
4.4 e -
5.1 e -
5.2 e -
5.3 e -
5.4 e -
5.5 e -
5.6 e -
7.0 e -
7.1 e -
native(5.6) e d
Disable version:
/usr/bin/selectorctl --disable-alternative=_VERSION_
Enable version:
/usr/bin/selectorctl --enable-alternative=_VERSION_
Result:
- apc
- bcmath
- big_int
- bitset
- bloomy
~ bz2
- bz2_filter
~ calendar
- coin_acceptor
- crack
~ ctype
+ curl
+ - enabled
~ - included in php binary (cannot be disabled)
- - disabled
Select Default Extensions (enable comma-separated list of extensions globally for a version):
/usr/bin/selectorctl --version=5.6 --enable-extensions=pdo,json,mysql
Deselect Default Extensions (disable comma-separated list of extensions globally for a version):
/usr/bin/selectorctl --version=5.6 --disable-extensions=pdo,json,mysql
To do that, run:
$ yum groupremove alt-php
PHP Selector lets you select default PHP version, as well as modules that will be available to user out of
the box.
Inside cPanel, User will be able to change PHP version they would have:
PHP Selector allows customer to edit php.ini settings. Admin has a full control over which settings can
be modified.
Directive = safe_mode_include_dir
Type = value
Remark = <5.4.0
Comment = If PHP is in the safe mode and a script tries to access some files, files
from this directory will bypass
security (UID/GID) checks. The directory must also be in include_path. For example: /
dir/inc
Directive php.ini setting
Default Default value
Type bool, value (any text), list
Range list of values for list Type
Comment explanation of the setting to display in UI
Default values, that are shown in PHP Selector web interface, are taken from '/opt/alt/phpXX/usr/bin/php -
i' runtime values, if
directive is not there, it will use 'default' value that was set in php.conf. So, if you wish to change default
value of any option for
"alternative" php version, please modify /opt/alt/phpXX/etc/php.ini files (where XX = 55, 54, 53, etc
according to php version).
like:
/etc/cl.php.d/alt-php54/fileinfo.ini - /opt/alt/php54/etc/php.d.all/fileinfo.ini
If you have decided that you want to build it on your own, you would need to build it for each and every
supported version of PHP that you have installed. The module installation process is a bit different from
standard - you would need to use the version of phpize and php-config binaries that come with particular
Alt-PHP version.
Create directory in /opt/alt (like: /opt/alt/php51 ), and mimic directory structure inside to be
similar to the one of PHP versions bundled by CloudLinux.
Put all the ini files for all the modules into /opt/alt/php51/etc/php.d.all
Add an absolute path to PHP binaries into /etc/cl.selector/selector.conf using the following
format:
php 5.1 5.1.2 /opt/alt/php51/usr/bin/php-cgi
php-cli 5.1 5.1.2 /opt/alt/php51/usr/bin/php
php-fpm 5.1 5.1.2 /opt/alt/php51/usr/sbin/php-fpm
^ ^ ^ ^----- absolute path
| | |---------------------- real version
| | -------------------------- version to display
|--------------------------------- binary to 'substitute'
Execute:
cagefsctl --setup-cl-selector
The new PHP version must be available now for selection in PHP Selector.
PHP Selector provides an easy way to figure out which versions are available and selected for end user
from the command line. You can get this information by running:
$ selectorctl --interpreter=php --user-summary --user=USERNAME
The output:
5. 2 e - -
5. 3 e - s
5. 4 e - -
5. 5 e - -
nat i v e e d -
The first column defines the PHP version. Native means native PHP version, like the one installed by
cPanel with EasyApache.
The second column will contain either e or -. If e is present, it means that given version is enabled, and
can be selected by the end user.
The third column can have values d or -. If d is present, that version is considered a 'default' version.
Only one PHP version will have d indicator.
The fourth column can have values s or -. If s is present, that is the selected version, currently being
used by the end user. Only one PHP version will have s indicator.
In case a user is not inside CageFS, and as such doesn't use PHP Selector, you will see the following
error message:
ERROR: Us e r USERNAME n o t i n Ca g e F S
PHP Selector can now be used with CageFS turned off (in case when there is only one user account on
the server).
To install run:
yum groupinstall alt-php
yum install cagefs lvemanager
(no need to initialize or turn on CageFS)
selectorctl --setup-without-cagefs USER
(USER - the name of a user who is using selector. If not specified, the first available cPanel account
username will be used).
Creating symlinks to the user modules and options for each Alt-PHP version:
/opt/alt/php55/link /conf/alt_php.ini -> /home/USER/.cl.selector/alt_php55.ini
In user home directory creating:
.cl.selector/
“Backup” settings files (selected version, modules, options):
.cl.selector/defaults.cfg
.cl.selector/alt_php44.cfg
Symlinks to the selected version:
.cl.selector/lsphp -> /opt/alt/php44/usr/bin/lsphp
.cl.selector/php.ini -> /opt/alt/php44/etc/php.ini
.cl.selector/php-cli -> /opt/alt/php44/usr/bin/php
.cl.selector/php -> /opt/alt/php44/usr/bin/php-cgi
Additional symlinks for environment variable $PATH (search path) in the file ~/.bashrc:
.cl.selector/selector.path/
.cl.selector/selector.path/php-cgi -> ../php
.cl.selector/selector.path/php -> ../php-cli
Generated ini files with selected modules and options for each version:
.cl.selector/alt_php44.ini
.cl.selector/alt_php51.ini
.cl.selector/alt_php52.ini
.cl.selector/alt_php53.ini
.cl.selector/alt_php54.ini
.cl.selector/alt_php55.ini
.cl.selector/alt_php56.ini
.cl.selector/alt_php70.ini
.cl.selector/alt_php71.ini
Symlinks above are being created according to the settings in ~/.cl.selector/defaults.cfg and ~/
.cl.selector/alt_php44.cfg files (44 - corresponding PHP version), which are storing PHP Selector
settings for the user. These files are usually taken from user home directory backup or when migrating
account from another server. Thus, when migrating account from server to server, PHP Selector settings
are saved.
If no PHP Selector settings backup files are found when running selectorctl --setup-without-
cagefs , then default settings from /etc/cl.selector/defaults.cfg global file are applied (as in
selector normal mode). If the file is absent, then native PHP version will be selected for the user.
There is /etc/cl.selector/global_php.ini file, where you can specify values of PHP options that
should be applied for all Alt-PHP versions that are installed on a server. These settings will also be
automatically applied to the new Alt-PHP versions that will be installed later.
Example:
# cat /etc/cl.selector/global_php.ini
[Global PHP Settings]
date.timezone = Europe/Warsaw
error_log = error_log
memory_limit = 192M
Sections are ignored. Only name of an option and a value have meaning.
When an option is absent in /etc/cl.selector/global_php.ini file, than it is not changed (applied) to php.ini
for Alt-PHP versions.
date.timezone and error_log options are handled differently than the others. When these options are not
in /etc/cl.selector/global_php.ini file, than values for the options will be taken from "native" php.ini file.
And when the option is in php.ini for some Alt-PHP version already (and its value is not empty), than
value from /etc/cl.selector/global_php.ini will be NOT applied.
To confirm changes (not affecting "date.timezone" and "error_log" options) please run:
/usr/sbin/cagefsctl --setup-cl-selector
To confirm changes (including "date.timezone" and "error_log" options) please run:
/usr/bin/selectorctl --apply-global-php-ini
or
/usr/sbin/cagefsctl --apply-global-php-ini
(two commands above work the same way).
If you don't want to change error_log, but want to change date.timezone, you can execute:
selectorctl --apply-global-php-ini date.timezone
Similarly, command "selectorctl --apply-global-php-ini error_log " applies error_log and all
other options specified in /etc/cl.selector/global_php.ini file, except date.timezone.
So, you can specify 0, 1 or 2 parameters from the list: error_log, date.timezone.
Using --apply-global-php-ini without arguments applies all global PHP options including two
above.
Example:
selectorctl --apply-global-php-ini error_log
selectorctl --apply-global-php-ini date.timezone
selectorctl --apply-global-php-ini date.timezone error_log
The latter command has the same effect as /usr/bin/selectorctl --apply-global-php-ini
PHP 4.4
PHP 5.1
PHP 5.2
PHP 5.3
PHP 5.4
PHP 5.5
PHP 5.6
PHP 7.0
PHP 7.1
PHP 7.2
* Please note that to use newrelic extension you should set your own New Relic License Key in your
own /opt/alt/php7*/etc/php.ini file.
Please find more info about New Relic License Key in the New Relic documentation.
* Please note that to use newrelic extension you should set your own New Relic License Key in your
own /opt/alt/php7*/etc/php.ini file.
Please find more info about New Relic License Key in the New Relic documentation.
* Please note that to use newrelic extension you should set your own New Relic License Key in your
own /opt/alt/php7*/etc/php.ini file.
Please find more info about New Relic License Key in the New Relic documentation.
The extension will be visible in PHP Selector interface, but selecting it in users's interface will take no
effect - extension will be disabled in fact.
Reinstalling of alt-php packages will not reset settings (will not enable extension again).
8.15.1 cPanel
[Requires CageFS 5.5-6.18+]
When using EasyApache4 in cPanel, it is possible to change PHP versions for users' domains with
MultiPHP Manager (when PHP is working under Apache web server). Also it is possible to change
system default PHP version with MultiPHP Manager in WHM.
A user can change PHP version for domain in cPanel interface but can not change System default PHP
version.
The following Alt-PHP packages (and higher) provide an ability to select Alt-PHP version in MultiPHP
Manager:
alt-php44-4.4.9-71;
alt-php51-5.1.6-81;
alt-php52-5.2.17-107;
alt-php53-5.3.29-59;
alt-php54-5.4.45-42;
alt-php55-5.5.38-24;
alt-php56-5.6.31-7;
alt-php70-7.0.24-2;
alt-php71-7.1.10-2;
alt-php72-7.2.0-0.rc.3.2.
PHP Selector works in different ways with EasyApache4 and EasyApache3. CageFS should be enabled
for users who use PHP Selector. The novation is that when using EasyApache4, actual PHP version
used depends on PHP version selected in MultiPHP Manager. When PHP version chosen for domain in
MultiPHP Manager matches System default PHP version, then PHP Selector is used to select actual
PHP version. If PHP version chosen for domain in MultiPHP Manager differs from System default PHP
version, then PHP version from MultiPHP Manager is used.
In other words, PHP Selector deals with changing System default PHP version.
PHP Selector algorithm for choosing PHP version for domain is as follows:
1. If CageFS is disabled, then PHP Selector is not active and MultiPHP Manager PHP version is applied.
2.1. If PHP version chosen in MultiPHP Manager differs from System default PHP version, then
MultiPHP Manager PHP version is applied.
2.2. If PHP version chosen in MultiPHP Manager is the same as System default PHP version, then
PHP Selector PHP version is applied:
2.2.1. If Native option is selected in PHP Selector, then MultiPHP Manager PHP version is
applied.
2.2.2. If PHP version chosen in PHP Selector differs from Native, then PHP Selector PHP
version is applied.
PHP version chosen in MultiPHP Manager can also be applied to console commands /usr/bin/php and /
usr/local/bin/php. In this case .htaccess file search is performed in current directory and in parent
directories. If the file is found, then PHP version specified in it is applied, if not found, then System
default PHP version is applied. System default PHP version can be changed via PHP Selector.
1. If CageFS is disabled, then PHP Selector is not active and PHP version from .htaccess is applied.
2.1. If PHP version specified in .htaccess file differs from System default, then .htaccess version is
applied.
2.2. If System default PHP version is specified in .htaccess file, then PHP Selector version is
applied:
2.2.1. If Native option is chosen in PHP Selector, then .htaccess PHP version is applied.
2.2.2. If PHP version chosen in PHP Selector differs from Native, then PHP Selector version is
applied.
Note. cPanel prior to 11.56 does not support hook s to add processing of System default PHP version
changes with MultiPHP Manager. That is why System default PHP version changing is handled by cron
job (/etc/cron.d/cagefs_cron file), which executes the command /usr/share/cagefs/
setup_multiphp_integration every ten minutes, which means that all System default PHP version
changes in MultiPHP Manager are applied in CageFS with 10 minutes delay.
In cagefs-5.5-6.25 or later, changing of System default PHP version with MultiPHP Manager will be
processed with cPanel WHM hook s.
PHP Modules
The set of PHP modules depends on PHP version used for domain or console. If PHP Selector is active
and Alt-PHP version is chosen, then modules chosen for this Alt-PHP version in PHP Selector are used.
If PHP Selector is not active, then modules for PHP version chosen in cPanel MultiPHP are used.
PHP Options
cPanel has MultiPHP INI Editor available in WHM and in cPanel user interface.
MultiPHP INI Editor allows setting PHP options for any PHP version globally for all domains and users.
At this point /opt/cpanel/ea-php56/root/etc/php.d/local.ini file is generated and options values are written
into this file. Such options have higher priority than the options set in MultiPHP INI Editor in cPanel user
interface. MultiPHP INI Editor allows to set PHP options in Basic Mode (simplified interface) and in
Editor Mode.
Note. cPanel prior to 11.56 does not support hook s to add processing of INI options changing for PHP
version with MultiPHP INI Editor in cPanel WHM. That is why for now the processing of PHP version
changing is handled by cron job (/etc/cron.d/cagefs_cron file) which performs the command /usr/share/
cagefs/ setup_multiphp_integration every 10 minutes, which means that INI options changes for PHP
version in MultiPHP INI Editor in cPanel WHM are being applied with up to 10 minutes delay.
In cagefs-5.5-6.25 or later, INI options changes for PHP version in MultiPHP INI Editor in cPanel WHM
will be processed by cPanel WHM hook s.
MultiPHP INI Editor in cPanel user interface allows setting options for php.ini files in user home directory
or in domain docroot. Changes are applied immediately without delay.
These options priority is lower than ones specified in MultiPHP INI Editor WHM interface. MultiPHP INI
Editor in cPanel user interface looks as follows
If PHP Selector is active, then options set in PHP Selector are applied, and such options have higher
priority than options in custom php.ini file in domain docroot. If PHP Selector is disabled, then options
set in MultiPHP INI Editor are applied.
QUIRKS: When changing System default PHP version, administrator should take into consideration the
following quirk. For example, if a user has chosen PHP 5.3 for domain and System default PHP version
is PHP 5.5, then PHP Selector will not be used for user domain. In this case, if administrator switches
System default PHP version from 5.5 to 5.3, then PHP Selector will be activated for user domain and
PHP version chosen in PHP Selector will be applied for domain.
That is why it is recommended for administrator to avoid changing System default PHP version to PHP
version that is already used by users. At the same time it is recommended for users to choose inherit for
domain and use PHP Selector to choose PHP version. In this case PHP version chosen in PHP
Selector will be always applied for domain.
This feature is available for CloudLinux 6 or later and requires LVE Manager 0.9-1 or later. It supports
only cPanel servers.
Alt-Ruby 1.8;
Alt-Ruby 1.9;
Alt-Ruby 2.0;
Alt-Ruby 2.1;
Alt-Ruby 2.2;
Alt-Ruby 2.3;
Alt-Ruby 2.4.
9.1 Installation
Install a tools to create isolated Python environments and Passenger Apache module. For servers with
EasyApache3:
yum install lvemanager alt-python-virtualenv alt-mod-passenger
with EasyApache4:
yum install lvemanager alt-python-virtualenv ea-apache24-mod-alt-passenger
To use Python Selector you should install alternative Python packages:
yum groupinstall alt-python
To use Ruby Selector install alternative Ruby packages:
yum groupinstall alt-ruby
To use MySQL database you should install alt-python27-devel package:
yum install alt-python27-devel
NOTE. After installation, please mak e sure that you have unmark ed appropriate check boxes in LVE
Manager Options tab to show Ruby or Python App in web-interface.
NOTE. Adding Python and Ruby modules requires executing permissions to gcc/mak e binaries. Please
enable compilers in Compiler Access section of WHM, then run:
cagefsctl --force-update
2. Create project form will appear. Choose interpreter version for your application, application folder name
(project path) and URI for accessing your application. Click “Create project” to create an application.
After a little while a new application entry will be appended to the web-page.
3. You can edit path (folder name in homedir, for example /home/clman1), uri for application, wsgi
handler. If you click Edit - the value is converted to input field and thus becomes editable. When editing
4. Wsgi entry is to specify python wsgi application entry point. It must be specified as filename, must be
callable and separated by colon. If your app is running from file flask/run.py by calling callable app, set
flask/run.py:app.
4. When Show control is clicked, python extensions section will be expanded. It gives the ability to add
or remove python modules. When start typing in input field, appropriate hints are shown in drop-down
list. Choose the entry you want from drop-down and click Add.
In addition to setting path, uri and wsgi, the interpreter version can be changed as well by changing the
value in select drop-down.
5. No changes are applied to application environment until Update button is clicked. Before the Update
button is clicked, all changes can be reverted with Reset button.
The newly created application will be supplied with stub only. A real application ought to be put into
application folder. After application is placed into application folder, the wsgi parameter can be set.
Click Remove to delete the application - the application folder itself will remain unmoved.
When creating an application you can use the key --domain, which attaches application to domain. If --
domain key is not specified, then the main users domain will be used by default.
Also you can run simple commands from web interface (e.g. you can install packages from specific
repositories or control web applications by means of django-admin).
Note. You also can hide/show CloudLinux Plugins in cPanel using Feature Manager.
9.5 Trac
1. In Setup Python App create an application. Trac project WSGI script will be located in App
Directory (e.g. trac).
App URI – is a URL where web-interface is located. (e.g. Trac – web-interface is located in
YOUR_DOMAIN/trac).
Trac needs Python version from 2.5 to 3.0, in actual example version 2.7 is used.
2. When the App is created, add the following modules: Trac, Genshi, MySQL-python.
2.1. Alternatively connect to the server via SSH and perform the following steps:
source ~/virtualenv/trac/2.7/bin/activate;
then:
~/virtualenv/trac/2.7/bin/easy_install Trac mysql-python (using easy_install);
or
~/virtualenv/trac/2.7/bin/pip install trac mysql-python (using pip).
Note. In case of "... The charset and collation of database are 'latin1' and 'latin1_swedish_ci' error the
database must be created with one of (('utf8', 'utf8_bin'), ('utf8mb4', 'utf8mb4_bin')) ..." while creating the
project, you should change database encoding.
To change encoding, in cPanel run phpMyAdmin, choose DB, go to Operations, choose the necessary
encoding in Collation section and click Go.
After that you have to repeat the procedure of creating a project. When done, the Trac project must
appear: ~/trac_project
mkdir chrome
cp -R ~/trac/htdocs/ ~/public_html/trac/chrome/ - all project static files are located in this directory; the
changes can be added here as well.
Go back to cPanel Setup Python App, change “WSGI file location” for your application to cgi-bin/
trac.wsgi, click Update to apply changes and then click Restart.
7. Adding authorization:
Enter password.
~/virtualenv/trac/2.7/bin/trac-admin ~/track_project permission add admin TRAC_ADMIN
Here the path trac directory is equal to App Directory in your project.
To install run:
yum install alt-python27-devel --enablerepo=cloudlinux-updates-testing
9.6 Redmine
Note. Provided instructions are valid for older Redmine version 2.6.0 . New versions guide could be
found at http://k b.cloudlinux.com/2016/12/how-to-run-redmine-with-ruby-selector/
1. In cPanel create MySQL database and add user to it. In the example given, the databace
redminet_redmine was created and user redminet_redmine was added.
App Directory is the directory where all static files will be placed (e.g. redmine).
App URI is web-interface URL (e.g. redmine web-interface will be located in YOUR_DOMAIN/redmine).
Note: If error occurs while installing rmagic module, then you need to install ImageMagick-devel package
on your server:
yum install ImageMagick-devel
The installation process takes quite along time, about 7-8 minutes. When done, click Restart button to
restart the application.
3.1 Alternatively, after the application was created, you can add only one module - bundle.
http://www.redmine.org/releases/redmine-2.6.0.tar.gz
tar xzf redmine-2.6.0.tar.gz
Hereinafter 'redmine' is App Directory meaning which was specified while setting Ruby application.
cp -R ~/redmine-2.6.0/* ~/redmine
cd ~/redmine/config
cp database.yml.example database.yml
Edit config/database.yml - add MySQL database connection settings to Production section.
cp -R ~/redmine/public/* ~/public_html/redmine/
cd ~/public_html/redmine
cat htaccess.fcgi.example >> .htaccess
cp dispatch.fcgi.example dispatch.fcgi
Go to cd ~/redmine directory.
Run alternately:
source ~/rubyvenv/redmine/2.1/bin/activate
CloudLinux already has Python and Ruby Selector, which allows creating applications with ea-
apache24-mod-alt-passenger. However, it does not allow using cPanel application manager.
It is not correct to install both of those packages on the server because they contain the same
passenger module for Apache web server.
The new ea-ruby24-mod_passenger is available for download from our updates-testing (beta) repository
which allows you to run applications via cPanel application manager and CloudLinux Python and Ruby
Selector.
To install run:
# yum install lvemanager alt-python-virtualenv
# yum install ea-ruby24-mod_passenger --enablerepo=cl-ea4-testing
To install Ruby or Python Selector follow the instructions on the link.
10 Node.js Selector
Overview & Requirements
Requirements
Installation
Command Line Interface
Hoster
End User
User Interface
Hoster
o How to enable/disable Node.js
o How to manage Node.js
o Applications column
End User
o How to manage application
Node.js Deployment
o Remote Usage of Node.js Interpreters
o Remote Usage of the cloudlinux-selector Utility
Requirements
Node.js Selector supports Node.js versions 6.x, 8.x, 9.x and later.
This feature is available for CloudLinux 7, CloudLinux 6 hybrid and CloudLinux 6.
Node.js Selector requires LVE Manager 4.0 or later.
It supports cPanel and DirectAdmin servers (Plesk is not supported as it already has Node.js
support.) For more details, please go to Plesk & Node.js documentation here and here.
For more details about mod_passenger and Node.js, please read documentation here and here.
Node.js Selector is working with EasyApache 3 and EasyApache 4.
10.2 Installation
cPanel
To use Node.js Selector, please install Node.js packages by running the following command:
Also, please install LVE Manager, LVE Utils and Fusion Passenger by running the following command:
For EasyApache 3:
And we recommend to install CageFS for better security (not mandatory) by running the following
command:
Note. If during Node.js Selector usage on cPanel servers you get "ENOMEM npm ERR! errno -12" error,
try to increase Memory limit in
cPanel WHM ? Server Configuration ? Tweak Settings ? System ? Max cPanel process memory.
DirectAdmin
To use Node.js Selector, please install Node.js packages by running the following command:
Also, please install LVE Manager, LVE Utils and Fusion Passenger by running the following command:
And we recommend to install CageFS for better security (not mandatory) by running the following
command:
Hoster
Get information related to Node.js: default version, list of supported versions, status of Node.js Selecto
r, list of users, their applications, etc:
cloudlinux-selector [get] [--json] --interpreter nodejs
To set default Node.js version, please use the following command (note that required Node.js version
should be enabled):
Disable required Node.js version (note that it is impossible to disable default Node.js version):
Examples:
This command changes version for the specific application:
in case of success:
{
"result": "success",
"timestamp": 1508666792.863358
}
in case of error:
{
"result": "Some error message",
"details" : "Traceback: ..." ,
"context": {},
"timestamp": 1508666792.863358
}
in case of warning:
{
"result": "success",
"warning" : "Some warning message" ,
"context": {},
"timestamp": 1508666792.863358
}
To resolve issues related to install-version/uninstall-version commands (because they are running in the
background) you may use this log file /var/log/cl-nodejs-last-yum.log
It contains full yum output from the latest performed operation (install or uninstall) and it will be rewritten
with each operation.
End User
WARNING: options --user and --domain are mutually exclusive now.
JSON output:
{
"result": "success",
"timestamp": 1508666792.863358
Example:
{
"result": "success",
"timestamp": 1508666792.863358
}
Example:
This command saves config file for user1’s application app1:
Example:
This command gets a list of applications for the user1:
or
cloudlinux-selector create --json --interpreter nodejs --app-root my_apps/app1 --
domain xyz.com --app-uri apps/app1
Example:
This command starts user1's application:
Example 1:
This command sets a production mode, new domain new.xyz.com, new Node.js version 8, new URI,
new application root directory and new startup file for user1 application located on the domain xyz.com:
Example 2:
Note that when changing Node.js version all replies from web application to get request will be checked
in Node.js Selector (before and after version changing). HTTP response codes and MIME type are
comparing. So, make sure application is available via http(s) at least locally.
Note that all replies from web application to get request will be checked in Node.js Selector (before and
after modules installation). HTTP response codes and MIME type are comparing. So, make sure
application is available via http(s) at least locally.
Run a script from package.json file of a user application, arguments <args> are passed to the script
Example:
JSON output:
{
"result": "success",
"timestamp": 1508666792.863358
"data": "script output as Base64 encoded string"
}
Activate virtual environment of NodeJS:
source <home_of_user>/nodevenv/<app_root>/<nodejs_version>/bin/activate
Example:
After activation user can use npm and node from a virtual environment without full paths.
Go to LVE Manager ? Options Tab ? Node.js Section. A list of installed Node.js versions is displayed.
There are several columns in the list.
Note that Node.js Selector icon in end user interface is absent when Node.js is disabled.
The list of installed Node.js versions allows to enable and disable, install and delete, and set a particular
Node.js version as a default.
Applications column
To view and operate with the list of domains with Node.js versions click on a number in the Applications
column for a particular Node.js version. A section with a list of Domains for particular Node.js version will
be displayed.
Domains are displayed by three. To load more domains click on Load More button.
End User
Note that Node.js Selector icon in end user interface is absent when Node.js is disabled.
End User interface allows end users to setup and manage Node.js for their web applications.
Start application
Stop application
Restart application
Remove application
Edit application
o Choose a location of the application on the server and synchronize the files with the IntelliJ IDEA
project.
4. Set up Run/Debug Configurations in the project created.
o Specify a path to the remote Node.js interpreter. To be able to specify the remote interpreter, you
should install the Node.js Remote Interpreter plugin first. Please find more information here, using
server access credentials for a user (Main menu — Run — Edit configurations...).
o Specify initial JavaScript file that will be run with the node command (it is the app.js file from the
archive).
o Specify Path Mappings between a local and a remote project (Preferences — Deployments — Add).
If you have created your application with the cloudlinux-selector utility or via plugin UI the Path
Mappings should be as follows:
/home/<USER_NAME>/<APP_NAME>
5. Synchronize the project directories on the local and the remote machine as per Path Mappings
specified.
6. Deploy the modules on the remote and the local machine with the npm install command (if there are
dependent modules). In the UI you can click the Run NPM Install button.
7. Run Node.js application with the configuration set at the 4th step (Main menu — Run — Run… —
Select configuration).
8. If you are using the application from the archive attached, you can see the running application on the
3003 port — http://DOMAIN:3003.
If you’d like to use a different version of Node.js to run an application, change a path to the interpreter in
the configuration settings of the running.
To apply all changes to the project, synchronize all changes with the server and restart the running
application.
9. To debug a script, set breakpoints in the code and run the configuration via Main Menu (Main menu —
Run — Debug… — Select configuration).
Useful links:
IntelliJ IDEA: https://www.jetbrains.com/help/idea/configure-node-js-remote-interpreter.html
Plugin Node.js Remote Interpreter: https://plugins.jetbrains.com/plugin/8116-node-js-remote-interpreter
WebStorm: https://www.jetbrains.com/help/webstorm/configure-node-js-remote-interpreter.html
Note. It is not required to install Passenger while working in IDE if you are using this approach.
11 inodes Limits
[cPanel Only]
LVE Manager inodes limits extension allows setting inode limits for the customers. An inode is a data
structure on a file system used to keep information about a file or a folder. The number of inodes
indicates the number of files and folders an account has. inodes limits work on the level of disk quota,
and will be enabled on /home partition only.
Soft limit can be exceeded for a period of time. The grace period can be set using: edquota -t.
Note that we do not collect statistical information on the inodes lik e we do for other LVE limits.
You can set inodes limits using LVE Manager, the same way you would set any other LVE Limits:
Sometimes disk quota breaks, so do inodes limits. You can reset them through the Options tab of LVE
Manager:
End user can also see the usage inside resource usage menu.
11.1 cl-quota
cl-quota utility is designed to control disk quotas and provides:
Limits synchronization.
Note. cl-quota work s only with inodes soft/hard limits (soft/hard file limits in setquota/repquota utilities
terminology). Block limits are not controlled by cl-quota utility in any way, they are not tak en into
account and do not affect the data that they issue. That is why hereinafter it is the inode limits that are
implied by the word “limits”.
General Provisions
Limits Inheritance
Quotas DB File
CLI Options/Examples
verifies if quotas are activated for a specified user (with a separate command), see below.
quota package which contains the required setquota/repquota utilities, is not included in lvemanager
package dependencies by default, and quotas activation is a long process which sometimes depends on
the panel used, therefore, all the steps on quotas configuration and activation must be carried out by
yourself, cl-quota does not perform these actions.
Error messages sent back to the console are extremely rare, to receive error messages use the
command:
# cat /var/log/messages | grep clquota
Note that you should not set soft limit higher than hard limit. cl-quota does not control it in any way, but
in some cases, the system can ban such limits combination and they won’t be set or will be set in some
other way.
cl-quota integrates with the panels through a standard mechanism - Integrating LVE Limits with
Packages.
Panel users are such users whose UIDs are issued by the above panel integration mechanism. The list
of panel packages and the information on the user's affiliation to a particular package is obtained from
there as well.
1. When displaying quotas, cl-quota displays information about the limits of all users - system and
panel. No filter applied. The actual limit values are always displayed.
2. Limit value -1 for the packages (see below) is displayed as dash (-).
3. If cl-quota is running under root, it will display the limits returned by repquota utility with no changes. If
it is running under some other user, it will return data from a special cache file, see “Quotas cache
and synchronization”.
4. Limits setting only works for panel users, for all other users limits are not set (the command is
ignored). The only exception - uid=0. The limits are never set for the root user (uid=0), but they are
stored in DB file and are used by inheritance mechanism. See “Limits Inheritance”.
5. Hard and soft limits are completely independent, сl-quota does not apply any interdependencies to
them. Setting only one of them (any) is acceptable, the other one will not change.
cl-quota utility also supports package limits set/read. When setting package limits, they are set for all
users of a particular package except for those whose limits are set individually. See also “Limits
Inheritance”.
If package name is "default", then setting limits command is ignored. If some limits are set for this
package in DB file, they will be displayed along with all the others, but will not be used. See also “Limits
inheritance”.
Any positive numbers are allowed as limit values. cl-quota neither controls nor changes these values
except the following cases:
if the transferred value can not be turned into a number (for example, 67wg76), it is completely ignored
and the limit is not set at all.
Then these values are transmitted directly to setquota system utility for the actual setting of the limits.
Thus cl-quota has two limit values, which are processed in a special way:
0. Means inheritance of the limit from the package where the user is located, or from uid=0. See also
“Limits inheritance” for more detailed information.
-1. The real limits are set to 0, which means no limits, literally "unlimited". This is legit both for
individual and for package limits. Limit value -1 is stored in the database as well as any other but is
never displayed.
You can use the words “default” and “unlimited” instead of 0 and -1 respectively, they are fully
interchangeable. See also “DB File” and “CLI Options”.
Individual and package limits are always saved in DB file /etc/container/cl-quotas.dat . Limits from
there are used when synchronizing quotas. Please find more details in “Limits Synchronization”.
If no individual limit is set to a user, then he inherits the limits of the package he belongs to.
If no limit is set to a package (=0), then the users inherit uid=0 limits.
Limits of the package named “default” (if found in the DB file) will always be ignored and all the users of
this package will get uid=0 limits.
During the synchronization, cl-quota utility reads the database file and sets the limits from it to the users
and packages specified therein.
This mode is designed to set the correct limits for the new users and to restore them for the existing
ones. When recovering, the current limits are neither read nor analyzed.
Caching - is writing current limits to /etc/container/cl-quotas.cache file. If cl-quota is not started from the
root for reading the current limits, then it returns data from this file.
When installing LVE Manager package, a special cron job is installed, which performs synchronization
and caching (cl-quota -YC) every 5 minutes. Therefore, the correct limits will be set for the user within 5
minutes from the moment of its creation.
Caching and synchronization can also be performed separately, see "CLI Options" section.
When saving the limits to a file, the following rules are applied:
If a limit value is non-integer or non-numeric, then the rules from "Setting limits and integrating with
panel packages" section are applied. The assigned value is saved to the file.
Limits are always saved in pairs, no matter if only one limit was set or both. The pair looks as follows:
soft_limit:hard_limit.
The values 0 and -1, when having a predetermined meaning, are saved as is without any
transformations.
If both limits for a user/package were set as 0, then such user/package is not saved in the file, and if it
was previously there - it will be removed. Therefore, if a user/package is not mentioned in the file, then
all its limits are inherited. See "Limits Inheritance" section.
The lists of panel users, packages, and user-package correspondence are not saved anywhere, this
information is always subtracted from the panel.
Example:
/etc/container/cl-quotas.dat
[users]
0 = 1000:2000
500 = -1:-1
958 = 0:20000
[packages]
pack1 = 5000:-1
It follows that:
uid=0 limits are set to 1000:2000 - all users in the default package will obtain these limits.
Both limits are set as unlimited for a user with uid=500, which means that its real limits will always be
0:0. The package limits do not affect this user.
Soft limit of the user with uid=958 is inherited (0 means inheritance), his hard limit is set to 20000 and
it will not depend on the package limits or uid=0 limits.
Limits 5000:-1 are set for pack1 package, therefore its real limits are: soft_limit=5000 and hard_limit=0
(unlimited).
The users of pack1 package will get pack1 limits (5000:-1), the users of all the rest of the packages
will get the limits of uid=0 because no limits are set for them. Exceptions: uid=500 and 958. uid=500
has both limits set individually, and uid=958 inherits only soft limits.
--user and --user-id options are designed to specify user whose limits are required to be set or
displayed. --user specifies user name, --user-id - uid. It is acceptable to specify one or another.
--soft-limit, --hard-limit - specify soft and hard limits values respectively. It is acceptable to use words
“default” or “unlimited” as limit value.
--csv - displays limits in csv format (instead of data formatted in the table).
--package-limits - displaying the limits of the packages created by the panel admin.
--all-package-limits - displaying the limits of all the packages, including the ones created by the
resellers and packages with no users.
--force - saving user quotas even if they are equal to the current.
--check - performs diagnostics for a specified user. Can be used only when a user is specified (along
with --user / --user-id).
Examples:
12 Kernel Settings
Virtualized /proc filesystem
SecureLinks
ptrace Block
TPE Extension
IO Limits latency
Hybrid Kernel
flashcache
fs.proc_can_see_other_uid=0
If fs.proc_can_see_other_uid is set to 0, users will not be able to see special files. If it is set to 1 -
user will see other processes IDs in /proc filesystem.
fs.proc_super_gid=XX
The fs.proc_super_gid sets group ID which will see system files in /proc, add any users to that group
so they will see all files in /proc . Usually needed by some monitoring users like nagios or zabbix.
Virtualized /proc filesystem will only display following files (as well as directories for PIDs for the user) to
unprivileged users:
/proc/cpuinfo
/proc/version
/proc/stat
/proc/uptime
/proc/loadavg
/proc/filesystems
/proc/stat
/proc/cmdline
/proc/meminfo
/proc/mounts
/proc/tcp
/proc/tcp6
/proc/udp
/proc/udp6
/proc/assocs
/proc/raw
/proc/raw6
/proc/unix
/proc/dev
In lve-utils-2.1-3.2 and later /proc can be remounted with "hidepid=2" option to enable additional
protection for procfs. This remount is performed in lve_namespaces service.
This option is in sync with fs.proc_can_see_other_uid kernel parameter described above.
When /etc/sysctl.conf does not contain fs.proc_can_see_other_uid setting, the protection is off (procfs
is remounted with hidepid=0 option). In this case fs.proc_super_gid setting is ignored. Users are able to
see full /proc including processes of other users on a server. This is a default behavior.
Also, you can override this by specifying desired options for /proc in /etc/fstab.
But we recommend to manage procfs mount options via /etc/sysctl.conf as described above for
backward compatibility.
Note: there is a known issue on CloudLinux 6 systems. User cannot see full /proc inside CageFS even
when this user is in “super” group, that should see full /proc. This issue does not affect users with
CageFS disabled. CloudLinux 7 is not affected.
12.2 SecureLinks
CloudLinux provides comprehensive protection against symbolic link attacks popular in shared hosting
environment.
To protect against symlink attack where attacker tricks Apache web server to read some other user
PHP config files, or other sensitive file, enable:
fs.enforce_symlink sifowner=1.
Setting this option will deny any process running under gid fs.symlink own_gid to follow the symlink if
owner of the link doesn’t match the owner of the target file.
Defaults:
fs.enforce_symlink sifowner = 1
fs.symlink own_gid = 48
When fs.enforce_symlink sifowner set to 1, processes with GID 48 will not be able to follow symlinks if
they are owned by user1, but point to file owned user2.
Please, note that fs.enforce_symlink sifowner = 2 is deprecated and can cause issues for the system
operation.
fs.symlinkown_gid
On standard RPM Apache installation, Apache is usually running under GID 48.
On cPanel servers, Apache is running under user nobody, GID 99.
To change GID of processes that cannot follow symlink, edit the file /etc/sysctl.conf, add the line:
fs.symlink own_gid = XX
And execute:
$ sysctl -p
To disable symlink owner match protection feature, set fs.enforce_symlink sifowner = 0 in /etc/
sysctl.conf, and execute
$ sysctl -p
427.36.1.lve1.4.42+]
For example, in the path /proc/self/fd, self is a symlink, which leads to a process directory. The
symlink owner is root. When global_root_enable=0, Symlink Owner Match Protection excludes this
element from the verification. When global_root_enable=1, the verification will be performed, which could
block the access to fd and cause violation of the web-site performance.
Yet, CageFS does not work in each and every situation. For example, on cPanel servers, it is not
enabled in WebDAV server, cPanel file manager and webmail, as well as some FTP servers don’t
include proper change rooting.
This allows an attacker to create symlink or hardlink to a sensitive file like /etc/passwd and then use
WebDAV, filemanager, or webmail to read the content of that file.
Starting with CL6 k ernel 2.6.32-604.16.2.lve1.3.45, you can prevent such attacks by preventing user
from creating symlinks and hardlinks to files that they don’t own.
Please, note that Link Traversal Protection is disabled by default for the new CloudLinux OS
installations/convertations.
fs.protected_symlinks_create = 0
fs.protected_hardlinks_create = 0
Then setup:
fs.protected_symlink s_allow_gid = id_of_group_link safe
fs.protected_hardlink s_allow_gid = id_of_group_link safe
This is for example needed by PHP Selector to work (new versions of Alt-PHP can already correctly
configure those settings).
Defaults:
kernel.user_ptrace = 1
kernel.user_ptrace_self = 1
The option kernel.user_ptrace disables PTRACE_ATTACH functionality, option kernel.user_ptrace_self
disables PTRACE_TRACEME.
To disable all ptrace functionality change both sysctl options to 0, add this section to /etc/sysctl.conf:
## CL. Disable ptrace for users
kernel.user_ptrace = 0
kernel.user_ptrace_self = 0
##
Apply changes with:
$ sysctl -p
Different software could need different access to ptrace, you may need to change only one option to 0 to
make them working. In this case, there will be only partial ptrace protection.
By adding xen_blkfront.sda_is_xvda=0 to kernel boot line in grub.conf you will make sure no naming
translation is done, and the drives will be identified as xvde.
By default, this option is set to 1 in the kernel, and drives are detected as xvda.
CloudLinux 5.x (kernel 2.6.18) has limited support for trusted path execution extension.
CloudLinux 6.x (kernel 2.6.32) and CloudLinux 5.x with hybrid kernel don't have TPE extension
The kernel supports TPE feature out of the box. You can configure it using following files:
/proc/sys/kernel/grsecurity/grsec_lock
/proc/sys/kernel/grsecurity/tpe
/proc/sys/kernel/grsecurity/tpe_gid
/proc/sys/kernel/grsecurity/tpe_restrict_all
To enable TPE feature in a standard way just add following to the end of your /etc/sysctl.conf
#GRsecurity
kernel.grsecurity.tpe = 1
kernel.grsecurity.tpe_restrict_all = 1
kernel.grsecurity.grsec_lock = 1
And do:
# sysctl -p
Note: Once you set grsec_lock to 1, you will not be able to change TPE options without reboot.
When customer reaches IO Limit, the processes that are waiting for IO will be placed to sleep to make
sure they don't go over the limit. That could make some processes sleep for a very long time.
By defining IO latency, you can make sure that no process sleeps due to IO limit for more then X
milliseconds. By doing so, you will also let customers to burst through the limits, and use up more than
they were limited too in some instances.
To disable latency:
CloudLinux 6 Hybrid Kernel is CloudLinux 7 (3.10.0) kernel compiled for CloudLinux 6 OS. New 3.10
kernel features a set of performance and scalability improvements related to IO, networking and memory
management, available in CloudLinux 7 OS. It also features improved CPU scheduler for better overall
system throughput and latency.
Please find information on the main features of 3.10 kernel branch on the links:
https://kernelnewbies.org/Linux_3.10#head-e740f930dfd021616cc42e8abf21c79d0b07e217
https://www.kernel.org/pub/linux/kernel/v3.0/ChangeLog-3.10.1
1. We do not remove Hybrid kernel after migration from Hybrid to the normal channel, but we remove
linux-firmware package which is needed to boot Hybrid kernel. This is because CloudLinux 6 does not
allow to remove the package of currently running kernel. Proper removal procedure will be implemented,
but for now, we should warn users not to boot Hybrid k ernel if they have migrated to normal channel.
2. Kernel module signature isn't checking for now, as 3.10 kernel is using x509 certificates to generate
keys and CL6 cannot detect signatures created in such way. The solution will be implemented.
All the statistics can be read from that file in real time. Depending on your kernel version you will get
either Version 6 of the file, or version 4 of the file.
You can detect the version by reading the first line of the file. It should look like:
6:LVE... for version 6
4:LVE... for version 4
First line presents headers for the data.
Second line shows default limits for the server, with all other values being 0.
The rest of the lines present limits & usage data on per LVE bases.
Supporte
Label Description Value d
versions
LVE LVE ID number
EP Number of entry processes number
lCPU CPU Limit % relative to total CPU power
lIO IO limits for CL6 or IO priority for CL5 KB/s for v6, from 1 to 100 for v4
CPU CPU usage since reboot in nanoseconds for v6, hertz for v4
MEM Virtual memory usage number of 4k pages
IO IO usage KB/s for v6, 0 for v4
lMEM Virtual memory limit number of 4k pages
lEP Entry Processes limit number
nCPU Number of cores limit number of cores
fMEM Virtual memory faults number of faults
fEP Entry Processes faults number of faults v6+
lMEMPH Physical memory limit number v6+
Y
lCPUW CPU weight (not used) from 1 to 100 v6+
lNPROC Number of processes limit number v6+
MEMPHY Physical memory usage number of 4k pages v6+
fMEMPH Physical memory faults number of faults v6+
Y
NPROC Number of processes number v6+
fNPROC Number of processes faults number of faults v6+
IOPS IO operations since reboot number v8+
12.9 flashcache
* Available only for x86_64, CloudLinux 6 and Hybrid servers
Flashcache is a module originally written and released by Facebook (Mohan Srinivasan, Paul Saab and
Vadim Tkachenko) in April of 2010. It is a kernel module that allows Writethrough caching of a drive on
another drive. This is most often used for caching a rotational drive on a smaller solid-state drive for
performance reasons. This gives you the speed of an SSD and the size of a standard rotational drive for
recently cached files. Facebook originally wrote the module to speed up database I/O, but it is easily
extended to any I/O.
For CloudLinux 6:
# echo 1 > /proc/sys/ubc/ubc_oom_disable
Also, add the following to /etc/sysctl.conf file to apply the same during boot:
ubc.ubc_oom_disable=1
For CloudLinux 7:
# echo 1 > /proc/sys/kernel/memcg_oom_disable
Also, add the following to /etc/sysctl.conf file to apply the same during boot:
kernel.memcg_oom_disable=1
To disable quota checking in XFS file system set cap_res_quota_disable option to 1 using the following
command:
# echo 1 > /proc/sys/fs/xfs/cap_res_quota_disable
13 Apache mod_lsapi
Apache mod_lsapi is a module based on LiteSpeed Technologies API for PHP, Ruby and Python. It
offers excellent PHP performance, low memory footprint coupled with great security and support for
opcode caching.
How it works
What is lsphp
lsphp - PHP + LSAPI. What is LSAPI? LiteSpeed Server Application Programming Interface (LSAPI) is
designed specifically for seamless, optimized communication between LiteSpeed Web Server and third
party web applications. Now this protocol is available for Apache 2.2/2.4.
Using LSAPI, we have seen higher performance than Apache with mod_php, easier installation than php-
fpm and easier integration with any control panel. LSAPI means faster and more stable dynamic web
pages.
Requirements
CageFS (installed and initialized) - optional, mod_lsapi can work without CageFS;
Alt-PHP or ea-php for EasyApache 4;
Apache with SuExecuUserGroup directive for each user's VirtualHost;
mod_ruid2 disabled;
apache itk disabled.
Configuration Options
Example configuration
<IfModule lsapi_module>
AddType application/x-httpd-lsphp .php
lsapi_backend_connect_timeout 100000
lsapi_backend_connect_tries 10
lsapi_backend_children 20
lsapi_backend_pgrp_max_idle 30
lsapi_backend_max_process_time 300
lsapi_debug Off
</IfModule>
Secret File
When installed, liblsapi will automatically create secret file used by mod_lsapi to communicate with
backend:
/etc/sysconfig/modlsapi.secret
owner root:root
perms: 400
for making security pass PHPRC and UID|GID on start lsphp
Algorithm of creating:
/bin/dd if=/dev/random of=/etc/sysconfig/modlsapi.secret bs=16 count=1
This tool:
uninstall + + - + + +
enable-domain - + - - - -
disable- - + - - - -
domain
enable-global - + +/- - - -
(custombuild)
disable-global - + - - - -
build-native- - + +/- - - -
lsphp (custombuild)
Different PHP versions (without PHP Selector)
mod_lsapi allows to use different handlers for different php versions. For example, a file with extension
.php53 can be handled by php5.3 and a file with extension .php55 handled by php5.5 without PHP
Selector.
Here is an extra config file which allows to set handlers and php binaries for these handlers - /etc/
container/php.handler. Example of this file:
# cat /etc/container/php.handler
application/x-lsphp53 /opt/alt/php53/usr/bin/lsphp
application/x-lsphp55 /opt/alt/php55/usr/bin/lsphp
Default handler for lsphp is - application/x-httpd-lsphp, if I set in .htaccess such options:
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-lsphp
</FilesMatch>
<FilesMatch "\.php53$">
SetHandler application/x-lsphp53
</FilesMatch>
File index.php53 will be processed by php 5.3, but index.php processed by php standard, placed at /usr/
local/bin/lsphp.
Important:
All custom PHP for phpperdir mechanizm should be located in any place in the directory /opt/alt/,
because before start lsphp mod_lsapi checks as follows: /usr/local/bin/lsphp or /opt/alt/*/lsphp. Such
location and binary file are allowed to execute. Use the folder /opt/alt/[any path] for installing custom
php.
For example:
But if the server has custom php in another location (for example /usr/local/php55/bin/lsphp), then just
make symlink to lsphp:
mod_lsapi is a drop in replacement for suPHP. No configuration changes required. To switch from
suPHP to mod_lsapi:
Switch the whole server (disables suPHP, all domains will be serviced by mod_lsapi):
/usr/bin/switch_mod_lsapi --enable-global
Manually add mod_lsapi for a particular domain: - add to .htaccess file for the domain:
AddType application/x-httpd-lsphp .php5 .php4 .php .php3 .php2 .phtml
Note: This will work only after /usr/bin/switch_mod_lsapi --setup had been called.
13.1 Installation
For all control panels - SuExecUserGroup should be present for each virtual host.
CageFS and PHP Selector will be installed by dependencies (for lsphp binaries).
$ cagefsctl --init
$ cagefsctl --enable-all
$ /usr/bin/switch_mod_lsapi --setup
# Enable for a single domain:
$ /usr/bin/switch_mod_lsapi --enable-domain [domain]
# or globally
$ /usr/bin/switch_mod_lsapi --enable-global
$ service httpd restart
Installing on cPanel servers with EasyApache 4
https://www.cloudlinux.com/blog/entry/beta-easyapache-4-released-for-cloudlinux
$ cagefsctl --init
$ cagefsctl --enable-all
$ /usr/bin/switch_mod_lsapi --setup
After updating ea-apache24-mod_lsapi all the domains are switched to the default handler and to turn on
mod_lsapi back, it was necessary to enable lsapi handler through MultiPHP Manager.
We noticed that it is not very convenient to enable lsapi handler through MultiPHP Manager after update
and automated this process.
After this, you will be asked to enable lsapi handler for proper PHP versions, depending on how you used
mod_lsapi before (--enable-global, --enable-domain ), and then restart Apache.
Please note that the following options were disabled for ea-apache24-mod_lsapi:
/usr/bin/switch_mod_lsapi --enable-domain
/usr/bin/switch_mod_lsapi --disable-domain
You can manage your domains with PHP version and lsapi handler from MultiPHP Manager.
Please note that lsapi PHP handler is only available for beta version.
Example 1:
Example 2:
1. ea-apache24-mod_lsapi-1.0-30 was installed and enabled only for one domain but all other domains
have the same ea-php56 version.
Reconfiguration completed
5. If N is chosen, then mod_lsapi will move to the new type of integration with cPanel and will restore
files php.conf and suphp.conf . Mod_lsapi still will be enabled for domains like in example
tstdomain01.com throw .htaccess file.
6. If Y is chosen, then displayed PHP version will move to lsapi handler. According to the example,
tstdomain01.com tstdomain02.com using ea-php56, will be switched to lsapi handler.
$ cd /usr/local/directadmin/custombuild
$ ./build update
$ ./build set php1_mode lsphp
$ ./build php n
$ ./build apache
<span class="notranslate">
$ yum install liblsapi liblsapi-devel
$ yum install mod_lsapi
$ /usr/bin/switch_mod_lsapi --setup
Disable PHP support for needed domain (this action comment out AddHandler or AddType for
VirtualHost) or for all domains.
<Directory /var/www/*/data/>
php_admin_flag engine off
</Directory>
Alternatively:
RPM Installation
$ yum install liblsapi liblsapi-devel
$ yum install mod_lsapi
$ /usr/bin/switch_mod_lsapi --setup
Disable php.conf or any other PHP handler and uncomment AddType application/x-httpd-lsphp .php
.php4 .php3 .phtml in /etc/httpd/conf.d/lsapi.conf and restart Apache.
Compile mod_lsapi:
Native PHP - PHP installed and used before alt-php packages were installed. Usualy lsphp binary is not
available on the servers without LiteSpeed, which means that it should be created (build from php
sources with such options as usual php binary file but with LSAPI protocol built-in).
switch_mod_lsapi --setup
cp /opt/alt/php56/usr/bin/lsphp /usr/local/bin/
2) The slow one: to detect version of native PHP and build needed sources according to installed PHP
(only for cPanel).
switch_mod_lsapi --build-native-lsphp
13.2 Uninstall
cPanel Servers
$ /usr/bin/switch_mod_lsapi --uninstall
DirectAdmin servers
$ cd /usr/local/directadmin/custombuild
$ ./build update
$ ./build set php1_release [any other php type]
$ ./build php n
$ ./build apache
RPM:
$ yum erase mod_lsapi
$ rm [path to mod_lsapi.conf]
# restore standard php handler
$ service httpd restart
13.3 Troubleshooting
Debugging mod_lsapi issues: error_log & sulsphp_log
Could not connect to lsphp Entering jail error Check if СageFS enabled. Try
backend: connect to lsphp running cagefsctl --remount-all.
failed: 111 Connection
refused
connect_lsphp: connect to uid: (xxx/xxxxxxxx) gid: Check if /tmp/lshttpd (global /tmp
lsphp failed: tries XXX (xxx/xxxxxxxxxx) cmd: /usr/ is not inside CageFS) exists and
exceeded with timeout XXXXX local/bin/lsphp
owner should be apache: apache
Could not connect to lsphp
backend: connect to lsphp
for DirectAdmin, Plesk, iWorx,
failed: 111 Connection ISPManager and nobody for
refused cPanel.
uid: (xxx/xxxxxxxx) gid: Increase PMEM limits for the user
Backend error on sending (xxx/xxxxxxxxxx) cmd: /usr/ UID.
request(GET /XXXX HTTP/1.1); local/bin/lsphp
uri(/XXXX) content-length(0)
(lsphp is killed?):
ReceiveAckHdr: backend
process reset connection:
errno 104 (possibly memory
limit for LVE ID XXXX too
small)
fork() failed, please uid:(xxx); gid:(xxx); uid Increase NPROC limits for the
increase process limit: limit warning: EP should be UID. It should be greater than EP
Cannot allocate memory < than NPROC, current EP:
and lsapi_backend_children.
XX, NPROC: XX
Backend error on sending
request(GET /XXXX HTTP/1.1);
uri(/XXXX) content-length(0) uid: (xxx/xxxxxxxx) gid:
(lsphp is killed?): (xxx/xxxxxxxxxx) cmd: /usr/
ReceiveAckHdr: backend local/bin/lsphp
process reset connection:
errno 104 (possibly memory
limit for LVE ID XXXX too
small)
If apache runs under a username other than "apache" or "nobody", you should rebuild sulsphp (where
username is built in for security reasons) with corresponding username:
$ yum install liblsapi liblsapi-devel
$ cd ~
$ wget http://repo.cloudlinux.com/cloudlinux/sources/da/mod_lsapi.tar.gz
$ tar zxvf mod_lsapi.tar.gz
$ cd mod-lsapi-0.1-37
$ cmake -DHTTPD_USER=<new user name> .
$ make
$ make install
This will:
-- Install: /usr/lib/apache/mod_lsapi.so (or to another correct httpd modules path)
-- Install: /usr/sbin/sulsphp
lsphp started under user apache/nobody
Check if SuExecUserGroup specified for virtual hosts. This parameter is used by mod_lsapi for user
identification.
If you need to run PHP using mod_lsapi using users with UID < 99, you would need to re-compile
sulsphp:
6. WHMCS Status page not accessible after installing CL and mod_lsapi (cPanel).
[apc]
...
apc.shm_segments=1
apc.shm_size=32
...
shared memory should be not less than 32MB
Messages appearing in error_log: Child process with pid: XXXXX was killed by
signal: 11, core dump: 0
Check if apc for user enabled. Tune its options as described in previous slide.
Check if suhosin is enabled for user. Tune its options as described in this article.
If previous items do not help, contact us at https://helpdesk.cloudlinux.com/
Add line ulimit -c unlimited into apachectl script just after another invokes of the ulimit
command.
You can make sure that ulimit for lsphp is changed to unlimited successfully with the following
command:
cat /proc/PID/limits | grep ‘Max core file size’
Core dump of lsphp will be created in the DocumentRoot of the corresponding virtual server.
On cPanel server it should map to /home/user1/public_html.
mod_lsapi is not included in output of httpd -M after installation and setup command for cPanel
EasyApache 3
If it is empty:
3. Call:
/scripts/rebuildhttpdconf
/scripts/restartsrv_httpd
A: Yes.
Q: Are .htaccess PHP directives supported? For example, mod_php like directives?
Q: I have httpd.conf with SuExecUserGroup options. Do I need to add mod_lsapi related options
for VirtualHost?
A: When lsapi_with_connection_pool mode is Off, then the new backend lsphp process has to be
created for each new incoming request. At least it requires mod_lsapi to connect to backend lsphp
master-process and have it perform fork which leads to a slowdown.
With pool_mode enabled, mod_lsapi maintains persistent connections with backend which drastically
increases performance (accelerates requests processing), but also increases the number of processes
in LVE as well memory usage. Backend lsphp processes stays alive for lsapi_backend_max_idle time,
or until lsapi_backend_max_reqs is reached (or Apache restarted).
Alternatively, we have another accelerating technology - CRIU, which is faster and uses less memory.
But it is in Beta so far and available for CL7 only (stable version will appear in the near future).
Q: Your PHP installation appears to be missing the… How to manage native PHP with mod_lsapi
under EasyApache 3?
To find PHP Selector in user’s panel choose Select PHP Version icon as follows:
From PHP Selector you can manage PHP version and choose the necessary extensions to be used by
PHP. Choose proper PHP version from the drop-down and click Set as current. Mark proper checkboxes
to choose extensions and click Save:
The native version is not designed to enable or disable PHP extensions through the web interface of the
PHP Selector. This can lead to missing of the proper PHP extensions for customers applications.
For example, you can get the following reply from the website that is using WordPress and native PHP:
1. Use non-native PHP with proper extensions enabled via the PHP Selector (described above).
2. Use native PHP with properly configured .ini files (described below).
By default it is empty. To solve the issue this way, the following strings must be added:
extension=/opt/alt/php56/usr/lib64/php/modules/mysqli.so
extension=/opt/alt/php56/usr/lib64/php/modules/pdo_mysql.so
extension=/opt/alt/php56/usr/lib64/php/modules/pdo.so
All available extensions for alt-php56 can be seen by running the command:
# ls /opt/alt/php56/usr/lib64/php/modules/
Note. Some extensions may conflict with each other, be careful when enabling them through the
default.ini file.
You can find additional notes on native PHP installation (EasyApache 3 only) on the link: https://
docs.cloudlinux.com/mod_lsapi_installation.html
# /usr/local/bin/php -v
Output example:
PHP 5.6.30 (cli) (built: Jun 13 2017 06:23:21)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
The command switch_mod_lsapi --build-native-lsphp builds the lsphp of the same version, it will
be used as native via the PHP Selector, but with another .ini file to configure.
We do not recommend to use this native PHP because it does not support CRIU.
# cp /opt/alt/php56/usr/bin/lsphp /usr/local/bin/
Managing PHP handlers is fully done with Plesk Admin according to their documentation: http://
download1.parallels.com/Plesk/PP12/12.0/Doc/en-US/online/plesk-administrator-guide/70669.htm
Quick reference:
Enabling lsapi for single domain is done with Plesk Panel > Subscriptions > [subscription name] >
Hosting Settings > PHP Support, select desired LSPHP handler for domain.
Enabling lsapi for multiple domains is done with Plesk Service Plans > [Plan name] > PHP Settings >
PHP support, select desired LSPHP handler to be used by all users under a plan. If a subscription is not
locked (user changed nothing in it), after clicking ‘Update and sync’ domains will start using lsapi.
2. Now you can manage your PHP (versions and modules) from PHP Selector.
From the dialog box select proper PHP version and PHP modules (or defaults).
From now on, on your domain will be applied PHP with version and modules which are set by PHP
Selector handled by mod_lsapi.
3. Summary.
1. For correct work of PHP Selector - chose for domain "LSPHP by vendor OS".
2. If any other LSPHP version is chosen in Plesk, then PHP Selector will not be available anymore.
3. For enabling native PHP from the vendor, select "native" on the PHP Selector management page.
What is CRIU
CRIU is Check point/Restore In Userspace, (pronounced kree-oo), is a software tool for Linux operating
system. Using this tool, you can freeze a running application (or part of it) and checkpoint it as a
collection of files on disk. You can then use the files to restore the application and run it exactly as it
was during the time of freeze (more information on the link https://criu.org/Main_Page).
mod_lsapi-1.1-1 is the first beta version with freezing PHP implemented. mod_lsapi now supports the
following parameters:
Example:
lsapi_criu On
lsapi_criu_sock et_path /var/run/criu/criu_service.sock et
lsapi_back end_semtimedwait On
lsapi_back end_initial_start 15
lsapi_criu_use_shm Off
lsapi_criu_debug Off
How it works
When Apache module mod_lsapi detects CRIU enabled (lsapi_criu On) it prepares a directory for images
(on the first request of virtualhost) to store (lsapi_criu_imgs_dir_path /var/run/mod_lsapi/[dir_name]), and
starts lsphp process. Lsphp increases counter (lsapi_criu_use_shm Off|Signals) via shared memory or
signals, when counter reaches limit (lsapi_backend_initial_start 15), lsphp sends the request to CRIU for
freezing. CRIU service makes images of requested processes. Lsphp will not be frozen if counter has not
reached the limit. The next time when lsphp will be stopped, it will be unfrozen from the images.
The images of the processes will be saved even if Apache is restarted. But all images will be deleted
after server restart by default configuration. This can be modified by setting the new path
lsapi_criu_imgs_dir_path.
Important! If php.ini or configuration file from php.d is changed, the images must be deleted manually.
We are working on automation of this action.
Note that CRIU can't correctly freeze lsphp with PrivateTmp enabled. For correct work, PrivateTmp must
be false in httpd.service file. For disabling:
# cat httpd.service
[Unit]
Description=Apache web server managed by cPanel EasyApache
ConditionPathExists=!/etc/httpddisable
ConditionPathExists=!/etc/apachedisable
ConditionPathExists=!/etc/httpdisable
[Service]
Type=forking
ExecStart=/usr/local/cpanel/scripts/restartsrv_httpd --no-verbose
PIDFile=/var/run/apache2/httpd.pid
PrivateTmp=false
[Install]
WantedBy=multi-user.target
Or it would be technically better to provide a small override of service file rather than copying the whole
new version in /etc/systemd/system … (www.freedesktop.org/software/systemd/man/systemd.unit.html)
.
mkdir /etc/systemd/system/httpd.service.d
echo "[Service]" > /etc/systemd/system/httpd.service.d/nopt.conf
echo "PrivateTmp=false" >> /etc/systemd/system/httpd.service.d/nopt.conf
and
# systemctl daemon-reload
Installation
lsapi_criu On
lsapi_criu_socket_path /var/run/criu/criu_service.socket
lsapi_backend_semtimedwait On
lsapi_backend_initial_start 15
lsapi_criu_use_shm Off
3. Restart apache:
1. An option added to the Apache configuration for cleaning all the images earlier saved by CRIU.
Note that this option works only if lsapi_terminate_backends_on_exit is On (default value is On, it is
set in lsapi.conf too).
2. If you need to clean CRIU images for one user you can simply add mod_lsapi_reset_me file to the
user's directory with CRIU images (default /var/run/mod_lsapi/lsapi_ * _criu_imgs). On the next restart of
lsphp the images will be cleaned.
3. Global reset flag for cleaning all earlier saved images by CRIU.
Current mod_lsapi allows cleaning all images only with one flag file.
Create /usr/share/criu/mod_lsapi/lsphp.criu.reset file. Also don't forget to set such permissions [nobody:
nobody] (or [apache:apache] for non cPanel) and access mode [700] to the /usr/share/criu/mod_lsapi
directory.
Steps to do :
mkdir /usr/share/criu
mkdir /usr/share/criu/mod_lsapi
chown nobody:nobody /usr/share/criu/mod_lsapi
touch /usr/share/criu/mod_lsapi/lsphp.criu.reset
On the next requests to all virtual hosts images will be recreated (deleted first and created again later - it
depends on lsapi_backend_initial_start value).
If a user needs to clean CRIU images for lsphp, he should create a file: ~/mod_lsapi_reset_me_
[vhost_name]. Where [vhost_name] is a ServerName from the VirtualHost block in the configuration file.
On the next restart of lsphp, the images will be cleaned.
Example:
This mode is enabled by default and creates a separate lsphp process for each virtual host.
mod_lsapi_reset_me_[vhost_name] flag will not work for a user when lsapi_per_user option is On.
5. There is lsapi_per_user (default off) option in mod_lsapi that creates only one lsphp process for a
user, regardless of the number of his virtual hosts. We don't recommend to use this option with CRIU,
but if you use it, make sure that your virtual hosts (under the same user) have the same environment
configurations. If they are not the same, this may cause undesirable lsphp process operation.
General Information
Configuration Details
Low-level access
14.1 General
General description
One of the main problems on a shared hosting system for file backup operations is to figure out which
files have changed. Using INOTIFY on a 1T drive with a large number of small files and directories
guarantees slow startup times, and a lot of context switching between kernel and userspace - generating
additional load. On the other hand scanning disk for newly modified files is very IO intensive, and can kill
the performance of the fastest disks.
CloudLinux approach
CloudLinux File Change API is a kernel level technology with the user space interface that buffers lists of
modified files in the kernel and then off-loads that list to user space daemon.
After that - any software (with enough permissions) can get a list of files that has been modified for the
last 24 hours.
The software is very simple to use and produces the list of modified files. As such we expect file backup
software, including integrated cPanel backup system to integrate with this API soon.
If no UID specified, are retrieved for all users. If no timestamp specified, all database events are shown.
Output Format
protocol version (1 right now), timestamp (in seconds) - up to which time data was
collected
UID:absolute path to file changed
UID:absolute path to file changed
…
Note. The timestamp in output is needed so you can clearly identify from which timestamp to get list of
changed files next.
Examples:
[root@localhost ~]# cloudlinux-backup-helper -t 1495533489 -u <UID>
1,1495533925
1001:/home/user2/public_html/output.txt
1001:/home/user2/public_html/info.php
Examples:
[user@localhost ~]$ cloudlinux-backup-helper-uid
1,1495530576
1000:/home/user/.bash_history
Requirements
CloudLinux 7
CloudLinux 6 Hybrid
After successful installation the event collecting daemon starts automatically, providing all kernel-
exposed data are in place.
To start daemon:
CloudLinux 7
CloudLinux 6 Hybrid
CloudLinux 6 Hybrid
# Time to keep entries in days. Does not clean if commented out or zero
time_to_keep=1
1. enable - enable/disable the functionality. Write 1 to this file to enable, 0 to disable. If disabled, no
events are coming to events file.
2. events - the modified files log itself. Events in the format <EVENT_ID>:<EVENT_TYPE_ID>:
<USER_ID>:<FILE_PATH> are constantly appending to the end of the file if datacycle enabled. File
events are never duplicated: if we have file modification event, we would not get file deletion event if the
file has been later deleted. This events buffer has limited capacity, therefore from time to time, the
events log requires flushing.
3. flush - a file for clearing events log. For flushing, the last event_id from the events file is written to this
file. Right after this, events log is truncated to that event_id.
4. user_ro_mode - forbidding users with UIDs equal or bigger that set in this file writing to their home
directories. At the boot, the file has -1. When it’s written positive value, say 500, the system starts
effectively preventing users from modifying their home dirs (on write attempt a user gets ‘read-only
filesystem’ error). This feature is designed to prevent users from updating their home dirs when events
are not handled.
6. min_event_uid - this file has minimal UID of events to be handled. Events from users with smaller
UID are not handled. By default 500 (non-system users in redhat-based systems).
15 mod_proctitle
mod_proctitle is a module for gathering URL information per request. It is available only for Apache 2.4
now.
For installation:
cPanel EasyApache 3 and non cPanel (CloudLinux 7 only for non cPanel):
cPanel EasyApache 4:
DirectAdmin:
# cd /usr/local/directadmin/custombuild
# ./build update
# ./build mod_procticle
For reading information saved by module use the following script (the script is not in the package):
# cat proctitles_info.sh
#!/bin/bash
HTTPD=httpd
Item info:
[pid].[tid] - [posix thread id] - [request info]
Request information can contain:
16 Additional Packages
CloudLinux will package additional software needed by hosters for your convenience.
alt-suexec
tuned-profiles-cloudlinux
cloudlinux-fchange
16.2 alt-suexec
What is alt-suexec package needed for?
If you use standard httpd from our repository, but your users' sites do not match standard Apache
location of /var/www, then you should use alt-suexec.
alt-suexec package brings suEXEC binaries pre-compiled for specific locations, like /home.
Based on httpd 2.2 basic for 6 and httpd 2.4 basic for CloudLinux 7, the package brings to server a set
of suEXECs with different DOCUMENT ROOTs and MIN_UID/MIN_GID parameters. The first set of
suEXECs is listed by such modes:
# switch_suexec -l
USE_HOME - DOCUMENT ROOT /home/ MIN_UID 500 MIN_GID 100 CALLER apache
USE_WWW - DOCUMENT ROOT /var/www/ MIN_UID 500 MIN_GID 100 CALLER apache
The package also brings its own utility for installing specific suEXEC:
# switch_suexec -h
-l list of available suexec
-u update suexec according to /etc/sysconfig/alt-suexec
-s set new suexec and install it
-p set new suexec path and install it
-o set new suexec owners and install it
-r restore native apache suexec
Here are the examples of how to set up suEXEC with DOC_ROOT = "/home":
1.
2.
1) switch_suexec -sUSE_HOME
-p if suexec binary file will be placed not in standard way /usr/sbin - specify this new path with p-option
-o if suexec binary file not owned by root:apache - specify new owner with o-option
For most cases -p and -o options for standard Apache are useless.
List of pre-built suEXEC binary files stored without suid bit and not executable.
If you need suEXEC with custom parameters absent in current set of alt-suexec, please submit a ticket
on https://helpdesk.cloudlinux.com/ and we will add new suEXEC with needed parameters.
16.3 tuned-profiles-cloudlinux
The tuned-profiles-cloudlinux package brings a range of kernel under-the-hood tunings to address high
LA, iowait issues what were detected earlier on particular users deploys. The package also encloses
OOM adjustments to prioritize the elimination of overrun PHP, lsphp, Phusion Passenger workers
processes over other processes (e.g. ssh, a cron job).
cloudlinux-dummy and cloudlinux-vz are used for internal needs or when Virtuozzo/OpenVZ detected and
actually do nothing.
1. Switches CPU power consumption mode to the maximum. CPU operates at maximum performance
at the maximum clock rate:
governor=performance
energy_perf_bias=performance
Note. If standard software CPU governors are used.
3. [CloudLinux 7 only] Detects used disk types and changes elevator to 'deadline' for HDD and to 'noop'
for SSD in /sys/block/[blockname]/queue/scheduler.
Note. The script uses /sys/block /[block name]/queue/rotational flag, some RAID controllers can not set
it properly. For example, SSD used for RAID but rotational is set to 1 by RAID driver. As a workaround
add the following to /etc/rc.d/rc.local to make it applied on boot:
6. Provides adjustment group file for OOM-Killer to kill overrun php, lsphp and Phusion Passenger
workers first.
To install:
tuned-adm off
17 Integration Guide
Here you will find the instructions and common techniques used to integrate your software with
CloudLinux.
$ /usr/sbin/cagefsctl --cagefs-status
Check if CageFS is enabled for a particular user (as root):
Check for the presence of /var/.cagefs/.cagefs.token file - if present, it means that you are inside
CageFS.
The information is located in the /var/lve/info file. This information is updated every 5 minutes, and
contains default limits (first line), as well as usage and limits for all customers. If a customer is not
present in the file, it means that customer is not active (no scripts were executed recently for the
customer), and a customer has default limits (so you can display no usage, and default limits in the
control panel for that customer.
The data is stored in a form of one line per customer, with coma separated values.
0 user id
1 entry processes
3 CPU
4 CPU limit
5 Virtual Memory
10 Physical Memory
13 Number of processes
15 Reserved
16 IO Usage
17 IO Limit
With LVE version 4 (CloudLinux lve0.x) only the first 9 parameters are available. You can check the the
version by reading the first byte of /proc/lve/list.
There is only 2 LVE versions currently used in production. Future versions might add more fields, but will
not alter order of existing fields.
Memory is defined in 4KB pages (so, 1024 would mean 1024 4KB pages, or 4MB).
IO is defined as KB/s.
CloudLinux can automatically detect the most popular control panels, like cPanel - and allows to set
different limits for users in different packages. It simplifies management as you don't have to choose
between one limit that fits all your customers on the server, or individual limits for the customers.
If you have a custom made control panel, with your own 'package' implementation, you can still use
CloudLinux framework to manage limits for your packages.
Implementing script
Output should look like a list of space separate pairs of user Linux IDs and package names.
100 package1
101 package1
102 package2
103 package3
package1
100
101
package1
package2
package3
Edit or modify parameter CUSTOM_GETPACKAGE_SCRIPT , and set it to point to your script, like:
CUSTOM_GETPACKAGE_SCRIPT=/absolute/path/to/your/script
For the script example please check the following article: http://kb.cloudlinux.com/2015/02/integrating-
lve-limits-with-packages-for-unsupported-control-panel/
18 Partner Portal
IP Reseller Partner UI
Once you have got the reseller partner access, in IP Reseller Partner UI you can view and manage IP
licenses, billing options, profile details. Here you can track your money balance, licenses count and
licenses prices as well as using IP address search to find customers.
Server Section
As soon as you have added funds (See Billing Info/Add Funds below) to your account you can
immediately add new licenses for clients. To add license:
1. Enter IP address in Add IP License field, choose license type in pull-down menu (CloudLinx or
KernelCare) and click Add license.
2. To delete license click on recycle bin icon in front of the needed IP-address.
To add funds:
1. Click on Add Funds near your balance or go to Billing Info/Add Funds on the top of the starting
page of your account.
2. Click Add to add credit card details, then enter funds amount and click TopUp or Process to
Check out to pay via PayPal.
When adding credit card details, you can also choose Auto add funds option - the funds amount you
choose in pull down menu will be automatically added when your balance is below $100.
If you choose Auto repay, your card will be automatically charged when your balance becomes negative.
Minimal charge is $20 (E.g. for balance -$15 - you'll be charged at $20, for balance -$134.2 - you'll be
charged at $134.2).
Note: If your balance is shown as negative, it means that you have to deposit more funds.
API Section
CloudLinux and KernelCare IP licenses adding and removing is compatible with different hosting and
domain management and billing systems and platforms. You can find comprehensive information on all
possible CloudLinux modules and plugins APIs in API Section.
Profile
You can edit your profile information by clicking on Profile section. Edit the necessary info and click
Update Account.
Sub Accounts
To create and manage sub accounts choose Sub accounts tab - you will get to Sub Accounts
Management page where all the sub accounts are displayed in the list.
To create a sub account click Add Sub Account. Fill the obligatory fields marked with the asterisk* and
click Add Sub Account in the bottom of the window.
To edit a sub account click on the wrench icon, make changes and click Edit Sub Account in the
bottom. All the fields are available for editing except the Login.
To remove a sub account click on recycle bin icon, enter login of a sub account to be removed and
click Remove Sub Account.
To manage sub account keys/servers click on a proper sub account login - you will get to the sub
account management page with two tabs: Keys and Servers.
Choose Keys tab to view Tokens and servers linked to them. Click drop-down arrow in front of a token to
view linked servers list.
To create a new key click Create k ey. To remove a key or a server click on recycle bin icon in front of a
proper item.
19 CloudLinux Network
CloudLinux Network is designed to easily manage your CloudLinux and KernelCare licenses and servers
by means of very simple and user-friendly interface.
A user can add, delete and edit licenses and track all the associated costs.
Fill out the simple registration form to create your account on https://cln.cloudlinux.com/clweb/
login.xhtml. After activation, log in to the website.
Note that in your CLN account you will see the licenses purchased directly from CloudLinux, not from
the resellers.
1. Go to Manage Licenses page by clicking on Licenses tab. If you do not have any licenses yet, then
you will see the following message "CloudLinux: You don't have any CloudLinux license".
2. Click on +Add More Licenses – you will get to CloudLinux Shopping Cart.
3. Choose the appropriate quantity of servers for CloudLinux Standart and KernelKare, choose pay
interval (yearly or monthly) for KernelCare and click Check out.
4. Choose your payment method (Credit card or PayPal), enter credit card or paypal information and
click Update. If all the information is correct, you will be able immediately to purchase licenses.
6. You can get trial unlimited activation key by clicking Get CL Unlimited Activation Key - trial
subscription will be created automatically and a notification will appear in the upper area of the page.
With unlimited key you can activate as many servers as you need, up to the number of purchased
licenses. It doesn't provide license to unlimited servers.
Click on Servers tab to get to Servers page where you can add, delete or manage your servers. Filter
your servers by IP, activation key, etc. To delete server click on bin icon in front of the server you
want to delete.
Note. When you remove a server, by click ing Remove server button, the notification appears saying
that after deleting a server you will still be paying for license for this server. To delete unused licenses
follow simple steps in Cancel Licenses section on this page below.
To add new key enter Max Servers number, add description if needed and click Add. New key will be
generated and will appear in the list below. In the Operations column four operations are available: Delete
You can cancel a license only in case if it is not in use (server under this license was not registered or
was deleted). The license is not active and can be canceled as long as the servers are not added.
2. If you need to cancel an active license, you have to remove servers first.
Go to Servers tab, mark proper checkbox in front of a server (or several) you want to remove and click
Remove servers.
Note. You will still be paying for a license after removing servers until you remove the unused license.
o Client Area
o Licenses List
o Addon Licenses List (for WHMCS 7.2.x and later)
Common Problems
20.1 Overview
CloudLinux Licenses for WHMCS allows you to automatically provision CloudLinux, Imunify360, and
KernelCare licenses along with selected products. You can provision them for free or as a paid add-on to
your product. Owing to CloudLinux Licenses add-on, all module commands on your main product are
automatically reproduced on the license product.
Add-on Functionality
Manage Relations Between Add-on And License Product
Manage Relations Between Server And License Product
Automatically Add License Product To Order When Relation Is Triggered
View Existing Licenses
Dependencies Between Module Actions - Every Action: Create, Terminate, Suspend Or Unsuspend
Called On The Server Product Will Result With The Same Action Performed On The Licensed
Products
Flexible Filtering Of Existing Licenses
Additionally
Multi-Language Support – Only Provisioning Module
Supports CloudLinux, KernelCare, and Imunify360 Licenses
Supports WHMCS V6 and Later
Beta: http://repo.cloudlinux.com/plugins/whmcs-cl-plugin-beta.zip
2. Upload archive to your WHMCS root folder and extract it. Files should automatically jump into their
places.
3. Run the following script:
php <whmcs_root>/clDeploy.php --migrate
20.3 Management
In this section you can find two ways of linking license product with your server product as well as other
possibilities of the module.
Fig 3: Configuration of product add-on, which will trigger license product adding.
4. Go to Add-ons ? CloudLinux Licenses Add-on ? Add-on Relations and click Add Relation.
5. Select previously created product add-on and license product as shown below and click Add Relation
.
Note. Please do not set up pricing for license provisioning product. In exchange, you can increase a
price for server provisioning product.
1. Prepare license provisioning product as described in the Configuration of Product section of this
documentation.
2. Go to Add-ons ? CloudLinux Licenses Add-on ? Products Relations and click Add Relation.
3. Select server provisioning product from the Main Product drop-down list and license provisioning
product from Link ed Product With License and click Add Relation.
Fig 5: Creating relations directly between server and license provisioning modules.
Below we will show you what steps to proceed to prepare such connection:
Fig 6: Creating relations directly between server and license provisioning modules.
WHMCS 7.2 introduces the ability to associate Product Add-ons with Provisioning Modules.
In order to allow your client to decide whether he wants to order server with or without license we will use
product add-on. Below we will show you what steps to proceed to prepare such connection.
20.3.5 Order
The only difference between two ways of setting up relation is the ability to order server without
CloudLinux license.
To change IP address click Change as shown on the screen above. Then specify IP address and click
Save.
You can view a list of all product add-on with Provisioning Modules licenses owned by your client at our
add-on ? Licenses List.
Note. Currently, only k ey-based licenses are available for Imunify360. Support of IP-based licenses will
be added soon.
21 Deprecated
LVE-Stats 0.x
OptimumCache
lve-stats package collects LVE usage statistics and allows to query the data.
To install, run:
If you are already running lve-stats (in case you are running cPanel LVE plugin), run:
This should also be updated automatically next time your system runs system wide update.
The package installs lvestats-server. You can re-start the server by running:
The package creates sqlite database /var/lve/lveinfo.db that stores history information about LVE usage.
Up to two months of hourly info is stored for each client. The data for the last hour is stored with 5
minutes interval, and the data for the past 10 minutes is stored with 1 minute interval.
LVE Stats updates /var/lve/info every few seconds. That info is used by LVE Manager plugin.
Package consists of lveinfo utility to query LVE usage, and lvechart that allows you to chart usage for
individual LVE.
# /usr/sbin/lveinfo [OPTIONS]
-h --help : this help screen
-v, --version : version number
-d, --display-username : try to convert LVE id into username when possible
-f, --from= : run report from date and time in YYYY-MM-DD HH:MM format
if not present last 10 minutes are assumed
-t, --to= : run report up to date and time in YYYY-MM-DD HH:MM format
if not present, reports results up to now
-o, --order-by= : orders results by one of the following:
cpu_avg : average CPU usage
cpu_max : max CPU usage
mep_avg : average number of entry processes (concurrent connections)
mep_max : max number of entry processes (concurrent connections)
vmem_avg : average virtual memory usage
vmem_max : max virtual memory usage
pmem_avg : average physical memory usage
pmem_max : max physical memory usage
nproc_avg : average number of processes usage
nproc_max : max number of processes usage
io_avg : average IO usage
io_max : max IO usage
total_mem_faults : total number of out of virtual memory faults (deprecated
since 0.8-6)
total_vmem_faults: total number of out of virtual memory faults (since 0.8-6)
total_pmem_faults: total number of out of physical memory faults (since 0.8-6)
total_mep_faults : total number of entry processes faults (deprecated since 0.8-
6)
total_ep_faults : total number of entry processes faults (since 0.8-6)
total_nproc_faults: total number of number of processes faults (since 0.8-6)
any_faults : total number of any types of faults (since 0.8-6)
--id= : LVE id -- will display record only for that LVE id
-u, --user= : Use username instead of LVE id, and show only record for that
user
-l, --limit= : max number of results to display, 10 by default
-c, --csv : display output in CSV format
-b, --by-usage : show LVEs with usage (averaged or max) within 90% percent of
the limit
available values:
cpu_avg : average CPU usage
cpu_max : max CPU usage
mep_avg : average number of entry processes (concurrent connections)
ep_avg : average number of entry processes (since 0.8-6)
mep_max : max number of entry processes (concurrent connections)
ep_max : max number of entry processes (since 0.8-6)
mem_avg : average virtual memory usage
mem_max : max virtual memory usage
vmem_avg : average virtual memory usage
vmem_max : max virtual memory usage
pmem_avg : average physical memory usage
pmem_max : max physical memory usage
nproc_avg : average number of processes
nproc_max : max number of processes
io_avg : average IO usage
io_max : max IO usage
-p, --percentage : defines percentage for --by-usage option
-f, --by-fault : show LVEs which failed on max entry processes limit or memory
limit
available values: mem, mep.
since 0.8-6 : vmem, pmem, ep, nproc
--show-all : since 0.8-6 only columns for enabled limits will show up.
-r, --threshold : in combination with --by-fault, shows only LVEs with number
Output
ID LVE Id or username
aCPU Average CPU usage
mCPU Max CPU usage
lCPU CPU Limit
aEP CPU Limit
mEP Max Entry Processes
lEP Entry Proc limit
aNPROC Average Number of Processes
mNPROC Max Number of Processes
lNPROC Number of Processes limit
aVMEM Average virtual Memory Usage
mVMEM Max virtual Memory Usage
lVMEM Virtual Memory Limit
aPMEM Average physical Memory Usage
mPMEM Max physical Memory Usage
lPMEM Physical Memory Limit
aIO Average IO usage
mIO Max IO usage
lIO IO Limit
fVMEM Out Of Virtual Memory Faults
fPMEM Out Of Physical Memory Faults
fEP Entry processes faults
fNPROC Number of processes faults
Examples
Display top 10 users, by max CPU usage, from Oct 10, 2010 to Oct 15, 2010. Display username if
possible:
You have to install MySQL-python rpm to store lve-stats on centralized server. Run:
If you have MySQL 5.3+ installed on CloudLinux 5 server, and there is no libmysqlclient_r.so.15 on the
server, run:
A typical procedure to configure the MySQL database for storing information about multiple servers for
lve-stats services looks as follows:
Create database and user. You can do it by executing the following commands:
* Execute following SQL command for each remote server for which you want to store
statistics in this database (make sure you substitute _SERVER_NAME_ with the same
servername as used in lvestats config file on remote server:
db_type = mysql
connect_string = host:database:user:password
server_id = _SERVER_NAME_
db_port = _port_
Note. lvestats.readonly should have a user that has read only access to all tables from lvestats
database.
Note. _SERVER_NAME_ should be at most 10 characters
Note. db_port is an optional parameter. Default port would be used.
Select server responsible for compacting database on regular bases by setting COMPACT=master in /
etc/sysconfig/lvestats for that server. Set COMPACT=slave on all other servers.
Make sure that /etc/sysconfig/lvestats is readable only by root (chmod 600 /etc/sysconfig/lvestats),
lvestats.readonly should be readable by anyone
Restart service:
$ /usr/share/lve-stats/save_users_to_database.py
You just need to execute it once, as it will be later executed via cron job. That script will store
usernames from each server, so that lve-stats would later be able to correctly identify each user.
If you are using MySQL or PostgreSQL server for lve-stats older then 0.8, make sure to do the following
steps to upgrade to latest version:
If you use central database to store lvestats data, execute the following commands:
$ /usr/share/lve-stats/save_users_to_database.py
You just need to execute it once, as it will be later executed via cron job. That script will store
usernames from each server, so that lve-stats would later be able to correctly identify each user.
You have to install postgresql-python rpm to store lve-stats on centralized server. Run:
Create a database and a user. You can do it by executing the following commands:
createdb <database>
createuser <user>
* Execute following SQL command for each remote server for which you want to store
statistics in this database (make sure you substitute _SERVER_NAME_ with the same
servername as used in lvestats config file on remote server:
INSERT INTO last_run(hourly, daily, server_id, lve_version) VALUES (now() AT TIME ZONE
'UTC', now() AT TIME ZONE 'UTC', '_SERVER_NAME_', 4);
On each server edit file /etc/sysconfig/lvestats and /etc/sysconfig/lvestats as follows:
db_type = postgresql
connect_string = host:database:user:password
server_id = _SERVER_NAME_
db_port = _port_
Note. lvestats.readonly should have a user that has read only access to history table.
Note. _SERVER_NAME_ should be at most 10 characters
Note. db_port is optional, default PostgreSQL port will be used
Select server responsible for compacting database on regular bases by setting COMPACT=master in /
etc/sysconfig/lvestats for that server. Set COMPACT=slave on all other servers.
Make sure that /etc/sysconfig/lvestats is readable only by root (chmod 600 /etc/sysconfig/lvestats),
lvestats.readonly should be readable by anyone.
Restart service:
$ /usr/share/lve-stats/save_users_to_database.py
You just need to execute it once, as it will be later executed via cron job. That script will store
usernames from each server, so that lve-stats would later be able to correctly identify each user.
[lve-stats 0.10+]
When you have multiple servers storing LVE statistics to a central database, then you will need to pick
one server responsible for compacting data.
On that server, edit file: /etc/sysconfig/lvestats , and change option COMPACT to master
Default: single -- should be used when lve-stats stores data to a single database.
21.2 OptimumCache
NOTE. OPTIMUMCACHE IS NO LONGER SUPPORTED.
OptimumCache 0.2+
OptimumCache is a de-duplicating file cache optimized specifically for shared hosting. Typical shared
hosting server runs a number of sites with WordPress and Joomla as well as other popular software.
This usually means that there are hundreds of duplicate files that are constantly being read into file
cache - both wasting precious disk IO operations as well as memory. OptimumCache creates a cache
of such duplicated files and de-duplicates file cache.
With OptimumCache, if a duplicate of an already loaded file is requested, the file gets loaded from
filesystem cache. By doing that, system bypasses disk IO, significantly improving the speed of reading
that file, while lowering load on the hard disk. As the file had been read from disk just once, it is cached
by filesystem cache just once, minimizing amount of duplicates in file system cache and improving
overall cache efficiency. This in turn reduces memory usage, decreases the number of disk operations -
all while improving the websites response time.
21.2.1 Installation
NOTE. OPTIMUMCACHE IS NO LONGER SUPPORTED.
Requirements:
64bit CloudLinux 6.x or higher
ext4 filesystem
kernel lve1.2.55 or later.
Installation:
# yum install optimumcache
OptimumCache must be provided with list of directories to expect duplicate files be in:
OptimumCache is going to index these directories. Thus system load during this period (from hours to
days) might be as twice as high. See 'Marking directories' [http://docs.cloudlinux.com/index.html?
marking_directories.html].
Allocating OptimumCache disk space for ploop on a fast drives (like SSD) will provide additional
performance improvement as more duplicated files would be loaded from fast disks into memory.
Example:
If ‘new size’ is not mentioned, then value from /etc/sysconfig/optimumcache is used. If /etc/sysconfig/
optimumcache does not mention anything regarding ploop image size, then default 5GB is used.
# occtl --init-ploop
To disable ploop:
# occtl --disable-ploop
If ploop image has been mounted in /etc/fstab for OpimumCache-0.1-21 and earlier, you may consider
removing this fstab entry in OpimumCache 0.2+. That is because since 0.2+ ploop is mounted
automatically at service start.
If you prefer leave that fstab mount point as is, you may see some warnings when you decide to move
ploop later via ‘occtl --move-ploop’.
Resizing ploop:
To resize ploop:
Deleting ploop:
# occtl --delete-ploop
For the case when this action cannot be completed due to “Unable unmount ploop” issue, there is a
workaround in “Troubleshooting” section.
On servers with kernel prior to lve1.2.55 ploop will not be used (due to ploop related issues in the kernel).
Instead cached files will be stored in /var/cache/optimumcache.
The cache will be cleaned (shrunk) by 20% once partition on which OPTIMUMCACHE_MNT resides has
only 10% of free space. You can change that by changing PURGEAHEAD param in /etc/sysconfig/
optimumcache, and restarting optimumcache service.
OptimumCache is going to index these directories. Thus system load during this period (from hours to
days) might be as twice as high. You can check indexing job status with 'at -l' at any time.
Sometimes you might want to ignore such checks for directories where large number of temporary or
new files are created, that will not have duplicates - as such checks are expensive. Directories like mail
queue, and tmp directories should be ignored.
You can set a regexp mask for directories that you would like to ignore using:
$ occtl --list-skip-mask
‘occtl --check’ is the same lengthy operation as ‘marking’ is. Thus, it’s usage has to be sane, especially
for big ‘home’ (>500G).
29 users_home ^/home/[^/]+/imap/
30 users_home ^/home/[^/]+/Maildir$
31 users_home ^/home/[^/]+/Maildir/
32 users_home ^/home/[^/]+/domains/[^/]+/logs$
33 users_home ^/home/[^/]+/domains/[^/]+/logs/
34 users_home ^/home/[^/]+/domains/[^/]+/public_ftp$
35 users_home ^/home/[^/]+/domains/[^/]+/public_ftp/
36 users_home ^/home/[^/]+/domains/[^/]+/stats$
37 users_home ^/home/[^/]+/domains/[^/]+/stats/
This information is stored in /etc/container/optimumcache/ignore.d/
For example, to disable caching all directories that contain */cache/*, you should use skip masks like:
/cache/
/cache$
This information is stored in /etc/container/optimumcache/ignore.d/
/etc/sysconfig/optimumcache
OPTIMUMCACHE_MNT=/var/cache/optimumcache
# Valency to cache
COUNT=0
# occtl --mark-dir or --check operations %cpu limit, default is 50% of one CPU core
# OCCTL_LVE_SPEED_LIMIT=50
optimumcache stat
or
The option '--resolve-filenames' is experimental and may not apply to all output cached entries.
Optional Arguments:
21.2.6 cloudlinux-collect
NOTE. OPTIMUMCACHE IS NO LONGER SUPPORTED.
Installing this package automatically starts system load statistics collection in background. cloudlinux-
collectl package has no strict dependency on OptimumCache, thus the statistics is collected regardless
of whether OptimumCache is installed or not. The aim of having this package pre-installed is to compare
system performance before and after installing OptimumCache, thus to measure OptimumCache
effectiveness.
Install
# yum install cloudlinux-collect --enablerepo=cloudlinux-updates-testing
Note: cloudlinux-collectl will be installed automatically on optimumcache upgrade to 0.2-23.
# cloudlinux-collect --test
Actual logs are compressed with gzip and kept in /var/log/optimumcache/collectl directory.
# cloudlinux-collect --test
Along with common statistics blocks as CPU, disk usage, inodes cached, there are two blocks of data
to watch how effectively OptimumCache is functioning.
# optimumcache stat
The next goes URLSTATTRACKER DETAIL block with url response time in milliseconds. Negative
values here may pop up unexpectedly. Negative numbers are not milliseconds, but signal about http
error response code for that specific url. For instance, -403 will signal for ‘Forbidden’ http error. As for -
500 value, it signals not only for ‘Internal Server Error’, but can be displayed, when there is connection
problem with the server, which is specified by the url.
URLSTATTRACKER DETAIL is the only statistics, which requires manual configuration. Upon clean
installation, it has only url_localhost preconfigured:
# cloudlinux-collect --info
# cloudlinux-collect --info
The statistics is being collected into files named %hostname%-%datetime%.raw.gz under directory /
var/log/cloudlinux-collect
To convert those info format suitable for loading into Excel, LibreOffice Calc, another data mining tool,
run the command:
# cloudlinux-collect --genplotfiles
For OptimumCache version prior 0.2-11, uninstalling via rpm package manager does not automatically
removes away ploop image. That is because not always possible to unmount it properly due to kernel
dependency. If there is no luck with unmounting ploop, then the server will have to be rebooted and will
need to remove ploop files manually:
# rm /var/share/optimumcache/optimumcache.image
# rm /var/share/optimumcache/DiskDescriptor.xml
# rm /var/share/optimumcache/DiskDescriptor.xml.lck
or:
# rm /path/to/ploop/image/file
# rm /path/to/ploop/image/DiskDescriptor.xml
# rm /path/to/ploop/image/DiskDescriptor.xml.lck
For OptimumCache version 0.2-11 and later, ploop image will be removed automatically during uninstall.
If ploop unmount issue prevents doing that, ploop image clean up will be scheduled after next server
reboot.
If uninstall OptimumCache process lasts for too long, please find the solution in Troubleshooting section
of this document.
21.2.8 Troubleshooting
NOTE. OPTIMUMCACHE IS NO LONGER SUPPORTED.
Also, an attempt to add for caching directory, which does not reside on Ext4, will fail:
# occtl --mark-dir /home --recursive
mount: / not mounted already, or bad option
optimumcache: Can not mount device. rc[8192]
Error: mark[1]: /usr/bin/optimumcache mark --recursive /home
High IO rate
High IO problem was fixed in latest version of OptimumCache (version 0.2-6). The fix is to eliminate
superflows fsync() calls in OptimumCache operations. To activate this fix in existing installation, flag
NOIMMSYNC=1 has to be manually set in /etc/syscoconfig/optimumcache.
To ensure that this parameter is set ON in the config, set LOGLEVEL=2 and execute ‘service
optimumcache restart’. You will see something like this:
Also, can be checked via command ‘occtl --report’, watch if PFL_REINDEX_NUM_FILES and
PFL_REINDEX_THOUGHPUT_KB identifiers are present in the last series of data:
# occtl --report
- Period starts at: 2015-02-04 17:00
Period Stat:
PFL_ATTACHED: 170318
PFL_CREATED: 161583
PFL_ERR_BAD_CSUM: 176
PFL_ERR_INODES: 879
PFL_FAILED_TO_ATTACH_PEER: 791
PFL_FAILED_TO_ATTACH_PEER_EBUSY: 791
PFL_INODE_IN: 406167
PFL_PAGEMIN_FILTERED_OUT: 233418
PFL_PAGEMIN_USED: 136082
PFL_REINDEX_NUM_FILES: 192810
PFL_REINDEX_THOUGHPUT_KB: 2904007
PFL_RESTART: 1
Uninstalling OptimumCache lasts for too long
Uninstalling OptimumCache takes time because of files unmark process, which lasts proportionally to
number of files, previously marked for caching with ‘occtl --mark-dir...’. If you see, that ‘yum remove
optimumcache’ command is stuck and you have no time to wait for it to finish, or IO load, caused by
unmarking files, is undesirable for you, open another console terminal and invoke:
# occtl --cancel-pending-jobs
This command will cancel unmark operation, being run by yum under the hood. So that yum uninstall
package transaction will complete very soon.
# occtl --remount-cached-points
22 Hardware Compatibility
CloudLinux supports all the hardware supported by RHEL/CentOS 6.x, with few exceptions. Exceptions
are usually hardware that require binary drivers, and that doesn't have any open source alternatives.
Currently Supported:
24 Downloading Documentation
This documentation is available for download:
PDF - http://docs.cloudlinux.com/cloudlinux.pdf
ePub - http://docs.cloudlinux.com/cloudlinux.epub