Archive for the ‘Linux’ Category

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 192.168.0.2/24 dev enp9s4f0.100
ip route add default via 192.168.0.1

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

(more…)

centos virualmin nginx php-fpm

cd /opt
git clone https://github.com/Real-Gecko/virtualmin-nginx-fpm.git
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

[INCLUDES]
before = common.conf

[Definition]

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

ignoreregex =

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

vim jail.conf

[openfire]
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

[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc

#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 extension=mongo.so >> {}” \;

(more…)

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

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

#rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

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

#rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

#rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

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

#wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
#rpm -Uvh remi-release-7.rpm

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

Varnish

Varnish 4.0:

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

rpm –nosignature -i https://repo.varnish-cache.org/redhat/varnish-4.0.el6.rpm
yum install varnish
For RHEL 7 and compatible distributions, use:

rpm –nosignature -i https://repo.varnish-cache.org/redhat/varnish-4.0.el7.rpm
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

mass find and replace

find / -name php.ini | xargs sed -i 's/expose_php = On/expose_php = Off/g'
find / -name php.ini | xargs perl -pi -e 's/expose_php = On/expose_php = Off/i'

centos sudo path

Задовбало, в centos під sudo повні шляхи набирати.

Рішеняя.

1. Правимо в себв і під рутом
.bash_profile

2.Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR \
LS_COLORS MAIL PS1 PS2 QTDIR USERNAME \
(more…)