一、安装mysql

 . 安装必备组件
yum install –y autoconf automake imake libxml2-devel expat-devel cmake gcc gcc-c++ libaio libaio-devel bzr bison libtool ncurses5-devel .下载mysql源码包
cd /usr/local
wget -c http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14-linux-glibc2.5-x86_64.tar.gz/from/http://cdn.mysql.com/ -O mysql-5.6.14-linux-glibc2.5-x86_64.tar.gz tar zxvf mysql-5.6.-linux-glibc2.-x86_64.tar.gz
mv mysql-5.6.-linux-glibc2.-x86_64 mysql mkdir -p /home/data/mysql_data
mkdir -p /home/data/mysql_log
mkdir -p /home/data/log-bin
groupadd mysql
useradd mysql -g mysql -M -s /sbin/nologin
chown -R mysql.mysql /home/data/mysql* /home/data/log-bin
chown -R mysql.mysql /usr/local/mysql vim /etc/my.cnf #修改mysql配置文件,改成如下内容
--------------------------------------------------------------------------
[mysqld]
explicit_defaults_for_timestamp=true
# GENERAL #
user = mysql
default-storage-engine = InnoDB
socket = /home/data/mysql_data/mysql.sock
pid-file = /home/data/mysql_data/mysql.pid
port = # MyISAM #
key_buffer_size = 1344M
myisam_recover = FORCE,BACKUP # SAFETY #
max_allowed_packet = 16M
max_connect_errors =
skip_name_resolve # DATA STORAGE #
datadir = /home/data/mysql_data/
long_query_time = # BINARY LOGGING #
log-bin = /home/data/log-bin/mysql-bin
expire-logs-days =
sync-binlog =
server-id =
max_binlog_size = 500M # REPLICATION #
relay-log = /home/data/log-bin/relay-bin
slave-net-timeout = # CACHES AND LIMITS #
tmp_table_size = 32M
max_heap_table_size = 32M
max_connections =
thread_cache_size =
open_files_limit =
table_definition_cache =
table_open_cache = # INNODB #
innodb_data_file_path = ibdata1:128M;ibdata2:10M:autoextend
innodb_flush_method = O_DIRECT
innodb_log_files_in_group =
innodb_lock_wait_timeout =
innodb_log_file_size = 256M
innodb_flush_log_at_trx_commit =
innodb_file_per_table =
innodb_thread_concurrency =
innodb_buffer_pool_size = 8G # LOGGING #
log-error = /home/data/mysql_log/mysql-error.log
log-queries-not-using-indexes =
slow-query-log =
long_query_time =
slow-query-log-file = /home/data/mysql_log/mysql-slow.log
-------------------------------------------------------------------------- cp -af /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld vim /etc/init.d/mysqld #修改如下内容
--------------------------------------------------------------------------
basedir=/usr/local/mysql
datadir=/home/data/mysql_data
--------------------------------------------------------------------------
chmod a+x /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld on
chkconfig --list |grep mysqld rm -f /usr/local/mysql/my.cnf
cp /etc/my.cnf /usr/local/mysql/
chown -R mysql.mysql /usr/local/mysql
cd /usr/local/mysql
./scripts/mysql_install_db --user=mysql --defaults-file=/etc/my.cnf
ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
ln -s /home/data/mysql_data/mysql.sock /tmp/mysql.sock service mysqld start
mysql -uroot -p
--------------------------------------------------------------------------
Mysql> delete from mysql.user where user='';
Mysql> update mysql.user set password=PASSWORD(‘xxxxxxxx’) where user='root';
Mysql>flush privileges;
--------------------------------------------------------------------------

二、安装php

 cd /usr/local
wget http://cn2.php.net/get/php-5.5.38.tar.gz/from/this/mirror
mv mirror php-5.5..tar.gz yum install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel curl curl-devel libcurl-devel -y
tar zxvf php-5.5..tar.gz
cd php-5.5. ./configure
--enable-bcmath
--prefix=/usr/local/php-5.5. --with-config-file-path=/usr/local/php-5.5./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 make && make install cp /usr/local/php-5.5./php.ini-production /usr/local/php-5.5./etc/php.ini
cp /usr/local/php-5.5./etc/php-fpm.conf.default /usr/local/php-5.5./etc/php-fpm.conf
ln -s /usr/local/php-5.5./sbin/php-fpm /usr/bin/php-fpm 配置PHP参数值,如配置不合理,可能会导致zabbix无法正常启动
vim /usr/local/php-5.5./etc/php.ini #下面几个参数修改成如下内容,或按需要配置
------------------------------------------------------------------------
 max_execution_time =
 memory_limit = 128M
 post_max_size = 16M
 upload_max_filesize = 2M
 max_input_time =
 date.timezone = PRC
------------------------------------------------------------------------ #启动php-fpm
php-fpm
netstat -ntpl |grep

三、安装nginx

 vim /etc/yum.repos.d/nginx.repo
-----------------------------------------------------------------
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/6/$basearch/
gpgcheck=
enabled=
-----------------------------------------------------------------
yum install nginx -y mkdir -p /usr/local/website/testphp
vim /usr/local/website/testphp/info.php
-----------------------------------------------------------------
<?php
phpinfo();
?>
----------------------------------------------------------------- vim /etc/nginx/conf.d/test.conf
-----------------------------------------------------------------
server {
listen ;
server_name www.testttls.com;
access_log /var/log/nginx/testphp.com.access.log main; index index.php index.html index.html;
root /usr/local/website/testphp; location / {
try_files $uri $uri/ /index.php?$args;
} location ~ .*\.(php)?$ {
expires -1s;
try_files $uri =;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:; }
}
-----------------------------------------------------------------
service nginx start
#启动服务后在本地windows 电脑 hosts 文件中 绑定服务器IP 和www.testttls.com域名,然后在浏览器中打开www.testttls.com/info.php 出现如下页面则php安装成功

四、安装zabbix-server

 cd /usr/local
在该网站下载需要的zabbix 版本http://www.zabbix.com/download
上传到/usr/local 目录下
tar zxvf zabbix-3.2..tar.gz
cd zabbix-3.2.
./configure --prefix=/usr/local/zabbix-3.2./ --enable-server --enable-agent --with-mysql=/usr/local/mysql/bin/mysql_config --with-net-snmp --with-libcurl --with-libxml2 make && make install 添加zabbix 运行用户组
groupadd zabbix
useradd zabbix -g zabbix 注:zabbix-server 共需要导入3个源码包中的sql文件,而搭建proxy 则只需要导入一个sql #创建zabbix 数据库
mysql -uroot -pxxxx mysql> create database zabbix default charset utf8;
Query OK, row affected (0.00 sec) mysql> quit
# mysql -uroot -pxxxx zabbix < /usr/local/zabbix-3.2./database/mysql/schema.sql
# mysql -uroot -pxxx zabbix < /usr/local/zabbix-3.2./database/mysql/images.sql
# mysql -uroot -pxxx zabbix < /usr/local/zabbix-3.2./database/mysql/data.sql #配置zabbix 服务器
mkdir -p /etc/zabbix
cp /usr/local/zabbix-3.2./conf/zabbix_server.conf /etc/zabbix
vim /etc/zabbix/zabbix_server.conf
------------------------------------------------------------------------
DBName=zabbix
DBUser=root
DBPassword=XXXXX
DBPort=
------------------------------------------------------------------------
echo "/usr/local/mysql/lib" >> /etc/ld.so.conf
ldconfig
/usr/local/zabbix-3.2./sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
/usr/local/zabbix-3.2./sbin/zabbix_agentd #配置zabbix web
mkdir -p /home/data/zabbix/zabbix
cp -rp /usr/local/zabbix-3.2./frontends/php/* /home/data/zabbix/zabbix vim /etc/nginx/conf.d/zabbix.conf
------------------------------------------------------------------------
server {
listen 80;
server_name zabbix.prd.xjh.com;
access_log /var/log/nginx/zabbix.prd.xjh.com.access.log main; index index.php index.html index.html;
root /home/data/zabbix; location / {
try_files $uri $uri/ /index.php?$args;
} location ~ .*\.(php)?$ {
expires -1s;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000; }
}
------------------------------------------------------------------------
cp /home/data/zabbix/zabbix/conf/zabbix.conf.php.example /home/data/zabbix/zabbix/conf/zabbix.conf.php
vim /home/data/zabbix/zabbix/conf/zabbix.conf.php
------------------------------------------------------------------------
<?php
// Zabbix GUI configuration file.
global $DB; $DB['TYPE'] = 'MYSQL';
$DB['SERVER'] = 'localhost';
$DB['PORT'] = '0';
$DB['DATABASE'] = 'zabbix';
$DB['USER'] = 'root';
$DB['PASSWORD'] = 'xxxxx';
// Schema name. Used for IBM DB2 and PostgreSQL.
$DB['SCHEMA'] = ''; $ZBX_SERVER = 'localhost';
$ZBX_SERVER_PORT = '10051';
$ZBX_SERVER_NAME = 'zabbix-server'; $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG; ------------------------------------------------------------------------ #绑定hosts之后,打开浏览器访问

zabbix 3.2.4 安装的更多相关文章

  1. Zabbix源码包安装

    Zabbix源码包安装 Cenos5.3 Basic server 安装顺序 Libxml2 Libmcrypt Zlib Libpng Jpeg:需要创建目录jpeg  /bin  /lib   / ...

  2. [原创]zabbix工具介绍,安装及使用

    [原创]zabbix工具介绍,安装及使用 http://waringid.blog.51cto.com/65148/955939/

  3. 2、zabbix工作原理及安装配置

      Zabbix架构:zabbix基本术语.zabbix安装.配置和应用 Zabbix架构中的组件: zabbix-server:C语言    zabbix-server和zabbix-agent通过 ...

  4. Zabbix 3.0 LTS安装配置

    关于Zabbix监控项类型的官网介绍: https://www.zabbix.com/documentation/3.4/zh/manual/config/items/itemtypes zabbix ...

  5. 【ZABBIX】Linux下安装ZABBIX

    说明:搭建ZABBIX所需的软件列表为:RHEL6.5+Nginx+MySQL+PHP+ZABBIX. 一.软件包 软件名称 版本 下载地址 nginx 1.10.3 http://nginx.org ...

  6. zabbix 4.2 的安装和设置(mysql57----centos7)

    一.安装RPM [root@localhost ~]# rpm -ivh https://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release ...

  7. zabbix (二)安装

    一.centos7源码安装zabbix3.x 1.安装前环境搭建 下载最新的yum源 #wget -P /etc/yum.repos.d http://mirrors.aliyun.com/repo/ ...

  8. 原创:CentOS 环境中 Zabbix 3.4 的安装部署实践

    IT管理工作中,如果没有对服务器.网络设备.服务.进程.应用等的监控,往往是用户发送问题报告后才知道出了问题.事后救火显得被动,不能从容面对问题. 才有了部署一套网络监控系统的想法,机缘巧合下结识了Z ...

  9. zabbix指定版本自动化安装脚本shell

    安装服务端zabbix 有时候要部署一个zabbix各种配置啊贼烦. #!/bin/sh #sleep 10 zabbix_version=4.2.5 ###这里你自定义版本,我要的是4.2.5 za ...

  10. zabbix 3.0 完全安装全解!

    环境准备: centos 6.5 x86_x64 安装依赖库文件 yum -y install mysql-devel net-snmp-devel curl curl-devel gcc pcre- ...

随机推荐

  1. CSS 五种方式实现 Footer 置底

    CSS 五种方式实现 Footer 置底   页脚置底(Sticky footer) 就是让网页的footer部分始终在浏览器窗口的底部. 当网页内容足够长以至超出浏览器可视高度时,页脚会随着内容被推 ...

  2. 用正则表达式模仿Mustache插件的功能

    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding= ...

  3. lightgbm 学习资料汇总

    操作实例:https://blog.csdn.net/luoyexuge/article/details/72956491 中文文档:https://lightgbm.apachecn.org/cn/ ...

  4. python字符串加密与反解密

    在生产中会遇到很多情况是需要加密字符串的(如访问或存储密码)这些需求造就了需要字符串加密,以及反解密的问题,推荐两种方法来实现,下附代码: #!/usr/bin/env python3 # -*- c ...

  5. bjtu 1846. Infinity的装备[状压dp+dfs/bfs]

    https://citel.bjtu.edu.cn/acm/oj/problem/1846 1846. Infinity的装备 时间限制 1000 ms 内存限制 64 MB 题目描述 “测试服终于下 ...

  6. 单堆石子的Nim Game

    两个人轮流捡石子,只有一堆石子,石子数为n.每个人每次至少捡一个石子,至多捡m个.取走最后一个石子的人胜利,若我方先手,求能否胜利. 若n % (m + 1)为0,则必输,否则必赢.

  7. 调参tips

    对于一个模型,都可以从以下几个方面进行调参: 1. 对weight和bias进行初始化(效果很好,一般都可以提升1-2%) Point 1 (CNN): for conv in self.convs1 ...

  8. 命令提示符中运行SQL Server 2005

      使用 sqlcmd 实用工具,可以在命令提示符处.SQLCMD 模式下的查询编辑器.Windows 脚本文件或 SQL Server 代理作业的操作系统 (Cmd.exe) 作业步骤中,输入 Tr ...

  9. GDI 编程基础简介

    今天准备重新对GDI的知识进行回顾一下,以便加深认识. 一.GDI 在进行Windows编程时,可能经常会用到设备描述表的类型句柄,例如,最厂家的HDC,它就是图像设备描述类型句柄.因为GDI的绘图函 ...

  10. ios为app应用添加icon

    在工程中打开plist文件,添加,选择icon files,然后添加不同分辨率的icon名称即可.如果clean后再运行程序还是没有看到效果,那么就删除掉app包然后 再次运行就可以看到效果了.