ubuntu20.04源码安装nginx
下载
wget http://nginx.org/download/nginx-1.19.0.tar.gz
安装依赖软件
更新源
sudo apt-get update
安装c++依赖库
sudo apt-get install build-essential
sudo apt-get install libtool
安装openssl依赖库
sudo apt-get install openssl
安装pcre依赖库
sudo apt-get install libpcre3 libpcre3-dev
安装zlib依赖库
sudo apt-get install zlib1g-dev
编译
./configure --prefix=/usr/local/nginx \
--with-http_ssl_module \
--http-client-body-temp-path=/usr/local/nginx/temp/client_body_temp \
--http-proxy-temp-path=/usr/local/nginx/temp/proxy_temp \
--http-fastcgi-temp-path=/usr/local/nginx/temp/fastcgi_temp \
--http-uwsgi-temp-path=/usr/local/nginx/temp/uwsgi_temp \
--http-scgi-temp-path=/usr/local/nginx/temp/scgi_temp
安装
make && make install
启动
cd /usr/local/nginx/sbin
./nginx