zabbix安装、部署、lnmp(一)
yum -y install gcc make cmake ncurses-devel libxml2-devel libtool-ltdl-devel gcc-c++ autoconf automake bison zlib-devel
mkdir download
mkdir /usr/local/lnmp
wget http://cdn.mysql.com/archives/mysql-5.6/mysql-5.6.11.tar.gz
tar -zxvf mysql-5.6..tar.gz -C /usr/local/lnmp
cd /usr/local/lnmp/mysql-5.6.
cmake .-DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=gbk,gb2312 -DENABLED_LOCAL_INFILE=
make
make install
sudo mkdir /usr/local/mysql/etc
[mysqld]
port=
datadir=/mysql_data/data
socket=/mysql_data/mysql.sock
user=mysql [mysqld_safe]
log-error=/mysql_data/mysql_err.log
pid-file=/mysql_data/mysql.pid
sudo mkdir /mysql_data
sudo mkdir /mysql_data/data
sudo chown -R mysql.mysql /mysql_data /usr/local/mysql -R
sudo /usr/local/mysql/scripts/mysql_install_db --defaults-file=/usr/local/mysql/etc/my.cnf --user=mysql --basedir=/usr/local/mysql
sudo /usr/local/mysql/bin/mysqld_safe --defaults-file=/usr/local/mysql/etc/my.cnf &
ln -s /mysql_data/mysql.sock /tmp/mysql.sock
tar xvf libiconv-1.13.tar.gz -C /usr/local/lnmp
cd /usr/local/lnmp/libiconv-1.13
./configure ;make ;make install
echo /usr/local/lib >/etc/ld.so.conf.d/lnmp.conf //这里普通用户使用sudo可能会报错,可以直接vim 编辑/etc/ld,so.conf.d/lnmp.conf,把路径写进去
/sbin/ldconfig
tar xvf pcre-7.9.tar.gz -C /usr/local/lnmp
cd /usr/local/lnmp/pcre-7.9
./configure ;make ;make install
/sbin/ldconfig
tar xf php-5.6..tar.bz2 -C /usr/local/lnmp
cd /usr/local/lnmp/php-5.6.
./configure --prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir=/usr/local--with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-gettext --enable-mysqlnd --with-pcre-dir=/usr/local/--enable-opcache
make
make install
configure: error:Don't know how to define struct flock on this system, set --enable-opcache=no
ln -s /usr/local/mysql/lib/libmysqlclient.so /usr/lib/
ln -s /usr/local/mysql/lib/libmysqlclient.so./usr/lib/libmysqlclient.so.
ldconfig
--或者
echo /usr/local/mysql/lib >>/etc/ld.so.conf.d/lnmp.conf && ldconfig
collect2: ld returned exit status
make:***[sapi/cli/php]Error1
make ZEND_EXTRA_LIBS='-liconv'
make install
chmod: cannot access `ext/phar/phar.phar': No such file or directory"
cp ext/phar/phar.php ext/phar/phar.phar
tar xvf memcache-2.2..tgz -C /usr/local/lnmp
cd /usr/local/lnmp/memcache-2.2.
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make ;make install
Libraries have been installed in:
/usr/src/lnmp/memcache-2.2./modules
Installing shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-/
echo /usr/src/lnmp/memcache-2.2./modules/>>/etc/ld.so.conf.d/lnmp.conf
/sbin/ldconfig
tar -zxvf ImageMagick-6.7.-.tar.gz -C /usr/local/lnmp
cd /usr/local/lnmp/ImageMagick-6.7.-
./configure
make;make install
/sbin/ldconfig
tar xf imagick-3.1..tgz-C /usr/src/lnmp/
cd /usr/src/lnmp/imagick-3.1./
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make;make install
Libraries have been installed in:
/usr/src/lnmp/imagick-3.1./modules
Installing shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-/
echo /usr/local/lnmp/imagick-3.1./modules >>/etc/ld.so.conf.d/lnmp.conf
/sbin/ldconfig
ls /usr/local/php/lib/php/extensions/no-debug-non-zts-/
imagick.so memcache.so opcache.so opcache.a
cp /usr/local/lnmp/php-5.6./php.ini-production /usr/local/php/etc/php.ini
extension_dir ="/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/"
extension ="memcache.so"
extension ="imagick.so"
date.timezone ="Asia/Shanghai"
[opcache]
zend_extension ="/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/opcache.so"
opcache.enable=
opcache.enable_cli=
opcache.memory_consumption=
opcache.optimization_level=
opcache.interned_strings_buffer=
opcache.max_accelerated_files=
opcache.revalidate_freq=
opcache.fast_shutdown=
opcache.save_comments=
useradd -r -d /dev/null -s /sbin/nologin nginx
tar xf nginx-1.8..tar.gz -C /usr/local/lnmp
cd /usr/local/lnmp/nginx-1.8./
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_gzip_static_module --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/lnmp/pcre-7.9
make
make install
ls /usr/local/nginx
conf html logs sbin
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
# vim /usr/local/php/etc/php-fpm.conf
listen =/var/run/fastcgi/fastcgi.socket
php_flag[display_errors]= on
user = nginx
group = nginx
pm.max_children =
pm.start_servers =
pm.min_spare_servers =
pm.max_spare_servers =
pm.max_requests =
rlimit_files =
listen.owner = nginx
listen.group = nginx
listen.mode =
mkdir /var/run/fastcgi
chown nginx.nginx /var/run/fastcgi/
/usr/local/php/sbin/php-fpm -D -y /usr/local/php/etc/php-fpm.conf
ls /var/run/fastcgi/
fastcgi.socket
# vim /usr/local/nginx/conf/nginx.conf
user nginx nginx;--运行用户和组
worker_processes ;--启动ngnix的服务的工作进程数
error_log logs/error.log info;--错误日志以及日志等级
pid logs/nginx.pid;--pid文件
worker_rlimit_nofile ;--nginx每个进程能打开的最大的文件描述符数
events {
use epoll;--epoll工作模式
worker_connections ;--每个进程允许打开的并发连接数
}
http {
include mime.types;
default_type application/octet-stream;
server_tokens off;
sendfile on;
tcp_nopush on;
keepalive_timeout ;
gzip on;
server {
listen ;--监听的端口
server_name 10.1.1.8;--域名或者IP
charset utf8;--字符集
root /lnmp/web;--家目录
index index.php index.html index.htm;--主页文件
error_page /50x.html;
location =/50x.html {
root html;
}
location ~.*\.php$ {
fastcgi_pass unix:/var/run/fastcgi/fastcgi.socket;--对应php-fpm.conf里的设置
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;--把/scripts改成$document_root,表示家目录下的.php文件也当会以php来执行
include fastcgi_params;
}
}
}
mkdir -p /lnmp/web
/usr/local/nginx/sbin/nginx //启动nginx
/usr/local/nginx/sbin/nginx -s reload //reload的方法
/usr/local/nginx/sbin/nginx -s stop //关闭的方法
<?php
phpinfo();
?>
yum -y install net-snmp-devel
tar -zxvf zabbix-3.2..tar.gz -C /usr/local/lnmp
yum install net-snmp-devel
./configure --prefix=/usr/local/zabbix-3.2.--enable-server --enable-agent --with-mysql=/usr/local/mysql/bin/mysql_config --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
make
make install
useradd zabbix
groupadd zabbix
create user 'zabbix'@'%' identified by '';
创建zabbix数据库
create database zabbix
grant all privileges on zabbix.* to 'zabbix'@'%' identified by ''
grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by ''
flush privileges;
mysql> show databases;
+--------------------+
|Database|
+--------------------+
| information_schema |
| test |
| zabbix |
+--------------------+
rows inset(0.00 sec)
/usr/local/mysql/bin/mysql zabbix </usr/local/lnmp/zabbix-3.2./database/mysql/schema.sql
/usr/local/mysql/bin/mysql zabbix </usr/local/lnmp/zabbix-3.2./database/mysql/images.sql
/usr/local/mysql/bin/mysql zabbix </usr/local/lnmp/zabbix-3.2./database/mysql/data.sql
mkdir -p /etc/zabbix
cp /usr/local/zabbix-3.2./etc/zabbix_server.conf /etc/zabbix
DBName=zabbix
DBUser=zabbix
DBPassword=
DBPort=
ListenIP=10.0.0.146
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
mkdir -p /zabbix_web/zabbix
cp -r /usr/local/lnmp/zabbix-3.2./frontends/php/*/zabbix_web/zabbix
user nginx nginx;
worker_processes ;
error_log logs/error.log info;
pid logs/nginx.pid;
events {
use epoll;
worker_connections ;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
sendfile on;
tcp_nopush on;
keepalive_timeout ;
gzip on;
server {
listen ;
server_name localhost;
access_log logs/host.access.log main;
index index.php index.html index.htm;
root /zabbix_web;
location /{
try_files $uri $uri//index.php?$args;
}
location ~.*\.(php)?$ {
fastcgi_split_path_info ^(.+.php)(.*)$;
include fastcgi_params;
fastcgi_pass unix:/var/run/fastcgi/fastcgi.socket;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
post_max_size =16M
max_execution_time =
max_input_time =
always_populate_raw_post_data =-
pkill fpm
/usr/local/php/sbin/php-fpm -D -y /usr/local/php/etc/php-fpm.conf
<?php
//Zabbix GUI configuration file.
global $DB;
$DB['TYPE']='MYSQL';
$DB['SERVER']='10.0.0.146';
$DB['PORT']='';
$DB['DATABASE']='zabbix';
$DB['USER']='zabbix';
$DB['PASSWORD']='';
//Schema name.Usedfor IBM DB2 and PostgreSQL.
$DB['SCHEMA']='';
$ZBX_SERVER ='10.0.0.146';
$ZBX_SERVER_PORT ='';
$ZBX_SERVER_NAME ='zabbix-server';
$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
tar -zxvf zabbix-3.2..tar.gz -C /usr/local/lnmp
./configure --prefix=/home/lile/zabbix-3.2.--enable-agent
make
make install
LogFile=/tmp/zabbix_agentd.log
Server=127.0.0.1 //zabbix server的地址
ServerActive=127.0.0.1 //zabbix server的地址
Hostname=Zabbix server
/usr/local/zabbix-3.2./sbin/zabbix_agentd
zabbix安装、部署、lnmp(一)的更多相关文章
- 在ConoHa上Centos7环境下源码安装部署LNMP
本文记录了从源码,在Centos 7上手动部署LNMP环境的过程,为了方便以后对nginx和mariadb进行升级,这里采用yum的方式进行安装. 1.建立运行网站和数据库的用户和组 groupadd ...
- 详解zabbix安装部署(Server端篇)
原文:http://blog.chinaunix.net/uid-25266990-id-3380929.html Linux下常用的系统监控软件有Nagios.Cacti.Zabbix.Monit等 ...
- Zabbix安装部署(CentOS系统下)
zabbix(音同 zæbix)是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案. zabbix能监视各种网络参数,保证服务器系统的安全运营:并提供灵活的通知机制以让系统 ...
- zabbix安装部署(server部分)
Linux下常用的系统监控软件有Nagios.Cacti.Zabbix.Monit等,这些开源的软件,可以帮助我们更好的管理机器,在第一时间内发现,并警告系统维护人员. 今天开始研究下Zabbix,使 ...
- 详解zabbix安装部署(Server端篇) (转)
Linux下常用的系统监控软件有Nagios.Cacti.Zabbix.Monit等,这些开源的软件,可以帮助我们更好的管理机器,在第一时间内发现,并警告系统维护人员. 今天开始研究下Zabbix,使 ...
- Zabbix安装部署实践
操作系统: [root@mysql ~]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core) Mysql : 版本5.7 ...
- CentOS下Zabbix安装部署及汉化
搭建环境:Centos6.5_x86_64,Zabbix2.4.5,epel 源 服务端: 1.安装开发软件包yum -y groupinstall "Development Tools&q ...
- centos-6.5安装部署LNMP环境
安装部署前,确保安装了gcc和gcc-c++ 系统信息: [root@zww ~]# cat /etc/redhat-release CentOS release 6.5 (Final) [root@ ...
- centos6.8下安装部署LNMP(备注:nginx1.8.0+php5.6.10+mysql5.6.12)
在平时运维工作中,经常需要用到LNMP应用框架.以下对LNMP环境部署记录下: 1)前期准备:为了安装顺利,建议先使用yum安装依赖库[root@opd ~]#yum install -y make ...
- Zabbix安装部署
zabbix服务器端配置:(10.27.98.29服务器端) 1.安装lamp环境 yum -y install autoconf curl-devel gcc gcc-c++ httpd httpd ...
随机推荐
- JS模态框 简单案例
演示: <!doctype html> <html lang="en"> <head> <meta charset="UTF-8 ...
- Annotaion——深入理解注解类型
什么是注解? 对于很多初次接触的开发者来说应该都有这个疑问?Annontation是Java5开始引入的新特征,中文名称叫注解.它提供了一种安全的类似注释的机制,用来将任何的信息或元数据(metada ...
- 三款免费实用的文件夹同步/备份软件推荐 (SyncToy/FreeFileSync/Compare Advance)
三款免费实用的本地文件夹同步/备份软件推荐 (SyncToy/FreeFileSync/Compare Advance) Microsoft SyncToy SyncToy 是由 微软 推出的一款免费 ...
- VMware 虚拟机centos下链接网络配置
1.点击Network Adapter 设置如下图所示,首先我们在虚拟机中将网络配置设置成NAT, 2.计算机右键->管理->服务和应用程序->服务,启动如下两个服务 3.在etc/ ...
- html5(五)拖放
http://www.w3school.com.cn/html5/html_5_draganddrop.asp http://www.cnblogs.com/return-false/p/332628 ...
- python命名空间与作用域
python命名空间与作用域 命名空间是名称与对象之间的关系,可以将命名空间看做是字典,其中的键是名称,值是对象. 命名空间不共享名称. 在命名空间中的名称能将任何python对象作为值,在不同的 ...
- windows下《Go Web编程》之Go开发工具
Go开发工具很多,比较喜欢的使用作者列出的第一个工具,LiteIDE.它是一款专门为Go语言开发的跨平台轻量级集成开发环境. 一.LiteIDE下载安装 下载地址:https://sourceforg ...
- 福大软工 · 第十一次作业 - Alpha 事后诸葛亮(团队)
福大软工·第十一次作业-Alpha事后诸葛亮 组长博客链接 本次作业博客链接 项目Postmortem 模板 设想和目标 我们的软件要解决什么问题?是否定义得很清楚?是否对典型用户和典型场景有清晰的描 ...
- Android开发 ---基本UI组件5:监听下拉选项,动态绑定下拉选项、全选/反选,取多选按钮的值,长按事件,长按删除,适配器的使用,提示查询数据,activity控制多按钮
效果图: 效果描述: 1.当点击 1 按钮后,进入选择城市的页面,会监听到你选中的城市名称:动态为Spinner绑定数据 2.当点击 2 按钮后,进入自动查询数据页面,只要输入首字母,就会动态查找以该 ...
- shell脚本监测DNS链接状态给传给zabbix值
#!/bin/sh time_out=0 querygt3s=0 i=1 while [[ $i -le 15 ]] do i=`expr $i + 1` sleep 2 while read lin ...