zabbix3.4源码安装步骤
1.安装环境:
安装机器:22.224.9.227 以下简称监控机;
操作系统信息:内核版本:
Linux version 2.6.18-194.1.AXS3 (packager@asianux.com) (gcc version 4.1.2 20080704 (Asianux 3.0 4.1.2-48)) #1 SMP Fri May 7 10:03:53 CST 2010
发行版本:
Red Flag Asianux Server 3 for x86_64 (Quartet SP3)
由于考虑到mysql要存大量的数据,所以安装的目录要比较大,故考虑安装在weblogic/weblogic家目录下面
由于官方推荐服务端和客户端必须在不同的用户下面运行,故考虑将server端安装在monitor/monitor下面,所有的agent运行在应用用户下面
2.mysql5.6安装:weblogic/weblogic用户下面,安装目录:/app/weblogic/software/mysql5.6
直接使用原有mysql,拷贝修改相应的配置文件即可
nohup /app/weblogic/software/mysql5.6/mysql/bin/mysqld --defaults-file=http://www.likecs.com/app/weblogic/software/mysql5.6/mysql/conf/my.cnf --basedir=http://www.likecs.com/app/weblogic/software/mysql5.6/mysql --datadir=http://www.likecs.com/app/weblogic/software/mysql5.6/data --plugin-dir=http://www.likecs.com/app/weblogic/software/mysql5.6/mysql/lib/plugin --log-error=http://www.likecs.com/app/weblogic/software/mysql5.6/data/monap4.err --pid-file=http://www.likecs.com/app/weblogic/software/mysql5.6/monap4.pid --socket=http://www.likecs.com/app/weblogic/software/mysql5.6/mysql.sock --port=3306 --explicit_defaults_for_timestamp &
/app/weblogic/software/mysql5.6/mysql/bin/mysql -uroot -p --socket=http://www.likecs.com/app/weblogic/software/mysql5.6/mysql.sock
3.安裝http:
mkdir -p /app/weblogic/software/httpd-2.2.23
mkdir -p /app/weblogic/software/httpd-2.2.23/apr
mkdir -p /app/weblogic/software/httpd-2.2.23/apr-util
cd /app/weblogic/software/zabbix_setup
tar -xvf httpd-2.2.23.tar.gz
cd /app/weblogic/software/zabbix_setup/httpd-2.2.23/srclib/apr
./configure --prefix=http://www.likecs.com/app/weblogic/software/httpd-2.2.23/apr
make
make install
cd /app/weblogic/software/zabbix_setup/httpd-2.2.23/srclib/apr-util
./configure --prefix=http://www.likecs.com/app/weblogic/software/httpd-2.2.23/apr-util --with-apr=http://www.likecs.com/app/weblogic/software/httpd-2.2.23/apr
make
make install
cd /app/weblogic/software/zabbix_setup/httpd-2.2.23
./configure --prefix=http://www.likecs.com/app/weblogic/software/httpd-2.2.23 --with-apr=http://www.likecs.com/app/weblogic/software/httpd-2.2.23/apr --with-apr-util=http://www.likecs.com/app/weblogic/software/httpd-2.2.23/apr-util --enable-module=shared
make
make install
vim httpd.conf 修改配置http支持
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .php5
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
4.PHP安裝:
1.安装libiconv-1.14 php依赖
cd /app/weblogic/software/zabbix_setup/libiconv-1.14
./configure --prefix=http://www.likecs.com/app/weblogic/software/php-5.6.33/libiconv
make
make install
cd /app/weblogic/software/zabbix_setup/mhash-0.9.9.9
./configure --prefix=http://www.likecs.com/app/weblogic/software/php-5.6.33/mhash
make
make install
cd /app/weblogic/software/zabbix_setup/libmcrypt-2.5.7
./configure --prefix=http://www.likecs.com/app/weblogic/software/php-5.6.33/libmcrypt
make
make install
cd /app/weblogic/software/zabbix_setup/mcrypt-2.6.8
export LD_LIBRARY_PATH=http://www.likecs.com/app/weblogic/software/php-5.6.33/libmcrypt/lib:/app/weblogic/software/php-5.6.33/mhash/lib:/app/weblogic/software/php-5.6.33/libiconv/lib:/usr/local/lib
export LDFLAGS="-L/app/weblogic/software/php-5.6.33/mhash/lib/ -I/app/weblogic/software/php-5.6.33/mhash/include/"
export CFLAGS="-I/app/weblogic/software/php-5.6.33/mhash/include/"
./configure --prefix=http://www.likecs.com/app/weblogic/software/php-5.6.33/mcrypt --with-libiconv-prefix=http://www.likecs.com/app/weblogic/software/php-5.6.33/libiconv --with-libmcrypt-prefix=http://www.likecs.com/app/weblogic/software/php-5.6.33/libmcrypt
cd /app/weblogic/software/zabbix_setup/php-5.6.33
./configure \
--prefix=http://www.likecs.com/app/weblogic/software/php-5.6.33 \
--with-mysql \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-iconv-dir=http://www.likecs.com/app/weblogic/software/php-5.6.33/libiconv \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=http://www.likecs.com/usr \
--with-gettext \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-fpm \
--enable-mbstring \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-soap \
--enable-short-tags \
--enable-static \
--with-xsl \
--with-apxs2=http://www.likecs.com/app/weblogic/software/httpd-2.2.23/bin/apxs \
--enable-ftp \
--enable-opcache=no
make
make install