In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
I. preparatory work
1. System environment
System: CentOS 6.8 X8631 64
MySQL:5.7.12
Apache:2.4.20
PHP:7.1.4
Zabbix:3.2.6
two。 Environment required for installation
[root@Kry133 ~] # rpm-ivh http://www.lishiming.net/data/p_w_upload/forum/epel-release-6-8_64.noarch.rpm
[root@Kry133 ~] # yum-y install gcc gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel libmcrypt-devel net-snmp-devel OpenIPMI-devel
Second, install the LAMP environment
1.mysql installation
[root@Kry133 src] # tar zxvf mysql-5.7.12-linux-glibc2.5-x86_64.tar.gz
[root@Kry133 src] # mv mysql-5.7.12-linux-glibc2.5-x86_64 / usr/local/mysql
[root@Kry133 src] # useradd mysql-s / sbin/nologin-M
[root@Kry133 src] # chown-R mysql.mysql / usr/local/mysql/
[root@Kry133 src] # cd / usr/local/mysql/
[root@Kry133 mysql] # cp support-files/my-default.cnf / etc/my.cnf
[root@Kry133 mysql] # vim / etc/my.cnf
[mysqld]
Basedir = / usr/local/mysql
Datadir = / data/mysql
Port = 3306
Socket = / tmp/mysql.sock
Pid-file = / data/mysql/mysqld.pid
Log-error=/var/log/mysqld.err.log
The [root@Kry133 mysql] # mkdir / data # / data/mysql directory is created automatically at the beginning
[root@Kry133 mysql] # / bin/mysqld-- initialize-- user=mysql-- datadir=/data/mysql # initialization
[root@Kry133 mysql] # cp support-files/mysql.server / etc/init.d/mysqld
[root@Kry133 mysql] # chkconfig-- add mysqld
[root@Kry133 mysql] # chkconfig-- level 35 mysqld on
[root@Kry133 mysql] # service mysqld start
[root@Kry133 mysql] # vim / etc/profile.d/mysql.sh
#! / bin/bash
Export PATH=$PATH:/usr/local/mysql/bin:/usr/local/mysql/lib
[root@Kry133 mysql] # source / etc/profile.d/mysql.sh
[root@Kry133 mysql] # mysql-uroot-pendant 4qS5roomqd% zroomQy'
Mysql > set password = password ('123123'); # change password
two。 Install httpd
[root@Kry133 src] # wget http://mirror.bit.edu.cn/apache/apr/apr-util-1.5.4.tar.bz2
[root@Kry133 src] # wget http://mirror.bit.edu.cn/apache/apr/apr-1.5.2.tar.bz2
[root@Kry133 src] # tar jxvf apr-1.5.2.tar.bz2 & & tar jxvf apr-util-1.5.4.tar.bz2
[root@Kry133 src] # tar jxvf httpd-2.4.20.tar.bz2
[root@Kry133 src] # mv apr-1.5.2. / httpd-2.4.20/srclib/apr
[root@Kry133 src] # mv apr-util-1.5.4. / httpd-2.4.20/srclib/apr-util
[root@Kry133 src] # tar jxvf pcre-8.35.tar.bz2
[root@Kry133 src] # cd pcre-8.35
[root@Kry133 pcre-8.35] # / configure & & make & & make install
[root@Kry133 src] # cd httpd-2.4.20
[root@Kry133 src] # mkdir / usr/local/apache2.4
[root@Kry133 httpd-2.4.20] # / configure-- prefix=/usr/local/apache2.4-- with-included-apr-- enable-so-- enable-deflate=shared-- enable-expires=shared-- enable-rewrite=shared
[root@Kry133 httpd-2.4.20] # make & & make install
[root@Kry133 httpd-2.4.20] # cd / usr/local/apache2.4/
[root@Kry133 apache2.4] # vim conf/httpd.conf
ServerName localhost:80
[root@Kry133 apache2.4] # cp bin/apachectl / etc/init.d/httpd
[root@Kry133 apache2.4] # vim / etc/init.d/httpd
# chkconfig: 35 85 15
# description: apache
[root@Kry133 apache2.4] # chkconfig-- add httpd
[root@Kry133 apache2.4] # chkconfig-- level 35 httpd on
[root@Kry133 apache2.4] # service httpd start
3. Install PHP
[root@Kry133 src] # wget http://cn2.php.net/distributions/php-7.1.4.tar.gz
[root@Kry133 src] # tar zxvf php-7.1.4.tar.gz
[root@Kry133 php-7.1.4] # mkdir / usr/local/php
[root@Kry133 php-7.1.4] # / configure-prefix=/usr/local/php-- with-apxs2=/usr/local/apache2.4/bin/apxs-- with-config-file-path=/usr/local/php/etc-- with-mysqli=mysqlnd-- with-pdo-mysql=mysqlnd-- with-freetype-dir-- with-jpeg-dir-- with-png-dir-- with-zlib-- with-curl-- with-gettext-- enable-ftp-- enable-mbstring-- Enable-bcmath-with-gd-enable-gd-native-ttf-with-openssl-enable-sockets-enable-soap-with-libxml-dir-with-iconv-dir-with-bz2-disable-ipv6-enable-calendar-enable-dom enable-xml enable-fpm with-libdir=lib64
[root@Kry133 php-7.1.4] # make & & make install
[root@Kry133 php-7.1.4] # cd / usr/local/apache2.4/
[root@Kry133 apache2.4] # vim conf/httpd.conf
Find:
AddType application/x-gzip .gz .tgz
Add under the line:
AddType application/x-httpd-php .php
Find:
DirectoryIndex index.html
Change the line to
DirectoryIndex index.html index.htm index.php
[root@Kry133 apache2.4] # service httpd restart
III. Zabbix deployment
1. Install zabbix
[root@Kry133 src] # tar zxvf zabbix-3.2.6.tar.gz
[root@Kry133 src] # cd zabbix-3.2.6
[root@Kry133 zabbix-3.2.6] # useradd-s / sbin/nologin-M zabbix
[root@Kry133 zabbix-3.2.6] # mkdir / usr/local/zabbix
[root@Kry133 zabbix-3.2.6] # / configure-- prefix=/usr/local/zabbix-- enable-server-- enable-agent-- with-mysql-- enable-ipv6-- with-net-snmp-- with-libcurl-- with-libxml2-- with-openipmi
[root@Kry133 zabbix-3.2.6] # make & & make install
[root@Kry133 zabbix-3.2.6] # cp-r frontends/php / usr/local/apache2.4/htdocs/zabbix
[root@Kry133 zabbix-3.2.6] # vim / usr/local/zabbix/etc/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
ListenIP=0.0.0.0
[root@Kry133 zabbix-3.2.6] # cp misc/init.d/fedora/core/zabbix_server / etc/init.d/zabbix
[root@Kry133 zabbix-3.2.6] # chkconfig-- add zabbix
[root@Kry133 zabbix-3.2.6] # chkconfig-- level 35 zabbix on
[root@Kry133 zabbix-3.2.6] # service zabbix start
two。 Configuration database
[root@Kry133 zabbix-3.2.6] # mysql-uroot-p
Mysql > create database zabbix character set utf8 collate utf8_bin
Mysql > grant all on zabbix.*to zabbix@localhost identified by 'zabbix'
Mysql > flush privileges
[root@Kry133 zabbix-3.2.6] # mysql-uzabbix-pzabbix zabbix
< database/mysql/schema.sql [root@Kry133 zabbix-3.2.6]# mysql -uzabbix -pzabbix zabbix < database/mysql/p_w_picpaths.sql [root@Kry133 zabbix-3.2.6]# mysql -uzabbix -pzabbix zabbix < database/mysql/data.sql 3.配置PHP [root@Kry133 zabbix-3.2.6]# cd ../php-7.1.4 [root@Kry133 php-7.1.4]# cp php.ini-production /usr/local/php/etc/ [root@Kry133 php-7.1.4]# vim /etc/php.ini bcmath.scale = 1 max_execution_time = 300 memory_limit = 128M post_max_size = 16M upload_max_filesize = 2M max_input_time = 300 date.timezone = PRC [root@Kry133 php-7.1.4]# service httpd restart 4.zabbix 网页配置 浏览器访问 Zabbix Server ip/zabbixIV. Expand the content
1.PHP extension:
Name parameter selection bcmath--enable-bcmath must be mbstring--enable-mbstring must be sockets--enable-sockets must be gd--with-gd must be libxml--with-libxml-dir must be xmlwriter--with-libxml-dir must be ctype default support must be session default support must be gettext default support must be recommended by mysqli--with-mysqli=mysqlnd
2.Zabbix special monitoring options:
Name description parameters OpenIPMIIPMI hardware monitoring-with-openipmilibssh3SSH support-with-ssh3fpingICMP monitoring external installation libcurl monitoring web item-with-libcurllibiksemel support jabber alarm external installation net-snmpSNMP monitoring support-with-net-snmpjavajava process monitoring-enable-java
5. FAQ
1.mysql starts the Times and makes an error.
/ usr/libexec/mysqld: Can't find file:'. / mysql/plugin.frm'
Solution: shut down selinux
two。 Log in to the zabbix web page and report the following error
A non well formed numeric value encountered [zabbix.php:21 → require_once () → ZBase- > run () → ZBase- > proce***equest () → CView- > getOutput () → include () → make_status_of_zbx () → CFrontendSetup- > checkRequirements () → CFrontendSetup- > checkPhpMemoryLimit () → str2mem () in include/func.inc.php:410]
Reason: because PHP 7.1.4 type hardening
Solution:
[root@Kry133 sbin] # sed-I'/ $last = strtolower (substr ($val,-1)); / a$val = substr ($val,0,-1);'/ usr/local/apache2.4/htdocs/zabbix/include/func.inc.php
3. The startup zabbix_server port is not listening. The web page shows that the service is not running. Check the log and report the following error
Is this process already running? Could not lock PID file [/ tmp/zabbix_server.pid]: [11] Resource temporarily unavailable
Solution: rm-rf / tmp/zabbix_server.pid, then execute zabbix_server, and the server starts normally.
4. Start the error reporting zabbix service and report the following error
Error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such file or directory
Solution:
[root@Kry133 sbin] # ln-s / usr/local/mysql/lib/libmysqlclient.so.20 / lib64/libmysqlclient.so.20
Or
[root@Kry133 sbin] # echo "/ usr/local/mysql/lib" > > / etc/ld.so.conf
The 5.zabbix service starts normally, and the log reports the following
8779 Access denied for user 20170512 zabbix'@'localhost' 085715.539 [Z3001] Access denied for user 'zabbix' failed: [1045] Access denied for user' zabbix'@'localhost' (using password: NO)
8779:20170512:085715.539 database is down: reconnecting in 10 seconds
Solution: modify the ListenIP=0.0.0.0 in / usr/local/zabbix/etc/zabbix_server.conf
Garbled code appears on 6.web page
Solution:
1. Find C:\ Windows\ Fonts\ simkai.ttf locally and upload it to the zabbix website directory fonts.
two。 Modify zabbix php configuration file
[root@Kry133 zabbix] # sed-I's scarp DejaVuSansUniple simkaiUniver g 'include/defines.inc.php
The above operations failed to solve the garbled problem.
Create a database specified character set
Create database zabbix default charset utf8
Or an increase in my.cnf
Default-character-set = utf8
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.