先後用了兩臺電腦來實驗,先後畫風不同,請忽略php
1、安裝php環境html
yum remove php* -y
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
ll /etc/yum.repos.d/webtatic.repo
sed -i "s/;date.timezone =/date.timezone = Asia\/Shanghai/g" /etc/php.ini sed -i "s#`grep max_execution_time /etc/php.ini`#max_execution_time = 300#g" /etc/php.ini sed -i "s#`grep post_max_size /etc/php.ini`#post_max_size = 32M#g" /etc/php.ini sed -i "s#`grep max_input_time = /etc/php.ini`#max_input_time = 300#g" /etc/php.ini sed -i "s#`grep memory_limit /etc/php.ini`#memory_limit = 128M#g" /etc/php.ini
這句報錯,沒法執行,我是用vim編輯替換的java
sed -i "s#`grep max_input_time = /etc/php.ini`#max_input_time = 300#g" /etc/php.ini
service php-fpm start
netstat -lntup|grep php-fpm
chkconfig php-fpm on
2、YUM 安裝相關依賴組件mysql
yum install -y ntpdate mailx dos2unix vim zcat wget net-snmp-utils gcc gcc-c++ autoconf httpd libxml* mysql mysql-server httpd-manual mod_ssl mod_perl mod_auth_mysql mysql-connector-odbc mysql-devel libdbi-dbd-mysql net-snmp-devel curl-devel unixODBC-devel OpenIPMI-devel java-devel fping
service mysqld start
chkconfig mysqld on
mysql -uroot -e "create database zabbix character set utf8;" mysql -uroot -e "grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';" mysql -uroot -e "flush privileges;"
groupadd zabbix -g 201 useradd -g zabbix -u 201 -m -s /sbin/nologin zabbix
rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/zabbix-release-3.2-1.el6.noarch.rpm
ll /etc/yum.repos.d/zabbix.repo
mkdir /software && cd /software wget -c --timeout=10 http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/deprecated/zabbix-server-mysql-3.2.7-1.el6.x86_64.rpm wget -c --timeout=10 http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/deprecated/zabbix-web-3.2.7-1.el6.noarch.rpm wget -c --timeout=10 http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/deprecated/zabbix-web-mysql-3.2.7-1.el6.noarch.rpm wget -c --timeout=10 http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/zabbix-agent-3.2.7-1.el6.x86_64.rpm
yum localinstall -y zabbix-server-mysql* zabbix-web-mysql* zabbix-agent zabbix-web*
cd /usr/share/doc/zabbix-server-mysql-3.2.7 zcat create.sql.gz | mysql -uroot zabbix
mysqladmin -uroot password "mysqladmin"
cd /usr/share/ cp -r ./zabbix/ /var/www/html/zabbix
echo "DBPassword=zabbix" >> /etc/zabbix/zabbix_server.conf
service httpd start service zabbix-server start service zabbix-agent start chkconfig httpd on chkconfig mysqld on chkconfig php-fpm on chkconfig zabbix-server on chkconfig zabbix-agent on
zabbix-agent 安裝失敗,從新安裝
cd /software
find / -name zabbix-agent*
rpm -ivh zabbix-agent-3.2.7-1.el6.x86_64.rpm
用戶名密碼: zabbix/zabbix
登陸 admin/zabbix