이 기사에서는 모든 사람에게 도움이 되기를 바라며 주로 LNMP 및 zabbix 구성 예제 코드를 공유합니다.
1. Zabbix 서버 배포
1. 압축을 푼다
tar -xf nginx-1.10.1.tar.gz tar -xf php-5.6.22.tar.gz tar -xf freetype-2.4.0.tar.bz2 tar -xf mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz tar -xf zabbix-3.2.1.tar.gz
3. MySQL을 설치합니다
yum -y install gcc openssl-devel pcre-devel useradd -s /sbin/nologin nginx cd ~/nginx-1.10.1/ ./configure \ >--prefix=/usr/local/nginx \ >--user=nginx \ >--group=nginx \ >--with-http_ssl_module make && make install vim /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
4. )
useradd mysql mv mysql-5.6.30-linux-glibc2.5-x86_64/ /usr/local/mysql chown -R mysql.mysql /usr/local/mysql/ su - mysql cd /usr/local/mysql/scripts/ ./mysql_install_db \ >--user=mysql \ >--basedir=/usr/local/mysql \ >--datadir=/usr/local/mysql/data exit cd /usr/local/mysql/support-files/ cp my-default.cnf /etc/my.cnf cp mysql.server /etc/init.d/mysql vim /etc/init.d/mysql basedir=/usr/local/mysql datadir=/usr/local/mysql/data echo 'export PATH=/usr/local/mysql/bin:$PATH' >> /etc/profile source /etc/profile chkconfig --add mysql chkconfig mysql on service mysql start /usr/local/mysql/bin/mysqladmin -u root password '123456' mysql -uroot -p123456 mysql> create database zabbix character set utf8; mysql> grant all on zabbix.* to zabbix@localhost identified by 'qwe123';
5. PHP
cd ~/freetype-2.4.0 ./configure --prefix=/opt/freetype-2.4.0 make && make install yum -y install freetype
6. Zabbix
yum -y install libjpeg-devel libxml2-devel libpng-devel cd ~/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/ #使用系统自带的不用指安装目录 make && make install cp php.ini-production /usr/local/php5/etc/php.ini vim /usr/local/php5/etc/php.ini date.timezone = Asia/Shanghai max_execution_time = 300 post_max_size = 32M max_input_time = 300 memory_limit = 128M always_populate_raw_post_data = -1 cd /usr/local/php5/etc/ cp php-fpm.conf.default php-fpm.conf vim php-fpm.conf pid = run/php-fpm.pid error_log = log/php-fpm.log log_level = error daemonize = yes user = nginx group = nginx listen = 127.0.0.1:9000 pm = dynamic pm.max_children = 32 pm.start_servers = 15 pm.min_spare_servers = 5 pm.max_spare_servers = 32 cd ~/php-5.6.22/sapi/fpm/ cp init.d.php-fpm /etc/rc.d/init.d/php-fpm chmod +x /etc/rc.d/init.d/php-fpm chkconfig --add php-fpm chkconfig php-fpm on service php-fpm start
2를 설치합니다. Zabbix 클라이언트 배포
yum -y install net-snmp-devel curl-devel useradd zabbix cd 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-libcurl make && make install cd ~/zabbix-3.2.1/database/mysql/ mysql -uzabbix -pqwe123 zabbix < schema.sql mysql -uzabbix -pqwe123 zabbix < images.sql mysql -uzabbix -pqwe123 zabbix < data.sql mkdir /var/log/zabbix chown zabbix.zabbix /var/log/zabbix ln -s /usr/local/zabbix/etc/ /etc/zabbix ln -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/core cp zabbix_* /etc/init.d/ vim /etc/init.d/zabbix_server BASEDIR=/usr/local/zabbix vim /etc/init.d/zabbix_agentd BASEDIR=/usr/local/zabbix vim /etc/services zabbix-agent10050/tcp# Zabbix Agent zabbix-agent10050/udp# Zabbix Agent zabbix-server10051/tcp# Zabbix Trapper zabbix-server10051/udp# Zabbix Trapper vim /etc/zabbix/zabbix_server.conf DBName=zabbix DBUser=zabbix DBPassword=qwe123 LogFile=/var/log/zabbix/zabbix_server.log vim /etc/zabbix/zabbix_agentd.conf Server=127.0.0.1,192.168.100.10 ServerActive=192.168.100.10:10051 Hostname=zabbix server LogFile=/var/log/zabbix/zabbix_server.log UnsafeUserParemeters=1 cd ~/zabbix-3.2.1/frontends/ cp -r php/ /usr/local/nginx/html/zabbix chown -R nginx.nginx /usr/local/nginx/html/zabbix/ service zabbix_server start chkconfig zabbix_server on service zabbix_agentd start chkcongig zabbix_agentd on
클라이언트 액세스:
firefox http://192.168. 10 0.10/자빅스
기본 로그인 이름/비밀번호: admin/zabbix
관련 권장 사항:
centos7에 zabbix 설치에 대한 자세한 소개LNMP 컴파일 및 PHP 및 LNMP 구성 설치 검증사례 공유
위 내용은 LNMP 및 zabbix 구성 예제 코드 공유의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!