1、编译安装Nginx yum install -y pcre pcre-devel # 下载Nginx wget http://nginx.org/download/nginx-1.18.0.tar.gz # 解压Nginx tar -zxvf nginx-1.18.0.tar.gz # 编译安装Nginx cd nginx-1.18.0 mkdir -p /usr/local/nginx/ ./configure --prefix=/usr/local/nginx/ --without-http_rewrite_module --without-http_gzip_module --with-pcre make && make install 启动nginx:/usr/local/nginx/sbin/nginx 2、编译安装php yum install -y libxml2 libxml2-devel yum install -y openssl openssl-devel yum install -y bzip2 bzip2-devel yum install -y libjpeg-devel yum install -y libpng yum install -y libpng-devel yum install -y freetype-devel yum install -y libxslt libxslt-devel # 下载PHP wget https://www.php.net/distributions/php-7.2.25.tar.gz # 解压PHP tar -zxvf php-7.2.25.tar.gz yum install openldap openldap-devel -y # 在编译钱我们需要新增用户组和用户用于编译使用 groupadd www useradd -g www www # 编译PHP(具体模块根据自己情况自行增减,最好加个ldap的模块) cd php-7.2.25 ./configure --prefix=/usr/local/php --with-config-file-path=/etc --with-fpm-user=www --with-fpm-group=www --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-jpeg-dir --with-xmlrpc --with-xsl --with-zlib --with-bz2 --with-mhash --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --enable-zip --enable-fpm --with-ldap # 编译没有问题,我们就可以直接安装PHP了 make && make install 注:在PHP 7.4版本中编译参数 –with-gd 改成了 –enable-gd 安装完成以后我们就可以来配置PHP的环境变量并把PHP添加到系统服务中: # 验证PHP版本 /usr/local/php/bin/php -v # 添加环境变量,把下面的的命令添加到/etc/profile文件的最后 PATH=$PATH:/usr/local/php/bin export PATH # 更新环境变量 source /etc/profile # 查看PHP版本 php -v # 配置PHP-FPM cd php-7.2.25 cp php.ini-production /etc/php.ini cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm chmod +x /etc/init.d/php-fpm # 启动PHP-FPM /etc/init.d/php-fpm start 注:然后我们就可以通过systemctl命令来管理PHP啦! 验证Nginx+php 安装成功: Nginx和PHP都编译安装完成以后、我们需要把Nginx和PHP集成起来;这里我们需要去修改Nginx的配置文件、让Nginx支持PHP,我们去/usr/local/nginx/conf下面修改nginx.conf文件: [root@localhost conf]# grep -v "#" nginx.conf worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name localhost; # 添加index.php location / { root html; index index.php index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # 放开有关php的location注释 location ~ \.php{ root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; # 修改路径 fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name; include fastcgi_params; } } } [root@localhost conf]# 修改完成以后我们重启Nginx和PHP并到/usr/local/nginx/html目录下面新建index.php文件并插入下面的内容: <?php phpinfo(); ?> 重启nginx、php!! 然后我们刷新浏览器页面,可以得到下面的页面就代表Nginx和PHP已经集成成功了: 3、编译安装zabbix-server yum install -y net-snmp-devel mysql-devel libevent-devel # 下载zabbix 5.0 wget https://cdn.zabbix.com/zabbix/sources/stable/5.0/zabbix-5.0.0.tar.gz # 解压Zabbix tar -zxvf zabbix-5.0.0.tar.gz # 配置Zabbix mkdir -p /usr/local/zabbix cd zabbix-5.0.0 ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 # 编译并安装Zabbix make && make install cd zabbix-5.0.0 cp misc/init.d/fedora/core/zabbix_* /etc/init.d/ ll -d /etc/init.d/zabbix_* chmod +x /etc/init.d/zabbix_* groupadd zabbix useradd -r -g zabbix -s /sbin/nologin zabbix 注意、部署数据库(要求 MySQL 8.0 或 Mariadb 10.5 及以上版本) 创建新用户同时配置给该用户testDatabase的所有权限 CREATE DATABASE zabbix character set utf8 collate utf8_bin; create user zabbix@'%' identified by '12345678'; grant all privileges on zabbix.* to zabbix@'%' with grant option; flush privileges; cd /root/zabbix-6.0.21/database/mysql mysql -h 10.206.0.5 -uzabbix -p12345678 zabbix < schema.sql mysql -h 10.206.0.5 -uzabbix -p12345678 zabbix< images.sql mysql -h 10.206.0.5 -uzabbix -p12345678 zabbix < data.sql mysql -h 10.206.0.5 -uzabbix -p12345678 zabbix < double.sql mysql -h 10.206.0.5 -uzabbix -p12345678 zabbix < history_pk_prepare.sql 然后我们拷贝前端文件目录到Nginx服务目录: chown -R www:www /usr/local/nginx/html cp -r /root/zabbix-6.0.21/ui/* /usr/local/nginx/html/ chmod -R 777 /usr/local/nginx/html/conf 4、zabbix-agent 编译安装 agent 编译安装: tar -xf zabbix-5.0.0.tar.gz cd zabbix-5.0.0/ ./configure --prefix=/home/weblogic/zabbix --enable-agent make make install cd /home/weblogic/zabbix mkdir log cd /home/weblogic/zabbix/etc [we@ zabbix]$ cat etc/zabbix_agentd.conf |egrep -v '^$|^#' LogFile=/home/weblogic/zabbix/log/zabbix_agentd.log DenyKey=system.run[*] Server=192.168.1.100 ServerActive=192.168.1.100 Hostname=Zabbix server /home/weblogic/zabbix/sbin/zabbix_agentd 参考:https://blog.csdn.net/weixin_45894220/article/details/126288098
标签:enable,--,编译,zabbix,usr,6.0,php,local From: https://www.cnblogs.com/liuqiqi123/p/17655108.html