Установка временной зоны Centos 7
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Europe/Moscow /etc/localtime
date
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Europe/Moscow /etc/localtime
date
yum -y update
yum install -y epel-release
yum install -y net-tools vim
yum install -y ppp pptp pptpd pptp-setup
chkconfig pptpd on
mv /etc/pptpd.conf /etc/pptpd.conf.bak
vim /etc/pptpd.conf
option /etc/ppp/options.pptpd
logwtmp
localip 10.0.10.1
remoteip 10.0.10.2-254
mv /etc/ppp/options.pptpd /etc/ppp/options.pptpd.bak
vim /etc/ppp/options.pptpd
name pptpd
refuse-pap
refuse-chap
refuse-mschap
#require-chap
#require-mschap
#require-mschap-v2
require-mppe-128
require-mschap-v2
proxyarp
lock
nobsdcomp
novj
novjccomp
nologfd
ms-dns 8.8.8.8
ms-dns 8.8.4.4
mv /etc/ppp/chap-secrets /etc/ppp/chap-secrets.bak
vim /etc/ppp/chap-secrets
# Secrets for authentication using CHAP
# client server secret IP addresses
test * test *
vim /usr/lib/sysctl.d/50-default.conf
net.ipv4.ip_forward=1
vim /etc/selinux/config
SELINUX=disabled
firewall-cmd --permanent --add-masquerade
firewall-cmd --zone=public --add-port=1723/tcp --permanent
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p gre -j ACCEPT
firewall-cmd --permanent --direct --add-rule ipv6 filter INPUT 0 -p gre -j ACCEPT
firewall-cmd --reload
yum install lame
lame -h -b 32 test.wav test.mp3
#!/bin/sh
#convert wav to mp3 asterisk recordings
cdrdb="asteriskcdrdb"
user="freepbxuser" #пользователь субд для отчетов
pass="password" #пароль пользователя субд
for i in `find /var/asterisk/spool/monitor -type f -name "*.wav"`
do
if [ -e "$i" ]; then
file=`basename "$i" .wav`;
dir=`dirname "$i"`;
lame -h -b 32 "$i" "$dir/$file.mp3";
rm -f "$dir/$file.wav";
mysql -u $user -p$pass --execute='use asteriskcdrdb;UPDATE cdr SET recordingfile="'$file'.mp3" WHERE recordingfile="'$file'.wav";';
fi
done
yum update
yum install epel-release
yum install fail2ban
systemctl enable fail2ban
systemctl restart fail2ban
yum -y install python python-pip python-devel libxml2
yum -y libxml2-devel python-setuptools zlib-devel wget
yum -y openssl-devel pcre pcre-devel gcc make autoconf automake
pip install uwsgi
yum -y install nginx
pip install virtualenv
systemctl enable nginx.service
systemctl start nginx.service
yum install -y mariadb mariadb-server net-tools
systemctl enable mariadb.service
yum install -y php-devel
yum groupinstall 'Development Tools'
vim /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
yum update
yum install MariaDB-server MariaDB-client
systemctl enable mariadb.service
systemctl start mariadb
mysql_secure_installation
#!/bin/bash
##Global vars
threshold=90 ##Порог критического значения свободного места, после 90% шлем уведомление
subject="Disk status $( hostname )"
temp_file=/tmp/disk_status
##Function : check_disk_space
##Description : it will check all partitions and it will return # non-zero exist status if use >= threshold
check_disk_space(){
awk -v threshold=$threshold 'BEGIN{
status = 0
cmd = "LC_ALL=C df -Ph"
while( cmd | getline ) {
used=$5
if ( $1 != "Filesystem" && int(used) >= threshold ) {
printf "CRITICAL : Disk space alert (%s) :: [ Partition %s | mount point %s ]n",
used,$1, $NF > "/dev/stderr"
status = 1
}
}
exit status
}'
}
check_disk_space > $temp_file 2>&1
if [[ -s $temp_file ]]
then
mail -s $subject admins < $temp_file
fi
[DEFAULT]
backend = gamin
cd /usr/src
git clone https://github.com/fail2ban/fail2ban.git
cd fail2ban/
python setup.py install
service fail2ban restart
vim /etc/fail2ban/filter.d/elastix-login.conf
[Definition]
#_daemon = asterisk
# Option: failregex
# Notes.: regex to match the password failures messages in the logfile. The
# host must be matched by a group named "host". The tag "" can
# be used for standard IP/hostname matching and is only an alias for
# (?:::f{4,6}:)?(?P\S+)
# Values: TEXT
#[Jul 14 20:47:04] LOGIN asdf: Authentication Failure to Web Interface login. Invalid user asdf from 192.168.0.100.
#[Nov 10 20:56:01] LOGIN admin: Authentication Failure to Web Interface login. Failed password for admin from 37.176.189.82.
#
failregex = LOGIN .*: Authentication Failure to Web Interface login. Invalid user .* from <HOST>.
LOGIN .*: Authentication Failure to Web Interface login. Failed password for .* from <HOST>.
ignoreregex =
[elastix]
enabled = true
filter = elastix-login
action = iptables-multiport[name=NoLoginFailures, port="http,https"]
logpath = /var/log/elastix/audit.log
bantime = 3600
maxretry = 3
# yum list installed | grep php
# yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64
# rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm
# rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
# yum list available | grep php
# yum list available | grep php54
# yum install php55w.x86_64 php55w-cli.x86_64 php55w-common.x86_64 php55w-gd.x86_64 php55w-ldap.x86_64 php55w-mbstring.x86_64 php55w-mcrypt.x86_64 php55w-mysql.x86_64 php55w-pdo.x86_64
# php -v
PHP 5.5.38 (cli) (built: Jul 21 2016 13:42:32)
Copyright © 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright © 1998-2015 Zend Technologies
# service httpd restart
W: GPG error: http://www.debian-multimedia.org squeeze Release:
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 07DC563D1F41B907
# apt-get install debian-keyring
# gpg --keyring /usr/share/keyrings/debian-keyring.gpg -a --export 07DC563D1F41B907 |apt-key add -
# brctl show
bridge name bridge id STP enabled interfaces
bridge0 8000.00a0d1e848c4 no eth0
vnet0
vnet1
bridge1 8000.00a0d1e848c5 no eth1
[client]
port = 3306
default-character-set=utf8
[mysqld]
port = 3306
init_connect='SET collation_connection = utf8_general_ci'
init_connect='SET NAMES utf8'
default-character-set=utf8
character-set-server = utf8
collation-server = utf8_general_ci
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
old_passwords=1
[mysql]
default-character-set=utf8
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
E: Could Not Get Lock /var/lib/apt/lists/lock
sudo rm /var/lib/apt/lists/lock
sudo apt-get clean
sudo apt-get update
http://dl.atrpms.net/el6-x86_64/atrpms/stable/
# rpm -Uvh atrpms-repo*rpm
# yum install firebird-superclassic
tar xvjf Firebird-2.5.1.26351-0.tar.bz2
cd Firebird-2.5.1.26351-0
yum update
yum install gcc gcc-cpp gcc-c++
yum install libtermcap-devel libstdc++-devel libtool ncurses-dev libstdc++-devel libicu