ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

ubuntu nginx安装部署

2026/9/14 3:21:01 拓冰建站 浏览量
ubuntu nginx安装部署

上传nginx-1.18.0.tar.gz

mv nginx-1.18.0.tar.gz /usr/local/
#解压
tar -zxvf nginx-1.18.0.tar.gz
#安装
cd nginx-1.18.0
#安装依赖包apt-get install build-essential zlib1g-dev libpcre3 libpcre3-dev libssl-dev libxslt1-dev libxml2-dev libgeoip-dev openssl libgd-dev

编译安装

./configure \--sbin-path=/usr/local/nginx/nginx \--conf-path=/usr/local/nginx/nginx.conf \--pid-path=/usr/local/nginx/nginx.pid \--with-threads \--with-file-aio \--with-http_ssl_module \--with-http_v2_module \--with-http_realip_module \--with-http_addition_module \--with-http_xslt_module \--with-http_image_filter_module \--with-http_geoip_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_auth_request_module \--with-http_random_index_module \--with-http_secure_link_module \--with-http_degradation_module \--with-http_slice_module \--with-http_stub_status_module \--with-stream \--with-stream_ssl_module \--with-stream_realip_module \--with-stream_geoip_module \--with-stream_ssl_preread_module \--with-compat  \--with-pcre-jit&& make && make install

设置软链接

ln -s /usr/local/nginx/nginx /usr/local/bin/nginx

启动

nginx

浏览器查看-安装成功