真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

lamp+zabbix的搭建

wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.4.6/zabbix-2.4.6.tar.gz

成武網(wǎng)站制作公司哪家好,找創(chuàng)新互聯(lián)!從網(wǎng)頁設(shè)計、網(wǎng)站建設(shè)、微信開發(fā)、APP開發(fā)、響應(yīng)式網(wǎng)站開發(fā)等網(wǎng)站項目制作,到程序開發(fā),運營維護。創(chuàng)新互聯(lián)自2013年創(chuàng)立以來到現(xiàn)在10年的時間,我們擁有了豐富的建站經(jīng)驗和運維經(jīng)驗,來保證我們的工作的順利進(jìn)行。專注于網(wǎng)站建設(shè)就選創(chuàng)新互聯(lián)

wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/3.0.1/zabbix-3.0.1.tar.gz

wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/3.0.4/zabbix-3.0.4.tar.gz

wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz

建議使用2.4.6版本,默認(rèn)支持中文

lamp+zabbix

環(huán)境

CentOS release 6.5

httpd-2.4.12.tar.bz2

cmake-2.8.10.2.tar.gz

MySQL-5.6.16.tar.gz

php-5.4.19.tar.gz

zabbix-2.2.6.tar.gz

準(zhǔn)備lamp環(huán)境

cd /usr/local/src

###################安裝編譯環(huán)境

yum -y install vim-enhanced gcc gcc-c++ flex bison autoconf automake bzip2-devel net-snmp-devel net-snmp \

ncurses-devel zlib-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel libXpm-devel \

gettext-devel  pam-devel libtool libtool-ltdl openssl openssl-devel fontconfig-devel \

libxml2-devel curl-devel  libicu libicu-devel libmcrypt libmcrypt-devel libmhash libmhash-devel

##################安裝apr(apr作用支持apache可移植環(huán)境)

tar -zxf apr-1.5.1.tar.gz

cd apr-1.5.1

./configure --prefix=/usr/local/apr

make && make install

cd ..

tar -zxf apr-util-1.5.4.tar.gz

cd apr-util-1.5.4

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/

make && make install

cd ..

##################安裝httpd

tar -xf httpd-2.4.12.tar.bz2

cd httpd-2.4.12

./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-rewrite --enable-cgi --enable-cgid --enable-modules=most \

--enable-mods-shared=most --enable-mpms-shared=all --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util

make && make install

cd ..

#################啟動httpd

/usr/local/apache/bin/apachectl start

#################安裝mysql(通過cmake編譯)

tar -xf cmake-2.8.10.2.tar.gz

cd cmake-2.8.10.2

./bootstrap --prefix=/usr/local/cmake

make && make install

cd ..

tar -zxf mysql-5.6.16.tar.gz

cd mysql-5.6.16

/usr/local/cmake/bin/cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/etc -DMYSQL_DATADIR=/usr/local/mysql/data -DMYSQL_TCP_PORT=3306 -DWITH_READLINE=1  \

-DMYSQL_UNIX_ADDR=/tmp/mysqld.sock -DMYSQL_USER=mysql -DEXTRA_CHARSETS=all -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=14

make && make install

##################初始化數(shù)據(jù)庫,啟動數(shù)據(jù)庫

cd /usr/local/mysql/

./scripts/mysql_install_db --user=mysql

cd /usr/local/src

cp -p /usr/local/src/mysql-5.6.16/support-files/my-default.cnf /etc/my.cnf

/usr/local/mysql/bin/mysqld_safe --user=mysql &

#################創(chuàng)建環(huán)境變量

cat /etc/profile.d/mysqld.sh 

export PATH=$PATH:/usr/local/mysql/bin

source /etc/profile.d/mysqld.sh

#################創(chuàng)建mysql自啟腳本

cp -p /usr/local/src/mysql-5.6.16/support-files/mysql.server /etc/init.d/mysqld

chmod +x /etc/init.d/mysqld

chkconfig --add mysqld

#################安裝php插件

#wget http://www.boutell.com/gd/http/gd-2.0.33.tar.gz 

#wget ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz 

#wget http://nchc.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.8-config.tar.gz 

#wget http://www.zlib.net/zlib-1.2.3.tar.gz 

#wget http://prdownloads.sourceforge.net/freetype/freetype-2.1.10.tar.gz?download

##############安裝zlib

tar zxf zlib-1.2.3.tar.gz 

cd zlib-1.2.3 

./configure –prefix=/usr/local/zlib 

make 

make install

cd ..

##############安裝libtool

tar -zxf libtool-1.5.20.tar.gz 

cd libtool-1.5.20

./configure 

make && make install

cd ..

##############安裝jpeg

tar -zxf jpegsrc.v6b.tar.gz

cd jpeg-6b

cp /usr/share/libtool/config/config.guess .

cp /usr/share/libtool/config/config.sub .

./configure --enable-shared  --enable-static

make

make install

cd ..

##############安裝linpng

tar zxf libpng-1.2.8.tar.gz 

cd libpng-1.2.8

mv ./scripts/makefile.linux ./makefile

make && make install

cd ..

##############安裝freetype

tar -zxf freetype-2.1.10.tar.gz

cd freetype-2.1.10

./configure --prefix=/usr/local/freetype

make && make install

cd ..

##############安裝gd

tar -zxf gd-2.0.33.tar.gz

cd gd-2.0.33

./configure --with-png --with-jpeg --with-freetype=/usr/local/freetype

make && make install

cd ..

###############安裝libmcrypt

tar -xf libmcrypt-2.5.7.tar.gz

cd libmcrypt-2.5.7

./configure --prefix=/usr/local/libmcrypt

make && make install

cd /usr/local/src/php-5.4.19/ext/mcrypt/

./configure --with-php-config=/usr/local/php/bin/php-config

make

make install

#################安裝php

tar -zxf php-5.4.19.tar.gz

cd php-5.4.19

./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config  --enable-mbregex \

--with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --with-apxs2=/usr/local/apache/bin/apxs \

--with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2 --enable-maintainer-zts --disable-fileinfo --with-gd --enable-gd-native-ttf \

--with-zlib-dir=/usr/local/zlib --with-png --with-jpeg --with-freetype-dir=/usr/local/freetype 

make && make install

###############如果出現(xiàn),以下錯誤,重新安裝zlib庫

/usr/local/zlib/lib/libz.a: could not read symbols: Bad value

collect2: ld returned 1 exit status

make: *** [libphp5.la] 錯誤 1

cd /usr/local/src/zlib-1.2.3

CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/zlib/

make

make install

make clean

################準(zhǔn)備配置文件

cp -p /usr/local/src/php-5.4.19/php.ini-production /etc/php.ini

###############修改apache配置文件,使其支持php,添加以下兩行

    AddType application/x-httpd-php .php

    AddType application/x-httpd-php-source .phps

###############配置php模塊

###############gettext模塊

cd /usr/local/src/php-5.4.19/ext

cd gettext/

/usr/local/php/bin/phpize

./configure --with-php-config=/usr/local/php/bin/php-config

make

make install

cd ..

###############bcmath模塊

cd bcmath/

/usr/local/php/bin/phpize

./configure --with-php-config=/usr/local/php/bin/php-config

make

make install

cd ..

###############mbstring模塊

cd mbstring/

/usr/local/php/bin/phpize

./configure --with-php-config=/usr/local/php/bin/php-config

make

make install

sed -i '/tab-width/a\extension = "gettext.so"\nextension = "bcmath.so"\nextension = "mbstring.so"' /etc/php.ini

###############創(chuàng)建php頁面,并判斷是否成功連接到mysql

cat /usr/local/apache/htdocs/index.php

It works!

  $conn=mysql_connect('localhost','root','123');

  if ($conn)

     echo "Connect to database successfully...";

  else

     echo "Connect to database failed...";

?>

###############重啟apache進(jìn)行測試

      elinks --dump http://192.168.110.130

    It works!

    Connect to database successfully...

cd /usr/local/src

###############安裝zabbix

groupadd zabbix

useradd -g zabbix -m zabbix

mkdir -p /etc/zabbix

###############準(zhǔn)備數(shù)據(jù)庫環(huán)境

create database zabbix character set utf8;

grant all privileges on zabbix.* to zabbix@192.168.110.130 identified by '123456';

flush privileges;

###############導(dǎo)入數(shù)據(jù)庫腳本

tar -zxf zabbix-2.2.6.tar.gz

cd /usr/local/src/zabbix-2.2.6

mysql -uzabbix  -h292.168.110.130 -p123456 zabbix < database/mysql/schema.sql

mysql -uzabbix  -h292.168.110.130 -p123456 zabbix < database/mysql/p_w_picpaths.sql

mysql -uzabbix  -h292.168.110.130 -p123456 zabbix < database/mysql/data.sql

###############編譯安裝zabbix

./configure --with-mysql=/usr/local/mysql/bin/mysql_config --with-net-snmp \

--with-libcurl --enable-server --enable-agent --enable-proxy --prefix=/usr/local/zabbix

#注:--prefix指定zabbix安裝目錄,--enable-server 支持zabbix服務(wù)器,--enable-agent支持zabbix代理,--enable-proxy 支持zabbix代理服務(wù)器,

--with-mysql 使用MySQL客戶端庫可以選擇指定路徑mysql_config,--with-net-snmp 使用net - snmp軟件包,擇性地指定路徑NET - SNMP配置, --with-libcurl 使用curl包。

make && make install

###############配置權(quán)限

cp conf/{zabbix_server.conf,zabbix_agentd.conf} /etc/zabbix

chmod 400 /etc/zabbix/zabbix_server.conf

chown zabbix /etc/zabbix/zabbix_server.conf

chown -R zabbix:zabbix /etc/zabbix

chmod 0755 /etc/zabbix/zabbix_server.conf

ln -sf /usr/local/zabbix/etc/zabbix_server.conf /etc/zabbix/zabbix_server.conf

################修改參數(shù),配置zabbix服務(wù)端

vim /etc/zabbix/zabbix_server.conf

LogFile=/tmp/zabbix_server.log

DBHost=192.168.110.130

DBName=zabbix                            zabbix所屬數(shù)據(jù)庫名稱

DBUser=zabbix                            zabbix所屬數(shù)據(jù)庫用戶

DBPassword=12345678                zabbix數(shù)據(jù)庫密碼

DBSocket=/var/lib/mysql/mysql.sock

StartPollers=30                         輪詢的初始值(0-1000)

StartIPMIPollers=4                       IPMI輪詢的初始值(0-1000)

StartPollersUnreachable=30               輪詢不可達(dá)的主機數(shù)(包括IPMI 0-1000)

StartTrappers=8                         捕獲的初始值(0-1000)

StartPingers=4                          ping的初始值(0-1000)

StartDiscoverers=0                      自動發(fā)現(xiàn)的初始值(0-250)

CacheSize=384M                          緩存大小

CacheUpdateFrequency=300                緩存更新的頻率

StartDBSyncers=8                        數(shù)據(jù)庫同步時間

TrendCacheSize=128M                     總趨勢緩存大小

AlertScriptsPath=/usr/bin               腳本的存放位置

LogSlowQueries=1000                     日志慢查詢設(shè)定

#AlertScriptsPath=/usr/local/zabbix/scripts    #指定告警腳本存放位置

################配置zabbix的php環(huán)境

cd frontends/

cp -rf  php  /usr/local/apache/htdocs/

cd /usr/local/apache/htdocs/

mv php zabbix

chown -R zabbix:zabbix zabbix

#注:vi /etc/php.ini

     date.timezone = Asia/Shanghai

sed -i "s#;always_populate_raw_post_data = -1#always_populate_raw_post_data = -1#g" /etc/php.ini

sed -i "s#;cgi.fix_pathinfo=0#cgi.fix_pathinfo=0#g" /etc/php.ini

vim /etc/php.ini

date.timezone = Asia/Shanghai

max_execution_time = 300

max_input_time = 300

post_max_size = 32M

memory_limit = 128M

#######mbstring.func_overload = 2

#################配置zabbix.conf.php #web setup.php運行后自動生成(根據(jù)環(huán)境修改)

vi /usr/local/apache/htdocs/zabbix/conf/zabbix.conf.php

// Zabbix GUI configuration file

global $DB;

$DB['TYPE']     = 'MYSQL';

$DB['SERVER']   = '192.168.110.130';

$DB['PORT']     = '0';

$DB['DATABASE'] = 'zabbix';

$DB['USER']     = 'zabbix';

$DB['PASSWORD'] = '123456';

// SCHEMA is relevant only for IBM_DB2 database

$DB['SCHEMA'] = '';

$ZBX_SERVER      = 'localhost';

$ZBX_SERVER_PORT = '10051';

$ZBX_SERVER_NAME = 'pd';

$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;

chmod 777 /usr/local/nginx/html/zabbix/conf

################配置zabbix啟動服務(wù)

cp /usr/local/zabbix/sbin/zabbix_server /etc/init.d/

cp /usr/local/zabbix/sbin/zabbix_agentd /etc/init.d/

chmod 755 /etc/init.d/zabbix_*

sed -i "s#BASEDIR=/usr/local#BASEDIR=/usr/local/zabbix#g" /etc/init.d/zabbix_server

sed -i "s#BASEDIR=/usr/local#BASEDIR=/usr/local/zabbix#g" /etc/init.d/zabbix_agentd

service zabbix_server restart

service zabbix_agentd restart

################如果啟動提示如下錯誤

/etc/init.d/zabbix_server: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /lib64/

通過web訪問http://ip/zabbix即可安裝,謝謝

################zabbix漢化版

解決zabbix中文亂碼、漢化

1、在windows中找一個自己喜歡的字體或者去網(wǎng)上下載一個字體C:\Windows\Fonts

2、將字體上傳至/usr/local/apache/htdocs/zabbix/fonts目錄下

3、修改zabbix頁面管理的中文字體設(shè)置

vim /usr/local/apache/htdocs/zabbix/include/defines.inc.php 

    define('ZBX_FONT_NAME', 'simkai');

    define('ZBX_GRAPH_FONT_NAME',  'simkai');

4、登陸頁面設(shè)置相應(yīng)用戶的默認(rèn)語言Administrator—->Users(此處要保證顯示的是用戶,否則顯示的都是用戶組)

5、點擊用戶名進(jìn)入用戶信息編輯,默認(rèn)語言選擇簡體中文,然后點擊save保存

6、刷新頁面

#注:如遇到任何錯誤,請聯(lián)系我:1742388465


分享文章:lamp+zabbix的搭建
鏈接分享:http://weahome.cn/article/ihoidg.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部