- 安装PHP、mysql
yum install php php-cli php-common php-devel php-pear php-gd php-mbstring php-mysql php-xml mysql-server
更改PHP设置:
sed -i "s/;date.timezone =/date.timezone = Asia\/Shanghai/g" /etc/php.ini
sed -i "s#max_execution_time = 30#max_execution_time = 300#g" /etc/php.ini
sed -i "s#post_max_size = 8M#post_max_size = 32M#g" /etc/php.ini
sed -i "s#max_input_time = 60#max_input_time = 300#g" /etc/php.ini
sed -i "s#memory_limit = 128M#memory_limit = 128M#g" /etc/php.ini
sed -i "/;mbstring.func_overload = 0/ambstring.func_overload = 2\n" /etc/php.ini - 安装zabbix
rpm -Uvh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-java-gateway - 安装nginx
yum -y install epel-release
yum -y install nginx - 初始化 Mysql 数据库
# mysql -u root -p
# mysql> CREATE DATABASE zabbix CHARACTER SET UTF8;
# mysql> GRANT ALL PRIVILEGES on zabbix.* to ‘zabbix‘@‘localhost‘ IDENTIFIED BY ‘SECRET_PASSWORD‘;
# mysql> FLUSH PRIVILEGES;
# mysql> quit
导入zabbix的数据结构
# mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.2.9/create/schema.sql
# mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.2.9/create/images.sql
# mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.2.9/create/data.sql - 修改zabbix配置文件,使其能访问数据库
# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix - 重启zabbix
service zabbix-server start
网站配置文件默认路径:
/usr/share/zabbix - 设置nginx能访问zabbix
cd /usr/share/nginx/html
ln -s /usr/share/zabbix zabbix
删除软链接 rm -rf zabbix 注意不是 rm -rf zabbix/ - 官方网站:https://www.zabbix.com/documentation/2.4/manual/installation/install_from_packages
时间: 2024-10-05 21:49:48