debian update i-mscp 1.0 to 1.5

Hi

Upgrade i-mscp 1.0 to 1.1 Debian to jessie

cd /usr/local/src
wget https://github.com/i-MSCP/imscp/archive/1.1.21.tar.gz
tar -xzf 1.1.21.tar.gz
cd imscp-1.1.21

#use build
perl imscp-autoinstall -c -a -d -f

rm -fR /var/www/imscp/{daemon,engine,gui}
cp -fR /tmp/imscp/* /
rm -fR /tmp/imscp

#i-mscp bug (error with external packages pma roundcube etc)
vim /var/www/imscp/engine/setup/imscp-setup-methods.pl
#[\&setupPreInstallAddons, 'Addons pre-installation'],
#[\&setupInstallAddons, 'Addons installation'],
#[\&setupPostInstallAddons, 'Addons post-installation'],

mkdir -p /var/www/imscp/gui/public/tools/filemanager/data
mkdir /var/www/imscp/gui/public/tools/pma
mkdir -p /var/www/imscp/gui/public/tools/webmail/logs

perl /var/www/imscp/engine/setup/imscp-setup -a -d

sed -i /etc/apt/sources.list -e s/wheezy/jessie/
apt-get update
apt-get dist-upgrade

Upgrade i-mscp 1.1 to 1.2 Upgrade Debian to stretch

cd /usr/local/src/
wget https://github.com/i-MSCP/imscp/archive/1.2.17.tar.gz
tar -xzf 1.2.17.tar.gz
cd imscp-1.2.17

#use build
perl imscp-autoinstall -d

rm -fR /var/www/imscp/{daemon,engine,gui}
cp -fR /tmp/imscp/* /
rm -fR /tmp/imscp

#i-mscp bug (error with external packages pma roundcube etc)
vim /var/www/imscp/engine/setup/imscp-setup-methods.pl
#[ \&setupPreInstallPackages, 'Packages pre-installation' ],
#[ \&setupInstallPackages, 'Packages installation' ],
#[ \&setupPostInstallPackages, 'Packages post-installation' ],

mkdir -p /var/www/imscp/gui/public/tools/ftp/data

perl /var/www/imscp/engine/setup/imscp-setup -d

sed -i /etc/apt/sources.list -e s/jessie/stretch/
apt update
apt dist-upgrade

Upgrade i-mscp 1.2 to 1.5

cd /usr/local/src
wget https://github.com/i-MSCP/imscp/archive/1.5.3-2018120800.tar.gz
tar -xzf 1.5.3-2018120800.tar.gz
cd imscp-1.5.3-2018120800

#use manual
perl imscp-autoinstall -d

rm -fR /var/www/imscp/{daemon,engine,gui}
cp -fR /tmp/imscp/* /
rm -fR /tmp/imscp

perl /var/www/imscp/engine/setup/imscp-reconfigure -d

Debian dist-upgrade changes mysql default charset to utf8

In this case we want latin1 as our default charset. Due to the fact that on this server runs very old software.

sed -i /etc/mysql/mariadb.conf.d/50-client.cnf -e s/utf8mb4/latin1/

sed -i /etc/mysql/mariadb.conf.d/50-mysql-clients.cnf -e s/utf8mb4/latin1/

sed -i /etc/mysql/mariadb.conf.d/50-server.cnf -e s/utf8mb4_general_ci/latin1_swedish_ci/

sed -i /etc/mysql/mariadb.conf.d/50-server.cnf -e s/utf8mb4/latin1/

Have fun!

cgroup ubuntu 18.04 howto

Install required packages

apt install cgroup-tools

copy cgred.conf from examples

cp /usr/share/doc/cgroup-tools/examples/cgred.conf /etc/

/etc/cgconfig.conf

group web2 {
cpu {
cpu.cfs_quota_us=10000;
}
memory {
memory.limit_in_bytes = 1024m;
}
}

cpu.cfs_quota_us = 10000 equals to 10% cpu usage
memory.limit_in_bytes = 1024 equals to 1G of system memory


/etc/cgrules.conf

#<user>    <controllers>           <destination>
web2 cpu,memory web2

This will limit every process of the user web2 to 10% CPU and 1G of memory.


For testing use this commands:

/usr/sbin/cgconfigparser -l /etc/cgconfig.conf
/usr/sbin/cgrulesengd -vvv

check if cgroup’s are working properly

cat /sys/fs/cgroup/cpu/web2/tasks
cat /sys/fs/cgroup/memory/web2/tasks

Here my systemd service files, install them the usual systemd way

cgconfigparser.service

[Unit]
Description=cgroup config parser
After=network.target

[Service]
User=root
Group=root
ExecStart=/usr/sbin/cgconfigparser -l /etc/cgconfig.conf
Type=oneshot

[Install]
WantedBy=multi-user.target

cgrulesgend.service

[Unit]
Description=cgroup rules generator
After=network.target cgconfigparser.service

[Service]
User=root
Group=root
Type=forking
EnvironmentFile=-/etc/cgred.conf
ExecStart=/usr/sbin/cgrulesengd
Restart=on-failure

[Install]
WantedBy=multi-user.target

reload systemd and start services

systemctl daemon-reload
systemctl enable cgconfigparser
systemctl enable cgrulesgend
systemctl start cgconfigparser
systemctl start cgrulesgend

Have fun!