码迷,mamicode.com
首页 > 其他好文 > 详细

zabbix 安装

时间:2017-10-26 11:38:42      阅读:189      评论:0      收藏:0      [点我收藏+]

标签:lib   configure   用户   creat   doc   url   load   glibc   int   

【前言】
epel 源:
阿里云
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum 源:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
一、LNMP 之 nginx 安装
1)依赖包:
yum install openssl openssl-devel pcre pcre-devel
2)下载nginx
3)解压并进入目录
tar xf ......
cd .......
4)建用户
useradd nginx -g nginx -s /sbin/nologin -M
5)编译并安装
mkdir /application
./configure --user=myssql --with-http_stub_status_module --with-http_ssl_module --prefix=/application/nginx
make && make install
二、LNM 之 MySQL 安装
1)依赖包
yum install ncurses-devel –y
2)下载、解压并进入目录
wget ./mysql-5.6.14-linux-glibc2.5-x86_64.tar.gz
tar xf mysql-5.6.14-linux-glibc2.5-x86_64.tar.gz
cd mysql-5.6.14-linux-glibc2.5-x86_64
3)初始化数据库并配置my.cnf、mysql.server
./mysql_install_db --user=mysql --basedir=/application/mysql --datadir=/application/mysqldata --defaults-file=/etc/my.cnf
mysql.server ------启动数据库的脚本
my-default.cnf 配置文件,直接复制到 /etc/my.cnf
配置 my.cnf
basedir = /application/mysql
datadir = /application/mysql/data
port = 3306
# server_id = .....
socket = /tmp/mysql.sock
配置 mysql.server
basedir = /application/mysql
datadir = /application/mysql/data
4)启动数据库并测试
./mysql.server start
mysql -uroot -p
[root@localhost tmp]# mysql -uroot -p123456
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 796
Server version: 5.6.14 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.
mysql>
数据库安装完毕!!!!!!!
三、LNMP 之 PHP 安装
1)依赖包
yum install –y libxml2-devel gd-devel libmcrypt-devel libcurl-devel libjpeg-devel libpng-devel libtool-ltdl-devel libticonv-devel *iconv* bzip2 bzip2-devel
2)下载、解压并进入目录
5.5.25
3)编译并安装
./configure --prefix=/application/php --with-config-file-path=/application/php/etc --with-bz2 --with-curl --enable-ftp --enable-sockets --disable-ipv6 --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/local --enable-gd-native-ttf --with-iconv-dir=/usr/local --enable-mbstring --enable-calendar --with-gettext --with-libxml-dir=/usr/local --with-zlib --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql=mysqlnd --enable-dom --enable-xml --enable-fpm --with-libdir=lib64 --enable-bcmath
make && make install
4)配置 php.ini
max_execution_time = 300
memory_limit = 128M
post_max_size = 16M
upload_max_filesize = 2M
max_input_time = 300
date.timezone = PRC
5)启动测试
/application/php/sbin/php-fpm
ss -lntup|grep php
ps -ef |grep php
六、LNMP 之 nginx 整合 php
vi nginx.conf
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 

 

第二步:安装服务端

 

一、依赖包
yum install -y mysql-devel libxml2-devel curl-devel unixODBC-devel net-snmp-devel OpenIPMI-devel
二、下载zabbix 2.2.2
tar xf zabbix2.2.2.tar.gz
cd zabbix
四、编译
./configure --prefix=/application/zabbix/ --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2
五、安装
make &&make install
六、配置
1)创建ZABBIX用户
useradd zabbix -g zabbix -s /sbin/nologin -M
2)建库并导入数据
mysql -uroot -p123456
create database zabbix default charset utf8;
grant all privileges on zabbix.* to zabbix@localhost identified "123456";
quit
mysql -uroot -pttlsapwd zabbix < database/mysql/schema.sql
mysql -uroot -pttlsapwd zabbix < database/mysql/images.sql
mysql -uroot -pttlsapwd zabbix < database/mysql/data.sql
3)配置zabbix_server.conf
vi /application/zabbix/etc/zabbix_server.conf
DBName=zabbix
DBUser=root
DBPassword=123456
DBPort=3306
七、启动zabbix
/application/zabbix/sbin/zabbix_server

 第三步:安装客户端

 

# cd /usr/local/src

 

# wget
http://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.2/zabbix-2.2.2.tar.gz?r=http%3A%2F%2Fwww.zabbix.com%2Fdownload.php&ts=1395066528&use_mirror=jaist
# tar -xzvf zabbix-2.2.2.tar.gz
# cd zabbix-2.2.2
# ./configure --prefix=/usr/local/zabbix-2.2.2/ --enable-agent
# make
# make install
配置文件
vim /application/zabbix/etc/zabbix_agentd.conf
Server=127.0.0.1
ServerActive=127.0.0.1
启动
/application/zabbix/etc/zabbix_agentd
查看
ss -lntup|grep zabbix_agentd

 

安装完毕!打开网页测试 

 

zabbix 安装

标签:lib   configure   用户   creat   doc   url   load   glibc   int   

原文地址:http://www.cnblogs.com/cll450/p/7735648.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!