概述
Zabbix大家都很熟悉,一般的是使用MySQL作为存储库来使用的,而我看使用手册上是使用postgresql也是可以的,所以就做了一次基于pg的zabbix搭建测试,记录下来,分享给大家
Server端配置
配置PG环境
安装好pg,且在root和postgres下都配置好pg的环境变量,以供后续使用
在hba控制文件中直接加入这一行
host zabbix zabbix 192.168.0.0/24 trust
host all all 127.0.0.1/32 md5
配置apache
创建user
[root@Zabbix_GW_TEST opt]# adduser apache
准备好安装包并解压
[root@Zabbix_GW_TEST opt]# ls httpd-2.4.37.tar.gz
httpd-2.4.37.tar.gz
[root@Zabbix_GW_TEST opt]# tar -xvzf httpd-2.4.37.tar.gz
编译安装
执行编译命令
[root@Zabbix_GW_TEST httpd-2.4.37]# ./configure --prefix=/usr/local/apache --enable-rewrite --enable-deflate --enable-expires --enable-headers --enable-modules=most --with-mpm=worker --enable-so
报错:
configure: error: APR not found. Please read the documentation.
解决:
yum install apr
yum install apr-util-devel
报错:
configure: error: in `/opt/httpd-2.4.37':
configure: error: C compiler cannot create executables
See `config.log' for more details
解决:
yum install gcc
问题:
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
解决:
yum -y install pcre-devel
问题:
configure: error: mod_deflate has been requested but can not be built due to prerequisite failures
解决:
yum install -y zlib-devel
以下画面说明编译成功
configure: summary of build options:
Server Version: 2.4.37
Install prefix: /usr/local/apache
C compiler: gcc -std=gnu99
CFLAGS: -pthread
CPPFLAGS: -DLINUX -D_REENTRANT -D_GNU_SOURCE
LDFLAGS:
LIBS:
C preprocessor: gcc -E
继续安装
gmake
gmake install
安装成功之后安装目录也就生成文件了
[root@Zabbix_GW_TEST apache]# ls
bin build cgi-bin conf error htdocs icons include logs man manual modules
建立脚本根目录
用来存放html信息
mkdir /home/www
chown -R apache:apache /home/www
配置运行参数
[root@nfs httpd-2.2.31]# vim /usr/local/apache/conf/httpd.conf
#监听port
Listen 80
#运营apache服务的用户及用户组,为apache
User apache
Group apache
#管理员的邮箱是
ServerAdmin 1058582934@qq.com
#配置脚本根目录
DocumentRoot "/home/www"
#配置
ServerName 127.0.0.1:80
Options FollowSymLinks
AllowOverride None
Order deny,allow
allow from all
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allo