项目需要设置一台前端代理,在Nginx与Tengine中考虑了好几天,最后发现Tengine貌似DDNS才好用,而我的后端服务器是固定IP的,又不要DDNS。所以最终选择Nginx,手动点赞。
正好手上有一台$1.00每年的小机器可以用来作为前端。反正配置也差不多(1核心、384M内存、5G硬盘)
赶紧将系统重置为Debian9 Minimal,一切为性能让步。
然后安装基础编译包:
apt-get install gcc g++ make pcel
如此便妥了
然后呢?然后肯定是继续下载依赖包嘛,主要包含三个依赖包
OpenSSL、ZLib以及Pcre,下载地址如下
OpenSSL: https://www.openssl.org/source/openssl-1.1.1d.tar.gz
Zlib: https://www.zlib.net/zlib-1.2.11.tar.gz
Pcre: https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz
下载之后解压就不用管了
再之后呢?Nginx还没装呢!
不急不急,马上就要开始装了。待我细细道来…
下载Nginx,那是一定的。下载地址:http://nginx.org/download/nginx-1.17.9.tar.gz
下载之后解压,tar zxvf nginx-1.17.9.tar.gz
之后进入到解压后的目录,运行配置命令
./configure --user=web --group=web --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_gunzip_module --with-openssl=../openssl-1.1.1d/ --with-openssl-opt='enable-weak-ssl-ciphers' --with-pcre=../pcre-8.44/ --with-zlib=../zlib-1.2.11/
若无意外,应该是正常了。之后make & make install编译并安装便可。
以上,便是Debian9 Minimal编译安装Nginx 1.17.9的全部信息了。
文章评论