aws yum安装zabbix

yum update
yum install -y autoconf make automake imake cmake gcc gcc-c++ libaio libaio-devel bzr bison expat-devel libtool ncurses5-devel gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel
yum install pcre*
yum install openssl*

cd /opt
ll
wget https://www.php.net/distributions/php-5.6.2.tar.gz
ls
tar xvf php-5.6.2.tar.gz -C /opt
ls
cd php-5.6.2
ls
./configure -prefix=/usr/local/php -with-config-file-path=/usr/local/php/etc -with-bz2 -with-curl -enable-ftp -enable-sockets -disable-ipv6 -with-gd -with-jpeg-dir=/usr/local -with-png-dir=/usr/local -with-freetype-dir=/usr/local -enable-gd-native-ttf -with-iconv-dir=/usr/local -enable-mbstring -enable-calendar -with-gettext -with-libxml-dir=/usr/local -with-zlib -with-pdo-mysql=mysqlnd -with-mysqli=mysqlnd -with-mysql=mysqlnd -enable-dom -enable-xml -enable-fpm -with-libdir=lib64 -enable-bcmath
make
make install
ls
cp php.ini-production /usr/local/php/etc/php.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
/usr/local/php/sbin/php-fpm -t
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod 755 /etc/init.d/php-fpm
service php-fpm start
netstat -anulpt | grep 9000

yum install -y mysql57-server 因为一直报文件冲突,我直接装的这个
service mysqld start
netstat -anplut | grep 3306

vim /usr/local/php/etc/php.ini date.timezone = PRC #设置时区

yum install -y nginx
vim /etc/nginx/nginx.conf
添加个 index.php
location ~ .php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/$fastcgi_script_name;
include fastcgi_params;
}
service nginx restart
看网页是否生效

在/usr/share/nginx/html里添加index.php
vim /usr/share/nginx/html/index.php

<?php phpinfo(); ?>

service nginx restart

网络源安装zabbix
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/6/x86_64/zabbix-release-3.4-1.el6.noarch.rpm
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-get zabbix-agent

以安装php nginx mysql zabbix

chown -R zabbix:zabbix /etc/zabbix
chown -R zabbix:zabbix /usr/share/zabbix
chown -R zabbix:zabbix /usr/lib/zabbix
chmod -R 755 zabbix/
chmod -R 777 /usr/share/nginx
cp -a /usr/share/zabbix /usr/share/nginx/html

cd /usr/share/doc/zabbix-server-mysql-3.4.15
gunzip create.sql

mysql导入zabbix 表
create databases
use zabbix
source /usr/share/doc/zabbix-server-mysql-3.4.15/create.sql

配置mysql密码
mysql -uroot -p 进入数据库
set password=password(‘redhat’);
在mysql里创建zabbix用户
grant all privileges on zabbix.* to ‘zabbix’@‘localhost’ identified by ‘redhat’;
grant all on zabbix.* to ‘zabbix’@‘127.0.0.1’ identified by ‘redhat’ with grant option;
flush privileges;

修改zabbix-server 配置文件
/etc/zabbix/zabbix_server.conf
DBName=zabbix #数据库名称
DBUser=zabbix #数据库用户名
DBPassword=zabbix #数据库密码
ListenIP=127.0.0.1 #数据库ip地址

修改php.ini 配置文件
vi /usr/local/php/etc/php.ini
post_max_size =16M
max_execution_time =300
max_input_time =300
always_populate_raw_post_data=-1 解注释
extension=ldap ? 未更改这行

http://18.136.202.155/zabbix/
没有出现setup界面
权限有问题,挨个查看zabbix与NGINX的文件权限
chmod -R 777 /etc/zabbix/web
看下列文件权限是否足够
/etc/zabbix
/usr/share/zabbix
/usr/lib/zabbix
/usr/share/nginx

http://IP/zabbix

aws yum安装zabbix
aws yum安装zabbix
aws yum安装zabbix

账号:Admin
密码:zabbix