1 |
# yum -y remove httpd* sendmail* *sasl samba* bind* |
1 |
# yum update |
1 |
# yum -y install gcc gcc-c++ make patch flex bison perl dbus-libs quota screen |
1 |
# screen |
1 |
# wget http://www.directadmin.com/setup.sh |
1 |
# chmod 755 setup.sh |
1 |
# ./setup.sh |
1 |
# yum -y install zlib-devel |
1 |
# yum -y install e2fsprogs* |
1 |
# yum install libcom_err-devel |
1 |
# cd /usr/local/directadmin/scripts |
1 |
# ./install.sh |
1 |
# iptables -F |
1 |
# iptables –S |
1 |
# /etc/init.d/iptables save |
Запуск Mysql
1 |
# /etc/init.d/mysqld start |
1 |
Starting MySQL. ERROR! The server quit without updating PID file (/var/lib/mysql/mydomain.com.pid). |
(логии смотрим в )
1 |
# tail -f /var/lib/mysql/vm2099.ovz2.ukrnames.com.err |
1 2 3 |
130927 17:05:22 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql /usr/sbin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory 130927 17:05:22 mysqld_safe mysqld from pid file /var/lib/mysql/vm2099.ovz2.ukrnames.com.pid ended |
1 |
# yum install libaio |
1 |
[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist |
1 |
# mysql_install_db |
1 |
[ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' |
1 |
# chown -R mysql:mysql /var/lib/mysql/mysql/ |
1 |
# /usr/bin/mysql_secure_installation |
1 2 |
[ERROR] Native table 'performance_schema'.'file_summary_by_event_name' has the wrong structure 130927 17:28:10 [ERROR] /usr/sbin/mysqld: Can't find file: './performance_schema/file_summary_by_instance.frm' (errno: 13) |
1 |
# chown -R mysql:mysql /var/lib/mysql/performance_schema/ |
Проверить,чтобы не было пропущенных зависимостей пакетов
1 |
# yum check |
Если есть,тогда доустановить требуемые пакеты.
http://www.directadmin.com/newinstall.html
http://External-IP-address-server/:2222/
admin
mypassword
Установка Denyhost
1 |
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm |
1 |
# yum install denyhosts |
Настройка iptables
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
iptables -N ssh iptables -N mysql iptables -N http iptables -N https iptables -N dns iptables -N pop3 iptables -N pop3s iptables -N imap iptables -N imaps iptables -N smtp iptables -N smtps iptables -N submission iptables -N ftp iptables -N directadmin iptables -I INPUT -p icmp -j ACCEPT iptables -I INPUT -i lo -j ACCEPT iptables -I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -p tcp --dport 22 -j ssh iptables -A INPUT -p tcp --dport 80 -j http iptables -A INPUT -p tcp --dport 53 -j dns iptables -A INPUT -p udp --dport 53 -j dns iptables -A INPUT -p tcp --dport 3306 -j mysql iptables -A INPUT -p tcp --dport 21 -j ftp iptables -A INPUT -p tcp -m tcp --sport 1024:65535 --dport 20 -m state --state ESTABLISHED -j ftp iptables -A INPUT -p tcp --dport 25 -j smtp iptables -A INPUT -p tcp --dport 465 -j smtps iptables -A INPUT -p tcp --dport 110 -j pop3 iptables -A INPUT -p tcp --dport 995 -j pop3s iptables -A INPUT -p tcp --dport 143 -j imap iptables -A INPUT -p tcp --dport 993 -j imaps iptables -A INPUT -p tcp --dport 587 -j submission iptables -A INPUT -p tcp --dport 2222 -j directadmin iptables -A INPUT -p tcp --dport 443 -j https iptables -A ssh -j ACCEPT iptables -A http -j ACCEPT iptables -A https -j ACCEPT iptables -A dns -j ACCEPT iptables -A mysql -j DROP iptables -A ftp -j ACCEPT iptables -A pop3 -j ACCEPT iptables -A pop3s -j ACCEPT iptables -A smtp -j ACCEPT iptables -A smtps -j ACCEPT iptables -A submissions -j ACCEPT iptables -A submission -j ACCEPT iptables -A imap -j ACCEPT iptables -A imaps -j ACCEPT iptables -I directadmin -s 159.224.XXX.YYY -j ACCEPT iptables -A directadmin -j DROP iptables -P INPUT DROP |
1 |
# iptables -S |
1 |
# /etc/init.d/iptables save |
1 |
# /etc/init.d/iptables restart |
1 |
# iptables –S |
Запуск BIND
1 |
# tail -f /var/log/messages |
1 |
# /etc/init.d/named start |
1 |
# chmod -R g+w /var/named/ |
1 |
# chown named:named rndc.key |
1 |
# /etc/init.d/named restart |
Установка Spamassassin
1 |
# yum -y install perl-ExtUtils-MakeMaker perl-Digest-SHA perl-Net-DNS perl-NetAddr-IP perl-Archive-Tar perl-IO-Zlib perl-Digest-SHA perl-Mail-SPF perl-IP-Country perl-Razor2 perl-Net-Ident perl-IO-Socket-INET6 perl-IO-Socket-SSL perl-Mail-DKIM perl-DBI perl-Encode-Detect perl-HTML-Parser perl-HTML-Tagset perl-Time-HiRes perl-libwww-perl |
1 |
# /usr/bin/spamd -d -c -m 15 |
1 |
# nano /etc/exim.conf |
1 2 3 4 5 6 7 8 9 10 11 12 |
spamcheck_director: driver = accept condition = "${if and { \ {!def:h_X-Spam-Flag:} \ {!eq {$received_protocol}{spam-scanned}} \ {!eq {$received_protocol}{local}} \ {exists{/home/${lookup{$domain}lsearch{/etc/virtual/domainowners}{$value}}/.spamassassin/user_prefs}} \ {<{$message_size}{500k}} \ } {1}{0}}" retry_use_local_part transport = spamcheck no_verify |
1 |
# nano /etc/rc.local |
1 |
/usr/bin/spamd -d -c -m 15 |
1 |
# /etc/init.d/exim restart |
Конфигурационный файл SpamAssassin
/etc/mail/spamassassin/local.cf
http://help.directadmin.com/item.php?id=36
Ошибка типа
1 |
The task.queue file does not appear to be getting processed |
http://help.directadmin.com/item.php?id=107
Установка crond
1 |
# yum -y install vixie-cron cronie |
1 |
# chmod 644 /etc/cron.d/directadmin_cron |
1 |
# /etc/init.d/crond restart |
Донастройка BIND
1 |
# nano /etc/named.conf |
1 2 3 4 5 6 |
options { …………… allow-transfer {"none";}; version "secret"; ………………. }; |
1 |
# named-checkconf /etc/named.conf |
1 |
# /etc/init.d/named restart |