Because there are several installation configurations written in Lnmp, here are all commands.
1 Turn off SELinux
Cp/etc/selinux/config/etc/selinux/config.bakvim/etc/selinux/config #SELINUX =disable#selinuxtype=targeted
2 packages and Software installation locations
/SRC #软件包位置
/usr/local/Package Installation Location
3 Download and install mysql5.2.26
Wget http://cdn.mysql.com/downloads/mysql-5.6/mysql-5.6.26-linux-glibc2.5-x86_64.tar.gztar -zxvf mysql-5.6.26-linux-glibc2.5-x86_64.tar.gz -c /usr/localmv /usr/local/ Mysql-5.6.26-linux-glibc2.5-x86_64/ /usr/local/mysqluseradd mysql -s /sbin/nologinmkdir -p /data/mysqlchown -r mysql:mysql /data/mysqlchown -r mysql:mysql / usr/local/mysql/usr/local/mysql/scripts/mysql_install_db --user=mysql --datadir=/data/mysql -- basedir=/usr/local/mysql--explicit_defaults_for_timestampcp /etc/my.cnf /etc/my.cnf.bakcp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnfvi /etc/my.cnfbasedir = / usr/local/mysqldatadir = /data/mysqlport = 3306socket = /tmp/mysql.sockcp / usr/local/mysql/support-files/mysql.server /etc/init.d/mysqldvim /etc/init.d/mysqld basedir=/ usr/local/mysqldatadir=/data/mysqlvi /etc/profilepath= $PATH:/usr/local/mysql/bin #在文件的最后一行加入source /etc/profilemysql -uroot - Pupdate mysql.user set password=password ("123456") where user= "root";flush privileges;
4 Download and install PHP
wget http://cn2.php.net/distributions/php-5.6.12.tar.gzcd php-5.6.12/./configure --prefix=/usr/ local/php-5.6.12 --with-config-file-path=/usr/local/php-5.6.12/etc --enable-ctype -- enable-bcmath --enable-mbstring --enable-sockets --with-curl --enable-ftp -- disable-ipv6 --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir -- enable-gd-native-ttf --with-zlib --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd -- With-mysql=mysqlnd --enable-dom --enable-xml --enable-fpm --with-libxml-dir=/usr/local --with-gettextmake && make installecho "path= $PATH:/usr/local/php-5.6.12/bin /:/usr/local/php-5.6.12/sbin " >> /etc/profilesource /etc/profilecp /src/php-5.6.12/ Php.ini-production /usr/local/php-5.6.12/etc/php.ini Modifying Files Max_execution_time = 300memory_limit = 128Mpost_max_size = 16mupload_max_filesize = 2mmax_input_time = 300cp /usr/local/php-5.6.12/etc/ php-fpm.conf.default /usr/local/php-5.6.12/etc/php-fpm.confcp /src/php-5.6.12/sapi/fpm/ Init.d.php-fpm /etc/init.d/php-fpmservice php-fpm start
5 Download and install Nginx
Yum install zlib zlib-devel OpenSSL openssl-devel pcre pcre-develwget Http://nginx.org/download/nginx-1.9.4.tar.gztar- ZXVF nginx-1.9.4.tar.gz-c/src/src/nginx-1.9.4/configure--prefix=/usr/local/nginx--with-http_stub_status_module- -with-pcre/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf
6 PHP Nginx Integration
Index index.php index.html index.htm location ~ \.php$ {root html; Fastcgi_pass 127.0.0.1:9000; Fastcgi_index index.php;ma fastcgi_param script_filename $document _root$fastcgi_script_name; Include Fastcgi_params; }
7 Download and install Zabbix
Wget http://nchc.dl.sourceforge.net/project/zabbix/zabbix%20latest%20stable/2.4.6/zabbix-2.4.6.tar.gztar zxvf zabbix-2.4.6.tar.gz -c /srccd zabbix-2.4.6/./configure --prefix=/usr/local /zabbix-2.4.6 --enable-server --enable-agent --with-mysql --enable-ipv6 -- With-net-snmp --with-libcurl --with-libxml2make make installgroupadd zabbixuseradd -g zabbix zabbix -s /sbin/nologinmysql -uroot -p123456create database zabbix default charset utf8;quit;mysql -uroot -p zabbix </src/ zabbix-2.4.6/database/mysql/schema.sqlmysql -uroot -p zabbix </src/zabbix-2.4.6/ database/mysql/images.sql Modifying zabbix_server.conf files Vi /usr/local/zabbix-2.4.6/etc/zabbix_ server.confdbhost=localhostdbname=zabbixdbuser=rootdbpassword=123456dbport=3306vi /usr/local/zabbix-2.4.6 /etc/zabbix_agentd.confserver=127.0.0.1 # #ZabBix server's address Serveractive=127.0.0.1hostname= zabbix server/usr/local/zabbix-2.4.6/sbin/zabbix_ serve #如果启动不起来, you cannot see the port information, view the log file location of Zabbix through the Zabbix configuration file, view the log/usr/local/zabbix-2.4.6/sbin/zabbix_agentd # ditto netstat -anp | grep 10051 netstat -anp | grep 10050mkdir /usr/local/nginx/html/zabbixcp -rf /src/zabbix-2.4.6/frontends/php/* /usr/local /nginx/html/zabbix
Use browser to open
Http://127.0.0.1/zabbix
The installation is complete here.
There are a lot of problems during the period, please carefully review each software log, you will find a solution.
Reference link Https://www.zabbix.com/documentation/2.4/start
http://www.ttlsa.com/zabbix/follow-ttlsa-to-study-zabbix/
This article is from the "Watch the world on the shoulders of Giants" blog, please be sure to keep this source http://lixiaotao.blog.51cto.com/985722/1693390
centos7+mysql-5.2.26+php-5.6.12+zabbix-2.4.6