ใช้ .htaccess block xmlrpc เปิดใช้แค่ jetpack

 

# Block WordPress xmlrpc.php attacks on Apache
<Files xmlrpc.php>
order deny,allow
deny from all
# Automattic’s netblocks
allow from 216.151.209.64/26
allow from 66.135.48.128/25
allow from 69.174.248.128/25
allow from 76.74.255.0/25
allow from 216.151.210.0/25
allow from 76.74.248.128/25
allow from 76.74.254.0/25
allow from 207.198.112.0/23
allow from 207.198.101.0/25
allow from 198.181.116.0/22
allow from 192.0.64.0/18
allow from 66.155.8.0/22
allow from 66.155.38.0/24
allow from 72.233.119.192/26
allow from 209.15.21.0/24

</Files>

วิธีติดตั้ง Zabbix Server และ Zabbix agents

วิธีติดตั้ง Zabbix-server

yum -y update
yum -y install httpd httpd-devel
yum -y install mariadb-server mariadb
yum -y install php php-cli php-common php-devel php-pear php-gd php-mbstring php-mysql php-xml

#systemctl start httpd
#systemctl start mariadb.service
#systemctl enable mariadb.service

mysqladmin -u root password 123456
## 123456 ใส่พาสของ dbที่ต้องการ

ติดตั้ง repo zabbix เลือกเอาตาม version centos

CentOS/RHEL 7:
# rpm -Uvh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm

CentOS/RHEL 6:
# rpm -Uvh http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/zabbix-release-3.2-1.el6.noarch.rpm

CentOS/RHEL 5:
# rpm -Uvh http://repo.zabbix.com/zabbix/3.2/rhel/5/x86_64/zabbix-release-3.2-1.el5.noarch.rpm

 

yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-java-gateway

 

#mysql -u root -p
mysql> CREATE DATABASE zabbixdb CHARACTER SET UTF8;
mysql> GRANT ALL PRIVILEGES on zabbixdb.* to zabbix@localhost IDENTIFIED BY ‘zabbix123456’;
mysql> FLUSH PRIVILEGES;
mysql> quit

nano /etc/zabbix/zabbix_server.conf

แก้ config db
DBName=zabbixdb
DBUser=zabbix
DBPassword=Your.Password.Here

cd /usr/share/doc/zabbix-server-mysql-3.2.3
zcat create.sql.gz | mysql -u zabbix -p zabbixdb

 

systemctl start zabbix-server.service
systemctl start zabbix-agent.service
systemctl restart httpd.service
systemctl restart mariadb.service
systemctl enable zabbix-server.service
systemctl enable zabbix-agent.service

แก้ php config
nano /etc/httpd/conf.d/zabbix.conf

php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value date.timezone Asia/Bangkok

systemctl restart httpd

 

Start Zabbix Web Installer

http://localhost/zabbix/
http://127.0.0.1/zabbix/
http://domainname.com/zabbix/

 

วิธีติดตั้งฝั่ง Agent Centos

ติดตั้ง rpm
CentOS/RHEL 7:
# rpm -Uvh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm

CentOS/RHEL 6:
# rpm -Uvh http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/zabbix-release-3.2-1.el6.noarch.rpm

CentOS/RHEL 5:
# rpm -Uvh http://repo.zabbix.com/zabbix/3.2/rhel/5/x86_64/zabbix-release-3.2-1.el5.noarch.rpm

yum -y install zabbix-agent

nano /etc/zabbix/zabbix_agentd.conf

แก้ Server= เป็นไอพีเครื่อง zabbix server

 

/etc/init.d/zabbix-agent restart

 

วิธีติดคั้ง Agent debian กรณี debian 7 ขึ้นไปเท่านั้น กรณี debian อื่นต้องไปหา repo ใหม่ ใช้ร่วมกับ proxmox ที่ debian 7 ได้
cat /etc/debian_version
wget http://repo.zabbix.com/zabbix/2.0/debian/pool/main/z/zabbix-release/zabbix-release_2.0-1wheezy_all.deb
dpkg -i zabbix-release_2.0-1wheezy_all.deb
apt-get update
apt-get install zabbix-agent
service zabbix-agent restart

 

 

 

เช็คสถานะว่า zabbix เชื่อมต่อได้ไหม ทำจาก zabbix server ไปยัง zabbix agent
yum -y install zabbix-get
/usr/bin/zabbix_get -s ไอพี -p10050 -kagent.version

 

วิธีแก้ Server Error: STATUS: Internal error occurred. Refer to server log for more information.

เจอ error Server Error: STATUS: Internal error occurred. Refer to server log for more information. บน roundcube

cd /usr/local/directadmin/custombuild
./build update
./build todovecot && ./build dovecot
./build exim_conf
service exim restart