LNMP and Zabbix configuration instance code sharing

Source: Internet
Author: User
Tags snmp
This article mainly share with you lnmp and Zabbix configuration instance code, hope can help everyone.

First, Zabbix service-side deployment

1. Decompression

TAR-XF nginx-1.10.1.tar.gztar-xf php-5.6.22.tar.gztar-xf FREETYPE-2.4.0.TAR.BZ2TAR-XF MYSQL-5.6.30-LINUX-GLIBC2.5-X86_64.TAR.GZTAR-XF zabbix-3.2.1.tar.gz

2. Installing Nginx

Yum-y install gcc openssl-devel pcre-develuseradd-s/sbin/nologin nginx cd ~/nginx-1.10.1/./configure \>--prefix=/us R/local/nginx \>--user=nginx \>--group=nginx \>--with-http_ssl_modulemake && make installvim/usr/ Local/nginx/conf/nginx.conf location/{roothtml;indexindex.phpindex.htmlindex.htm;} Location ~ \.php$ {root   html;fastcgi_pass127.0.0.1:9000;fastcgi_indexindex.php;fastcgi_paramscript_filename$ Document_root$fastcgi_script_name;includefastcgi_params;} /usr/local/nginx/sbin/nginx

3. Install MySQL

Useradd MYSQLMV mysql-5.6.30-linux-glibc2.5-x86_64//usr/local/mysqlchown-r MYSQL.MYSQL/USR/LOCAL/MYSQL/SU-MYSQLCD /usr/local/mysql/scripts/./mysql_install_db \>--user=mysql \>--basedir=/usr/local/mysql \>--datadir=/usr /LOCAL/MYSQL/DATAEXITCD/USR/LOCAL/MYSQL/SUPPORT-FILES/CP MY-DEFAULT.CNF/ETC/MY.CNFCP mysql.server/etc/init.d/ Mysqlvim/etc/init.d/mysqlbasedir=/usr/local/mysqldatadir=/usr/local/mysql/dataecho ' Export PATH=/usr/local/mysql /bin: $PATH ' >>/etc/profilesource/etc/profilechkconfig--add mysqlchkconfig mysql onservice mysql start/usr/ local/mysql/bin/mysqladmin-u root password ' 123456 ' mysql-uroot-p123456mysql> create DATABASE Zabbix character Set UT F8;mysql> Grant all on zabbix.* to zabbix@localhost identified by ' qwe123 ';

4, install FreeType (can use the system comes with)

CD ~/freetype-2.4.0./configure--prefix=/opt/freetype-2.4.0make && make Installyum-  y  Install FreeType

5. Install PHP

Yum-y Install libjpeg-devel libxml2-devel libpng-develcd ~/php-5.6.22/./configure \>--prefix=/usr/local/php5/\ >--ENABLE-FPM \>--enable-mbstring \>--enable-bcmath \>--enable-sockets \>--with-config-file-path=/ Usr/local/php5/etc \>--with-mysql=/usr/local/mysql/\>--with-mysqli=/usr/local/mysql/bin/mysql_config \> --WITH-GD \>--with-gettext \>--with-jpeg-dir \>--with-freetype-dir=/opt/freetype-2.4.0/# Use the system's own without referring to the installation directory make && make INSTALLCP php.ini-production/usr/local/php5/etc/php.inivim/usr/local/php5/etc/ Php.inidate.timezone = Asia/shanghaimax_execution_time = 300post_max_size = 32mmax_input_time = 300memory_limit = 128malways_populate_raw_post_data = -1CD/USR/LOCAL/PHP5/ETC/CP Php-fpm.conf.default php-fpm.confvim php-fpm.confpid = Run/php-fpm.piderror_log = Log/php-fpm.loglog_level = Errordaemonize = Yesuser = Nginxgroup = Nginxlisten = 127.0.0.1:90 00pm = Dynamicpm.max_children = 32pm.start_servers = 15pm.min_spare_servers = 5pm.max_spare_servers = 32CD ~/PHP-5.6.22/SAPI/FPM/CP init.d.php-fpm/etc/rc.d/init.d/php-fpmchmod +x/etc/rc.d/init.d/ Php-fpmchkconfig--add php-fpmchkconfig php-fpm onservice php-fpm start

6, Installation Zabbix

Yum-y Install net-snmp-devel curl-develuseradd zabbixcd zabbix-3.2.1./configure \>--prefix=/usr/local/zabbix \> --enable-server \>--enable-proxy \>--enable-agent \>--with-mysql=/usr/local/mysql/bin/mysql_config \>- -with-net-snmp \>--with-libcurlmake && make INSTALLCD ~/zabbix-3.2.1/database/mysql/mysql-uzabbix- Pqwe123 Zabbix < schema.sqlmysql-uzabbix-pqwe123 Zabbix < images.sqlmysql-uzabbix-pqwe123 Zabbix < DATA.SQLMK Dir/var/log/zabbixchown zabbix.zabbix/var/log/zabbixln-s/usr/local/zabbix/etc//etc/zabbixln-s/usr/local/zabbix/ bin/*/usr/bin/ln-s/usr/local/zabbix/sbin/*/usr/sbin/ln-s/usr/local/mysql/lib/libmysqlclient.so.18/usr/lib64/ libmysqlclient.so.18 #可以使用设置搜索库文件的路径方式实现 [root@localhost lnmp+zabbix-3.2.1]# tail-1/etc/ld.so.conf/usr/local/mysql  /lib/[root@localhost lnmp+zabbix-3.2.1]# Ldconfig-v | grep libmysqlclient.so.18 CD ~/ZABBIX-3.2.1/MISC/INIT.D/FEDORA/CORECP zabbix_*/etc/init.d/vim/etc/init.d/zabbix_ serverbasedir=/usr/local/zabbixvim/etc/init.d/zabbix_agentdbasedir=/usr/local/zabbixvim/etc/serviceszabbix-agent10050/tcp# Zabbix agentzabbix-agent10050/udp# Zabbix agentzabbix-server10051/tcp# Zabbix trapperzabbix-server10051/udp# Zabbix trappervim/etc/zabbix/zabbix_server.confdbname=zabbixdbuser=zabbixdbpassword=qwe123logfile=/var/log/zabbix/ Zabbix_server.logvim/etc/zabbix/zabbix_agentd.confserver=127.0.0.1,192.168.100.10serveractive= 192.168.100.10:10051hostname=zabbix SERVERLOGFILE=/VAR/LOG/ZABBIX/ZABBIX_SERVER.LOGUNSAFEUSERPAREMETERS=1CD ~/ Zabbix-3.2.1/frontends/cp-r php//usr/local/nginx/html/zabbixchown-r nginx.nginx/usr/local/nginx/html/zabbix/ Service Zabbix_server startchkconfig zabbix_server onservice zabbix_agentd startchkcongig zabbix_agentd on

Second, Zabbix client deployment

TAR-XF zabbix-3.2.1.tar.gzyum-y Install gccuseradd zabbix./configure--prefix=/usr/local/zabbix--enable-agent && Amp Make && make Installmkdir/var/log/zabbixchown  zabbix.zabbix/var/log/zabbix/cp misc/init.d/fedora/core/ Zabbix_agentd/etc/init.d/chmod +x/etc/init.d/zabbix_agentd ln-s/usr/local/zabbix/etc//etc/zabbixln-s/usr/local/ zabbix/bin/*/usr/bin/ln-s/usr/local/zabbix/sbin/*/usr/sbin/vim/etc/zabbix/zabbix_agentd.conflogfile=/var/log/ Zabbix/zabbix_agentd.logserver=127.0.0.1,192.168.100.10serveractive=192.168.100.10:10051hostname=zabbix Clientunsafeuserparameters=1vim/etc/init.d/zabbix_agentdbasedir=/usr/local/zabbixchkconfig Zabbix_agentd Onservice Zabbix_agentd Start

Client Access:

Firefox Http://192.168.100.10/zabbix

Default login name/password: Admin/zabbix

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.