ubuntu 22.04 编译 nginx 1.22

2023-10-30 103 0

sudo apt install build-essential curl gnupg2 ca-certificates zlib1g-dev libssl-dev libpcre3-dev
wget https://nginx.org/download/nginx-1.22.1.tar.gz
tar xf nginx-1.22.1.tar.gz
cd nginx-1.22.1

./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-stream --with-http_gzip_static_module --with-http_stub_status_module --with-pcre --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-http_secure_link_module --with-http_v2_module 

make -j 4 && make install
cat /etc/systemd/system/nginx.service

[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target

[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

相关文章

nginx 1.22 编译webdav插件

发布评论