===== 安装
apt update
apt install -y libpcre3-dev libssl-dev zlib1g-dev
take /work/soft
wget http://common-software.oss-cn-hangzhou.aliyuncs.com/nginx/nginx-1.16.0.tar.gz
tar zxvf nginx-1.16.0.tar.gz
ln -s nginx-1.16.0 nginx
cd /work/soft/nginx
./configure \
--with-stream \
--with-stream_realip_module \
--with-stream_ssl_module \
--with-stream_ssl_preread_module
make -j2
make install
===== 相关目录
nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx modules path: "/usr/local/nginx/modules"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
===== 确认软件安装成功
/usr/local/nginx/sbin/nginx -V
===== 更改配置文件
vi /usr/local/nginx/conf/nginx.conf
=======================================
daemon off;
user root;
worker_processes auto;
pid /run/nginx.pid;
worker_rlimit_nofile 655350;
events {
worker_connections 655350;
multi_accept on;
}
include /usr/local/nginx/conf/xcoin_pool.conf;
========================================
vi /usr/local/nginx/conf/xcoin_pool.conf
UDS方式:
|
TCP方式:
|
添加证书:
cd /work/pool
vim poolin.cert
========================
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
========================
vim poolin.pkey
=========================
-----BEGIN RSA PRIVATE KEY-----
-----END RSA PRIVATE KEY-----
=========================
证书添加执行权限:
chmod +x poolin.cert poolin.pkey
创建errorlog文件
mkdir -p /work/soft/nginx/logs/ && touch /work/soft/nginx/logs/error.log
nginx 配置文件检测命令
|
===== 配置 supervisor
vim /etc/supervisor/conf.d/nginx.conf
[program:nginx]
directory=/work/soft/nginx
command=/usr/local/nginx/sbin/nginx
autostart=true
autorestart=true
startsecs=3
startretries=20
- 启动supervisor `supervisorctl`
- 重新读取配置文件`reread`
- 更新配置文件`update`
- 查看状态`status`
-查看端口状态
netstat -anput | grep 5222
检测
openssl s_client -tls1_2 -showcerts -connect IP:5222