1.1 安装依赖包
yum -y install gcc pcre-devel zlib-devel openssl-devel
1.2 解压nginx源码包,编译安装
tar -xf nginx-1.18.0.tar.gz
cd nginx-1.18.0/
./configure --prefix=/usr/local/nginx1180 --with-http_ssl_module
make && make install
1.3 修改配置文件,支持php
vim /usr/local/nginx1180/conf/nginx.conf
1.4 启动nginx服务
/usr/local/nginx1180/sbin/nginx
2.1 此处采用mysq源码编译(脚本),具体可网上搜其它资源
准备: 脚本和包,放在同一目录下
包:mysql5729.tar.gz 脚本:mysql5729_install_v5.sh
执行方式:bash ./mysql5729_install_v5.sh
2.2 启动mysql服务
/etc/init.d/mysqld start
登录方式: mysql5729 -uroot -p
3.1 升级操作系统自带的sqlite3
tar -xf sqlite-autoconf-3320100.tar.gz
cd sqlite-autoconf-3320100/
./configure --prefix=/usr/local/sqlite332
make && make install
mv /usr/bin/sqlite3 /usr/bin/sqlite3_bak
ln -s /usr/local/sqlite332/bin/sqlite3 /usr/bin/sqlite3
echo "/usr/local/sqlite332/lib/" >> /etc/ld.so.conf.d/sqlite3.conf
ldconfig
sqlite3 -version #验证
3.2 编译安装php
yum -y install curl-devel libevent-devel libxml2-devel libcurl-devel libpng libpng-devel libjpeg libjpeg-devel freetype freetype-devel
tar -xf php-7.4.6.tar.gz
cd php-7.4.6/
export PKG_CONFIG_PATH="/usr/local/sqlite332/lib/pkgconfig/"
./configure --prefix=/usr/local/php746/ --enable-fpm --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-zlib --enable-xml --enable-bcmath --with-curl --enable-mbstring --enable-gd --with-openssl --enable-pcntl --enable-sockets --with-gettext --with-jpeg --with-freetype --disable-mbregex
make && make install
vim /etc/profile
PATH=$PATH:/usr/local/php746/bin/
export PATH
cp php.ini-production /usr/local/php746/lib/php.ini
cp /usr/local/php746/etc/php-fpm.conf.default /usr/local/php746/etc/php-fpm.conf
cp /usr/local/php746/etc/php-fpm.d/www.conf.default /usr/local/php746/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
3.3 启动php-fpm服务
/etc/init.d/php-fpm start
tar -xf php56_soft.tar.gz
cd ./php56_soft && yum -y install ./*.rpm
yum -y install pcre net-snmp-devel
rpm -e mariadb-libs-5.5.65-1.el7.x86_64 --nodeps
ln -s /usr/local/mysql-5.7.29/lib/libmysqlclient.so.20 /usr/lib64/libmysqlclient.so.20
tar -xf zabbix-4.4.8.tar.gz
cd zabbix-4.4.8/
./configure --prefix=/usr/local/zabbix448 --enable-server --enable-agent --with-mysql=/usr/local/mysql-5.7.29/bin/mysql_config --with-net-snmp -with-libcurl --with-libxml2
make && make install
yum -y install mysql-devel
./configure --prefix=/usr/local/zabbix448 --enable-server --enable-agent --with-mysql --with-net-snmp -with-libcurl --with-libxml2
useradd -s /bin/false zabbix
mysql5729 -uroot -p
> create database zabbix;
> grant all on zabbix.* to zabbix@localhost identified by 'zabbix';
> grant all on zabbix.* to zabbix@”172.16.10.%” identified by 'zabbix'; # 此授权用于MySQL和Zabbix部署在不同服务器上
mysql5729 -uroot -p
> use zabbix;
> source /root/zabbix/zabbix-4.4.8/database/mysql/schema.sql;
> source /root/zabbix/zabbix-4.4.8/database/mysql/images.sql;
> source /root/zabbix/zabbix-4.4.8/database/mysql/data.sql;
mkdir /usr/local/nginx1180/html/zabbix
cd zabbix-4.4.8/frontends/php/
cp -a * /usr/local/nginx1180/html/zabbix/
chmod -R 777 /usr/local/nginx/html/zabbix/conf/ # 改权限,否则zabbix网页配置无法自动保存
vim /usr/local/php746/lib/php.ini
date.timezone = Asia/Shanghai
max_execution_time = 300
post_max_size = 32M
max_input_time = 300
mkdir -p /data/zabbix/server_logs /data/zabbix/server_data
chown -R zabbix.zabbix /data/zabbix/
vim /usr/local/zabbix448/etc/zabbix_server.conf
DBHost=localhost # 如果MySQL数据不再本机,那么直接指定MySQL主机IP
DBName=Zabbix
DBUser=Zabbix
DBPassword=zabbix
PidFile=/data/zabbix/server_data/zabbix_server.pid
LogFile=/data/zabbix/server_logs/zabbix_server.log
# 一般包括:listenIP、listenPort、logFile、PidFile、DB参数
/usr/local/nginx1180/sbin/nginx -s reload
/etc/init.d/mysqld restart
/etc/init.d/php-fpm restart
/usr/local/zabbix448/sbin/zabbix_server
# 开放防火墙端口80,访问网页
firewall-cmd --zone=public --add-port=80/tcp --permanent
systemctl restart firewalld
http://172.16.10.11/zabbix/index.php
bash ./ zabbix_agentd_install_v1.sh
yum -y install gcc pcre-devel
tar -xf zabbix-4.4.8.tar.gz
cd zabbix-4.4.8/
./configure --prefix=/usr/local/zabbix448 --enable-agent
make && make install
mkdir -p /data/zabbix/agent_logs /data/zabbix/agent_data
useradd -s /bin/false zabbix
chown -R zabbix.zabbix /data/zabbix/
vim /usr/local/zabbix448/etc/zabbix_agentd.conf
Server=172.16.10.11 # server端ip
ServerActive=172.16.10.11
Hostname=web13 # 本机主机名
PidFile=/data/zabbix/agent_data/zabbix_agentd.pid # pid文件和日志文件存放路径
LogFile=/data/zabbix/agent_logs/zabbix_agentd.log
Include=/usr/local/zabbix448/etc/zabbix_agentd.conf.d/ # 开启自定义监控项功能
UnsafeUserParameters=1
# 一般包括:listenIP、listenPort、logFile、PidFile、Server、 ServerActive、Hostname、Include、UnsafeUserParameters参数
firewall-cmd --zone=public --add-port=10050/tcp --permanent
systemctl restart firewalld
/usr/local/zabbix448/sbin/zabbix_agentd
http://172.16.10.11/zabbix/index.php
配置 ----> 主机 ----> 创建主机:web13,主机群组:web,IP及端口
被监控主机---->模板---->如:Template OS Linux by Zabbix agent
监测 ----> 最新数据 ----> 被监控主机web13 ----> 应用
解决:拷贝所需字体到zabbix_server
C:\Windows\Fonts\下的字体(如:华文楷体 常规、楷体 常规)
---->/usr/local/nginx1180/html/zabbix/assets/fonts/
vim …/html/zabbix/include/defines.inc.php # 搜font