yum install epel-release -y
yum install tmux -y
tmux
hostnamectl set-hostname host_name
systemctl restart systemd-hostnamed
hostnamectl status
timedatectl set-timezone Europe/Moscow или Europe/Berlin
yum update -y
yum install net-tools vim wget man vim-enhanced screen mc telnet wget crontabs openssh-clients mailx sudo make gcc htop nmon sysstat sysbench hdparm lsof -y
firewall-cmd --list-all
yum install firewalld -y
systemctl enable firewalld
systemctl start firewalld
firewall-cmd --permanent --zone=public --remove-service=dhcpv6-client
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --permanent --zone=public --remove-service=cockpit
firewall-cmd --reload
vim /etc/ssh/sshd_config
## Port 22 -> Port 22222
vim /usr/lib/firewalld/services/ssh.xml
<port protocol="tcp" port="22222"/>
systemctl restart sshd && systemctl restart firewalld
yum install fail2ban -y
systemctl enable fail2ban
systemctl start fail2ban
systemctl status fail2ban
echo '
[DEFAULT]
# Ban hosts for one hour:
bantime = 3600
# Override /etc/fail2ban/jail.d/00-firewalld.conf:
banaction = iptables-multiport
[sshd]
enabled = true' > /etc/fail2ban/jail.local
systemctl restart fail2ban
sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/sysconfig/selinux
setenforce 0
sysctl vm.swappiness=10
echo 'vm.swappiness = 10' >> /etc/sysctl.conf
//Да можно использовать sysctl -p, но мне нравится так
yum install httpd -y
systemctl enable httpd
systemctl start httpd
echo '
# MariaDB 10.4 CentOS repository list - created 2020-06-19 21:29 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1’ > /etc/yum.repos.d/MariaDB.repo
yum install MariaDB-server MariaDB-client MariaDB-devel -y
[mysqld]
max_allowed_packet = 100M
………………..
[mysqldump]
max_allowed_packet = 100M
systemctl start mariadb
systemctl enable mariadb
systemctl status mariadb
mysql_secure_installation
# Install the repository RPM:
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# Install PostgreSQL:
yum install postgresql12-server postgresql12-contrib postgresql12-devel postgresql12
# Optionally initialize the database and enable automatic start:
/usr/pgsql-12/bin/postgresql-12-setup initdb
systemctl enable postgresql-12
systemctl start postgresql-12
vim /var/lib/pgsql/12/data/pg_hba.conf
Меняем #host all all 127.0.0.1/32 ident
На host all all 127.0.0.1/32 md5
sudo -u postgres pqsl
alter role postgres with password ‘свой_пароль’;
\q
systemctl restart postgresql-12
yum install fetchmail perl-URI mod_perl perl-libwww-perl perl-Net-DNS perl-IO-Socket-SSL \
perl-XML-Parser perl-DBI procmail perl-DateTime-Format-DateParse perl-core perl-Crypt-SSLeay \
perl-POEComponent-Client-LDAP perl-JSON-XS perl-Mail-IMAPClient perl-PDF-API2 perl-Text-CSV_XS \
perl-Digest-SHA perl-LDAP perl-GDGraph perl-Encode-HanExtra perl-Text-CSV perl-Crypt-Eksblowfish \
perl-YAML-LibYAML fcgi perl-Archive-Zip perl-Template-Toolkit perl-XML-LibXSLT bash-completion \
perl-DBD-Pg perl perl-File-MimeInfo perl-Mojolicious perl-DBD-MySQL -y
#Cтавим cpanm
yum install perl-App-cpanminus -y
#Обновляем cpanm
cpanm App::cpanminus
#Удаляем cpanm установленный из репо
yum erase perl-App-cpanminus
#Создаем линк для новой версии
ln -s /usr/local/bin/cpanm /bin/cpanm
#Ставим cpanoutdated
cpanm App::cpanoutdated
#Обновляем все пакеты, которые считаются устаревшими
/usr/local/bin/cpan-outdated -p | cpanm
#Поскольку outdated обновляет не все пакеты, то дальше руками
cpanm Apache::DBI Apache2::Reload Archive::Tar Archive::Zip Crypt::Eksblowfish::Bcrypt Crypt::SSLeay Date::Format DateTime DBI DBD::Pg Digest::SHA Encode::HanExtra JSON::XS List::Util::XS LWP::UserAgent Mail::IMAPClient IO::Socket::SSL Authen::SASL Authen::NTLM ModPerl::Util Net::DNS Net::LDAP Net::SMTP Template Template::Stash::XS Text::CSV_XS Time::HiRes XML::LibXML XML::LibXSLT XML::Parser YAML::XS
cpanm Archive::Zip XML::LibXML DBD::File Moo Date::Calc
wget https://ftp.otrs.org/pub/otrs/RPMS/rhel/7/otrs-6.0.28-01.noarch.rpm
rpm -ivh otrs-6.0.28-01.noarch.rpm
systemctl restart httpd
/opt/otrs/bin/Cron.sh start otrs
crontab -u otrs -l