365 Hosting support | Server Management Provider

365hostingsupport ultimate source of Server Security, cPanel server management and monitoring. Since 2012 we are offering top class technical support services at lowest prices. We offer 100% Satisfaction with 7 Days Money Back Guarantee.

365 Hosting support |  Server Management Provider - 365hostingsupport ultimate source of Server Security, cPanel server management and monitoring. Since 2012 we are offering top class technical support services at lowest prices. We offer 100% Satisfaction with 7 Days Money Back Guarantee.

How to Count Apache, POP3, IMAP, SMTP and FTP connection

How to Count Apache, POP3, IMAP, SMTP and FTP connection

Using following script or command we can check it.

root@gold [~]# netstat -plan | grep :80 | awk {‘print $5’} | grep -Eo “[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}” | sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4|uniq -c | sort -nk 1 > /root/1.out; echo “Apache:”; tail -5 /root/1.out; rm -f /root/1.out; netstat -plan | grep :110 | awk {‘print $5’} | grep -Eo “[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}” | sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4|uniq -c | sort -nk 1 > /root/2.out; echo “POP3:”; tail -5 /root/2.out; rm -f /root/2.out;  netstat -plan | grep :143 | awk {‘print $5’} | grep -Eo “[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}” | sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4|uniq -c | sort -nk 1 > /root/3.out; echo “IMAP:”; tail -5 /root/3.out; rm -f /root/3.out;  netstat -plan | grep :25 | awk {‘print $5’} | grep -Eo “[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}” | sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4|uniq -c | sort -nk 1 > /root/4.out; echo “SMTP(25):”; tail -5 /root/4.out; rm -f /root/4.out;  netstat -plan | grep :26 | awk {‘print $5’} | grep -Eo “[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}” | sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4|uniq -c | sort -nk 1 > /root/5.out; echo “SMTP(26):”; tail -5 /root/5.out; rm -f /root/5.out;  netstat -plan | grep :21 | awk {‘print $5’} | grep -Eo “[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}” | sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4|uniq -c | sort -nk 1 > /root/6.out; echo “FTP:”; tail -5 /root/6.out; rm -f /root/6.out
———

And the result will be as follows:

Apache:
2 0.0.0.0
2 208.115.111.72
4 91.177.88.53
13 59.94.223.174
44 1.187.50.120
POP3:
1 0.0.0.0
IMAP:
1 0.0.0.0
SMTP(25):
1 0.0.0.0
1 1.187.50.120
SMTP(26):
FTP:
1 0.0.0.0
root@gold [~]#

 

 

 

How to install Antimalware plugin

Installing the Antimalware plugin
wget http://www.pyxsoft.com/software/antimalware/anti_malware.tar.gz
tar -xzf anti_malware.tar.gz
cd anti_malware
sh install.sh

Uninstalling the Antimalware plugin

Execute the following commands in a SSH console:

cd /usr/share/ilabs_antimalware/includes
sh uninstall.sh

After uninstall, you should verify that your apache (httpd) and ftp (pure-ftpd) services are running.

CageFS with Governor MySQL configuration

Hello,

mysql Governor configuration is located in /etc/container/mysql-governor.xml

It is best to modify it using dbctl tool.
Examples:

$ dbctl set test2 –cpu=150,100,7000,, –read=2048,1500,1000,800
sets individial 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.

All new limits will be applied immediately

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

Once configuration file is updated, please, restart the governor using:
$ service db_governor restart

Example configuration:

Quote

<governor> <!– on – governor works in LVE mode. In that mode, users that use above limit amount of resources will be placed inside a single LVE –>
<!– off – governor works in DB DISABLE mode, when restricted users will not be able to connect to MySQL until unrestricted –>
<!– To change resource usage of restricted user in LVE mode use command /usr/sbin/lvectl set 3 –cpu=<new value> –ncpu=<new value> –io=<new value> –save-all-parameters –>
<lve use=”on/off”/>

<!– connection information –>
<!– If host, login and password are not present, this information is taken from /etc/my.cnf and ~root/.my.cnf –>
<!– Use symbol specified in prefix to figure out hosting accounts (mysql username will be split using prefix_separator, and first part will be used as account name). If prefix is not set, or empty — don’t use prefixes/accounts –>

<!– 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″/>

<!– log all errors/debug info into this log –>
<log file=”/var/log/dbgovernor-error.log” mode=”DEBUG|ERROR”/>

<!– s — seconds, m — minutes, h — hours, d — days –>
<!– on restart, restrict will disappear –>
<!– log file will contain information about all restrictions that were take –>
<!– timeout – penalty period when user not restricted, but if he hit his limit during this period he will be restricted with higher level of restrict (for more long time) –>
<!- level1, level2, level3, level4 – period of restriction user for different level of restriction. During this period all user’s requests will be placed into LVE container –>
<!– if user hits any of the limits during period of time specified in timeout, higher level of restrict will be used to restrict user. If user was already on level4, level4 will be applied again –>
<!– attribute format set an restrict log format:
SHORT – restrict info only
MEDIUM – restrict info, _all_tracked_values_
LONG – restrict info, _all_tracked_values_, load average and vmstat info
VERYLONG – restrict info, _all_tracked_values_, load average and vmstat info, slow query info
–>
<!– script — path to script to be triggered when account is restricted –>
<!– user_max_connections – The number of simultaneous connections of blocked user (in LVE mode) –>
<restrict level1=”60s” level2=”15m” level3=”1h” level4=”1d” timeout=”1h”
log=”/var/log/dbgovernor-restrict.log” format=”SHORT|MEDIUM|LONG|VERYLONG”
script=”/path/to/script”
user_max_connectins=”30″/>

<!– 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 saves in /var/lve/dbgovernor-store and be 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″/>
</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>
</governor>
Regards,

Andrew

How to Enable MariaDB Cagefs

Hello,

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 –enablerepo=cloudlinux-updates-testing
$ /usr/share/lve/dbgovernor/mysqlgovernor.py –install

If you are installing CloudLinux on a server running MariaDB already, do instead:

$ yum install governor-mysql –enablerepo=cloudlinux-updates-testing
$ /usr/share/lve/dbgovernor/db-select-mysql –mysql-version=mariadb55
$ /usr/share/lve/dbgovernor/mysqlgovernor.py –install

Regards,

Andrew