0、前期准备
[root@zabbix ~]# yum -y install wget vim lsof lrzsz pcre-devel zlib-devel make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel libmcrypt libmcrypt-devel mcrypt mhash net-snmp-devel
[root@zabbix ~]# useradd -s /sbin/nologin cents # 用于NGINX
[root@zabbix ~]# useradd -s /sbin/nologin mysql # 用于MySQL
[root@zabbix ~]# useradd -s /sbin/nologin zabbix # 用于zabbix
[root@zabbix ~]# mkdir /opt/app
1、Nginx编译
[root@zabbix ~]
[root@zabbix ~]
--user=cents \
--group=cents \
--with-file-aio \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_xslt_module=dynamic \
--with-http_image_filter_module=dynamic \
--with-http_geoip_module=dynamic \
--with-http_sub_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_stub_status_module \
--with-pcre=/opt/soft/pcre-8.44 \
--with-pcre-jit \
--with-openssl=/opt/soft/openssl-1.1.1h
[root@zabbix ~]
[root@zabbix ~]
1.1 Nginx配置
[root@zabbix ~]
user cents;
worker_processes 1;
error_log logs/error.log;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.php index.html;
}
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;