1.LAMP的安裝及配置、Zabbix的安裝及配置
操作系統的選擇
CentOS 6.8
建議使用minimal desktop。
安裝mysql
yum install –y mysql-serve
編輯vim /etc/my.conf
character-set-server=uft8
innodb_file_per_table=1
啟動服務
chkconfig mysqld on
service mysqld start
b.安裝zabbix官方源和epel源
rpm -ivhhttp://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
或者在/etc/yum.repo.d/創建自定義yum源,內容如下
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=http://repo.zabbix.com/zabbix/2.2/rhel/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=http://repo.zabbix.com/non-supported/rhel/6/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1
c.安裝Zabbix-Server
yum install -y zabbix zabbix-getzabbix-server zabbix-web-mysql zabbix-web (zabbix-agent)
d.Mysql的配置
創建zabbix的數據庫
create database zabbix character set utf8;
grant allprivileges on zabbix.* to zabbix@localhost identified by ‘zabbix’;
flush privileges;
設置mysql的root密碼
mysqladmin –uroot password admin
導入zabbix-server數據庫腳本
source/usr/share/doc/zabbix-server-mysql-2.2.14/create/schema.sql
source/usr/share/doc/zabbix-server-mysql-2.2.14/create/p_w_picpaths.sql
source/usr/share/doc/zabbix-server-mysql-2.2.14/create/data.sql
e.配置PHP
由於剛剛在安裝zabbix-server已經安裝了依賴關係,因此PHP無需安裝,在/etc/php.ini設定檔中添加
date.timezone =Asia/Shanghai
max_execution_time = 300
post_max_size = 16M
max_input_time=300
memory_limit = 128M
mbstring.func_overload = 2
f. apache的安裝
yum install –y httpd
注意事項
1.防火牆打開埠10050,10051,80,22
2.Selinux的設置
转载于:https://blog.51cto.com/ivanfcl/1869529