一、安装环境依赖
sudo apt-get install g++ sudo apt-get install openssl libssl-dev sudo apt-get install libpcre3 libpcre3-dev sudo apt-get install zlib1g-dev sudo apt-get install libgd-dev
二、下载安装包
wget http://nginx.org/download/nginx-1.23.4.tar.gz
解压
tar xzf nginx-1.23.4.tar.gz cd nginx-1.23.4
三、编译
./configure --prefix=/usr/local/nginx \ --with-pcre \ --with-http_ssl_module \ --with-http_v2_module \ --with-http_realip_module \ --with-http_addition_module \ --with-http_sub_module \ --with-http_dav_module \ --with-http_flv_module \ --with-http_mp4_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-http_auth_request_module \ --with-http_image_filter_module \ --with-http_slice_module \ --with-mail \ --with-threads \ --with-file-aio \ --with-stream \ --with-mail_ssl_module \ --with-stream_ssl_module \
注意:安装目录是(/usr/local/nginx)
安装
make make install
四、启动
cd /usr/local/ #启动 ./sbin/nginx #修改配置后重新加载生效 ./sbin/nginx -s reload #快速停止nginx ./sbin/nginx -s stop #完整有序的停止nginx ./sbin/nginx -s quit #查看nginx的版本 ./sbin/nginx -v #查看版本和nginx的配置选项 ./sbin/nginx -V #测试nginx配置文件是否正确 ./sbin/nginx -t
标签:LTS,sbin,http,--,module,nginx,22.04,install From: https://www.cnblogs.com/hunttown/p/17352390.html