Archive for the ‘Linux’ Category

SnamTrap and Zabbix

Centos 6

  • edit /etc/snmp/snmptrapd.conf

disableAuthorization yes

traphandle default /usr/sbin/snmptt

snmpTrapdAddr udp:

doNotLogTraps yes

  • /etc/snmp/snmptt.ini

snmptt_conf_files = <<END

  • Add MIB in /etc/snmp/snmptt.conf

EVENT linkDown . “Status Events” Normal
FORMAT ZBXTRAP $aA Link down on interface $1. Admin state: $2. Operational state: $4
EXEC /usr/lib/zabbix/externalscripts/ $aA $1 $4

EVENT linkUp . “Status Events” Normal
FORMAT ZBXTRAP $aA Link up on interface $1. Admin state: $2. Operational state: $4
EXEC /usr/lib/zabbix/externalscripts/ $aA $1 $4


nginx selinux php-fpm error Permission denied

[crit] 24496#24496: *2747 connect() to failed (13: Permission denied) while connecting to upstream, client: , server: , request: “GET /test.php HTTP/1.1”, upstream: “fastcgi://”

[error] 24496#24496: *2731 open() index.html failed (13: Permission denied), client: , server: request: “GET /index.html HTTP/1.1”, host:


centos 7 inerface config

ip link add link enp9s4f0 name enp9s4f0.100 type vlan id 100
ip link set dev enp9s4f0.100 up
ip addr add dev enp9s4f0.100
ip route add default via

ip a

Monitoring Process and User

##Display Statistics of Users Connect Time

# ac

##Display Statistics of Users Day-wise

# ac -d

##Display Time Totals for each User

# ac -p

##Display Individual User Time

# ac tecmint

##Display Day-Wise Logn Time of User

# ac -d tecmint


centos virualmin nginx php-fpm

cd /opt
git clone
tar -zcf virtualmin-nginx-fpm.tar.gz virtualmin-nginx-fpm

Webmin menu >> Mebmin module >> Install Module >> From local file >> enter /opt/virtualmin-nginx-fpm.tar.gz >> click ‘Install Module’.

fail2ban openfire

#vim filter.d/openfire.conf

before = common.conf


failregex = ^ WARN.*org.jivesoftware.admin.LoginLimitManager – Failed admin console login attempt by admin from $

ignoreregex =

datepattern = ^%%Y.%%m.%%d %%H:%%M:%%S

vim jail.conf

enabled = true
filter = openfire
action = iptables-allports[]
logpath = /opt/openfire/logs/all.log

Install MongoDB + PHP

#vi /etc/yum.repos.d/mongodb-org-3.4.repo

name=MongoDB Repository

#yum install -y mongodb-org

#yum install php-fpm php-gd php-json php-mbstring php-mysqlnd php-xml php-xmlrpc php-opcache \
php-imagick php-posix php-devel php-pecl-mongo php-pecl-mongodb –enablerepo=remi

#find / -name php.ini -type f -exec sh -c “echo >> {}” \;


Встановлення MySQL 5.5 на RHEL / CentOS 6 или 5

Для CentOS / RHEL 5 32-64 бит

#rpm -Uvh

Для CentOS / RHEL 6 32-64 бит

#rpm -Uvh

#rpm -Uvh

Для CentOS / RHEL 7 32-64 бит

#rpm -Uvh remi-release-7.rpm

#yum update
#yum –enablerepo=remi install mysql mysql-server


Varnish 4.0:

If you are on RHEL 6 or a compatible distribution, use:

rpm –nosignature -i
yum install varnish
For RHEL 7 and compatible distributions, use:

rpm –nosignature -i
yum install varnish

Xen server mangment Vlan

xe network-create name-label=<name>

xe vlan-create network-uuid=<UUID> pif-uuid=<PIF> vlan=160

xe pif-reconfigure-ip uuid=<UUID> IP=<IP> netmask=<Mask> gateway=<GW> mode=static DNS=<NDS>

xe host-management-reconfigure pif-uuid=<PIF>



network_uuid=$(xe network-create name-label=hellnet)

pif_uuid=$(xe pif-list host-name-label=xcp-node device=eth1 –minimal)

xe vlan-create network-uuid=”$network_uuid” pif-uuid=”$pif_uuid” vlan=666

vm_uuid=$(xe vm-list name-label=network-web-tools –minimal)

xe vif-create vm-uuid=”$vm_uuid” network-uuid=”$network_uuid” mac=random device=1