3.nginx 源码安装

1.下载稳定版本
wget https://nginx.org/download/nginx-1.14.0.tar.gz
2.下载安装依赖
# 安装C编译器
apt-get install -y gcc g++ make automake build-essential

# 安装 PCRE 库,Nginx Core 和 Rewrite 模块提供正则支持
apt-get install libpcre3 libpcre3-dev

# 安装OPenSSL
sudo apt-get install openssl libssl-dev libperl-dev

# 安装zlib 库,提供 Gzip 模块支持,压缩headers
apt-get install -y zlib1g zlib1g-dev 

# 安装XML xslt
apt-get install libxslt-dev

# 安装GD Library
apt-get install libgd2-dev

# 安装GeoIP Library
apt-get install libgeoip-dev
3.设置编译安装参数
# 以下是一行。。用于生成makefile。如果需要添加第三方模块,使用--add-module=/path/module1的方法编译
./configure --prefix=/usr/local/nginx --with-ipv6 --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_perl_module --with-mail --with-mail_ssl_module
4.编译安装
make
make install
5.启动
/usr/local/nginx/sbin/nginx
6.访问

http://xxx.xxx.xxx.xxx

 

 

https://www.jianshu.com/p/4134a44a09c2

http://einverne.github.io/post/2017/06/ubuntu-debian-install-nginx.html

 

posted @ 2018-04-24 14:27  桃源仙居  阅读(97)  评论(0)    收藏  举报