innodb_buffer_pool_size

SELECT CEILING(Total_InnoDB_Bytes*1.6/POWER(1024,3)) RIBPS FROM
(SELECT SUM(data_length+index_length) Total_InnoDB_Bytes
FROM information_schema.tables WHERE engine='InnoDB') A;

mysql>     SELECT CEILING(Total_InnoDB_Bytes*1.6/POWER(1024,3)) RIBPS FROM
    ->     (SELECT SUM(data_length+index_length) Total_InnoDB_Bytes
    ->     FROM information_schema.tables WHERE engine='InnoDB') A;
+-------+
| RIBPS |
+-------+
|     8 |
+-------+
1 row in set (4.31 sec)

mysql>

innodb_buffer_pool_size=8G

VestaCP Install CentOS 7

Generate Install Command: https://vestacp.com/install/

# Connect to your server as root via SSH

ssh root@your.server

# Download installation script

curl -O http://vestacp.com/pub/vst-install.sh

# Run it


sudo yum erase httpd
sudo yum erase httpd-tools
sudo yum remove awstats
sudo yum remove webalizer
sudo yum remove yum-cron
sudo yum remove audit

bash vst-install.sh --nginx no --apache yes --phpfpm no --named no --remi no --vsftpd no --proftpd no --iptables no --fail2ban no --quota no --exim no --dovecot no --spamassassin no --clamav no --softaculous no --mysql no --postgresql no

# Imagick


yum install php-pear
yum install php-devel
yum install gcc
yum install ImageMagick
yum install ImageMagick-devel
yum install ImageMagick-perl
pecl install Imagick

vi /etc/php.ini

extension=imagick.so –> add it into php.ini

restart server

# PDO: PHP Fatal error: Class ‘PDO’ not found

yum install php-pdo
yum install php-pdo_mysql

service httpd restart

# Image-ExifTool

Can’t locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 1.
BEGIN failed–compilation aborted at Makefile.PL line 1.

yum install perl-devel

# Webp

Error:
/lib64/libc.so.6: version `GLIBC_2.14′ not found (required by /libwebp-0.5.2-linux-x86-64/bin/cwebp)

yum install glibc

Error:
error while loading shared libraries: libXi.so.6: cannot open shared object file: No such file or directory

yum install libXtst

# Updates

Disable all updates

#Clear systemd journal – /var/log/journal

Clearing everything holder than say 10 days.

journalctl --vacuum-time=10d

# Disable User Backup

remove this cron job

sudo /usr/local/vesta/bin/v-backup-users

# To remove them


sudo yum remove perl-libwww
sudo yum remove rsyslog
sudo yum remove mod_fcgid
sudo yum remove awstats
sudo yum remove webalizer
sudo yum remove sendmail
sudo yum remove tuned
sudo yum remove audit
sudo yum remove php-imap

sudo vi /usr/local/vesta/conf/vesta.conf

Remove this line: STATS_SYSTEM=’webalizer,awstats’

# To modify conf

/etc/httpd/conf.modules.d/00-base.conf

# to change 8083 port

/usr/local/vesta/nginx/conf/nginx.conf
service vesta restart

# mpm configuration

sudo apachectl -t -D DUMP_MODULES | grep mpm

[so:warn] [pid 2295] AH01574: module ruid2_module is already loaded, skipping
mpm_prefork_module (shared)

if you get the previos error, you need to disable mod_ruid2 module via the following config file.

sudo vi /etc/httpd/conf.modules.d/10-mod_ruid2.conf

sudo service httpd reload

Extra Info: grep mod_ruid2 -rI /etc/* , this command shows you where mod_ruid2 is loaded.

sudo vi /etc/httpd/conf/httpd.conf

<IfModule prefork.c>
KeepAlive On
StartServers 5
MinSpareServers 5
MaxSpareServers 10
ServerLimit 20000
MaxRequestWorkers 7000
MaxConnectionsPerChild 50000
KeepAliveTimeout 5
MaxKeepAliveRequests 100
Timeout 300
</IfModule>

sudo service httpd reload

Setup Pritunl on CentOS 7

https://www.vultr.com/docs/installing-pritunl-on-centos-7
https://docs.pritunl.com/docs/installation

– Deactivate firewall

iptables-save > ~/firewall.rules
systemctl stop firewalld.service
systemctl disable firewalld.service

– Deactivate NetworkManager

systemctl stop NetworkManager.service
systemctl disable NetworkManager.service
systemctl enable network.service
systemctl start network.service

sudo tee /etc/yum.repos.d/mongodb-org-4.0.repo << EOF [mongodb-org-4.0] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.0/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc EOF sudo tee /etc/yum.repos.d/pritunl.repo << EOF [pritunl] name=Pritunl Repository baseurl=https://repo.pritunl.com/stable/yum/centos/7/ gpgcheck=1 enabled=1 EOF sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 7568D9BB55FF9E5287D586017AE645C0CF8E292A gpg --armor --export 7568D9BB55FF9E5287D586017AE645C0CF8E292A > key.tmp; sudo rpm --import key.tmp; rm -f key.tmp
sudo yum -y install pritunl mongodb-org
sudo systemctl start mongod pritunl
sudo systemctl enable mongod pritunl

pritunl setup-key
https://YOUR_IP_ADDRESS

Speed Up WHM Server

1. Disable Stats Programs

stats-programs

2. Disable Piped Log Configuration

piped-log

3. Disable Mod Security
http://www.jotform.org/general/disable-mod-security-whm/

4. Disable Features | Home » Packages » Feature Manager » Edit Feature List

– Awstat
– Bandwidth Stats
– Leech Protect
– Disk Usage Viewer
– CPU and Concurrent Connection Usage
– Webalizer

5. Disable cPanel Updates

Home » Server Configuration » Update Preferences