-
- 安装配置mysql
/etc/init.d/iptables stop
chkconfig iptables off
setenforce 0
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
cd /opt
yum -y remove mysql-libs.x86_64
yum install wget -y
wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
rpm -ivh mysql-community-release-el6-5.noarch.rpm
yum install mysql-community-server -y
yum install crontabs.noarch -y
yum install ntpdate -y
sed '22acharacter-set-server=utf8\ncollation-server=utf8_general_ci' /etc/my.cnf -i
chkconfig mysqld on
service mysqld start
mysql -e 'create database zabbix character set utf8 collate utf8_bin;'
mysql -e "grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';"
mysql -e "flush privileges;"
-
- 安装配置php
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/Packages/l/libmcrypt-2.5.8-9.el6.x86_64.rpm
rpm -ivh libmcrypt-2.5.8-9.el6.x86_64.rpm
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 php56w-fpm php56w-bcmath -y
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64 php56w-fpm -y
service php-fpm start
chkconfig php-fpm on
-
- 安装apache
yum install httpd -y
echo "ServerName 127.0.0.1:80">>/etc/httpd/conf/httpd.conf
service httpd start
chkconfig httpd on
-
- 安装zabbix
rpm -i http://repo.zabbix.com/zabbix/3.4/rhel/6/x86_64/zabbix-release-3.4-1.el6.noarch.rpm
yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get -y
yum -y install net-snmp net-snmp-libs net-snmp-devel net-snmp-utils
rpm -ivh wqy-microhei-fonts-0.2.0-0.14.beta.el6.noarch.rpm
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -pzabbix zabbix
sed -i.bak 's@# DBHost=localhost@DBHost=localhost@g' /etc/zabbix/zabbix_server.conf
sed -i.bak 's@# DBPassword=@DBPassword=zabbix@g' /etc/zabbix/zabbix_server.conf
\cp /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf
sed -i.ori 's#max_execution_time = 30#max_execution_time = 300#;s#max_input_time = 60#max_input_time = 300#;s#post_max_size = 8M#post_max_size = 16M#;910a date.timezone = Asia/Shanghai' /etc/php.ini
wget http://repo.webtatic.com/yum/el6/x86_64//php56w-bcmath-5.6.33-1.w6.x86_64.rpm
rpm -ivh php56w-bcmath-5.6.33-1.w6.x86_64.rpm
yum install php56w-xml -y
sed -i 's#;always_populate_raw_post_data = -1#always_populate_raw_post_data = -1#g' /etc/php.ini
cp -R /usr/share/zabbix/ /var/www/html/
chmod -R 755 /etc/zabbix/web
chown -R apache.apache /etc/zabbix/web
/etc/init.d/php-fpm restart
/etc/init.d/httpd restart
sed 's@# CacheSize=8M@CacheSize=2048M@g' /etc/zabbix/zabbix_server.conf -i
sed 's@# ValueCacheSize=8M@ValueCacheSize=2048M@g' /etc/zabbix/zabbix_server.conf -i
/etc/init.d/zabbix-server start
chkconfig zabbix-server on
/etc/init.d/zabbix-agent start
chkconfig zabbix-agent on