官方文档:http://nginx.org/en/docs/configure.html

参考:http://jingyan.baidu.com/article/e2284b2b45f693e2e6118de5.html

升级参考:http://urchin.blog.51cto.com/4356076/988860/

http://www.cnblogs.com/terrysun/archive/2012/11/22/2782472.html

编译源码需要的组件

1.zlib  http://www.zlib.net/

2.pcre http://www.pcre.org/            正则表达式

3.openssl  http://www.openssl.org/  可选

4.nginx     http://nginx.org/en/download.html

----------------------------------------------------------------

1.编译zlib (version 1.1.3 — 1.2.8)

mkdir /usr/src/zlib 
cd /usr/src/zlib
wget  http://zlib.net/zlib-1.2.8.tar.gz
tar xvf zlib-1.2.8.tar.gz cd /usr/src/zlib/zlib-1.2.8
./configure --static --prefix=/usr/src/zlib/zlib-1.2.8 make make install

2.编译openssl

 直接使用apt-get进行安装 
sudo apt-get install openssl
sudo apt-get install libssl-dev

3.编译pcre (version 4.4 — 8.38)

mkdir /usr/src/pcre
wget  ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz
tar xvf pcre2-8.38.tar.gz
/configure --prefix=/usr/src/pcre/pcre-8.38

make install

4.编译ngnix

mkdir /usr/src/nginx
cd /usr/src/nginx
wget http://nginx.org/download/nginx-1.9.14.tar.gz
tar xvf nginx-1.9.14.tar.gz
mv nginx-1.9.14 nginx
./configure --prefix=/usr/local/nginx/  --conf-path=/usr/local/nginx/nginx.conf --sbin-path=/usr/local/nginx/sbin/nginx --with-debug --with-openssl=/usr/src/openssl/openssl-1.0.2g --with-zlib=/usr/src/zlib/zlib-1.2.8 --with-pcre=/usr/src/pcre/pcre-8.38 --with-http_stub_status_module --with-http_gzip_static_module 
  
make install

生成的nginx在/usr/local/nginx/sbin下

./nginx -v 检测是否安装成功
./nginx 启动
在地址栏输入: http://localhost 如果看到以下效果,说明正确安装了

最新文章

  1. rails利用big_sitemap生成sitemap
  2. BZOJ 2566 xmastree(树分治+multiset)
  3. CentOS终端界面登入Linux
  4. L - Connections in Galaxy War - zoj 3261
  5. mobile优化
  6. Javascript Promise 学习 (中)
  7. android蓝牙的调试(博通蓝牙工作 and 低功耗模式)
  8. 依赖注入(IOC)
  9. [HMLY]3.如何使用Xcode Targets管理开发和生产版本?
  10. VMware Workstation 12 Pro 之安装林耐斯优麒麟 X64系统
  11. 【转】Reflector、reflexil、De4Dot、IL相关操作指令合集
  12. 题解-UOJ284 快乐游戏鸡
  13. 使用配置文件自定义Ribbon配置
  14. 18.4 运行脚本 sudo ./launcher.sh 必须先给他权限 才能使用
  15. Python处理微信利器——itchat
  16. 对Repository模式误用的反思和纠正
  17. leetcode:Same Tree【Python版】
  18. execution表达式
  19. python笔记2-冒泡排序
  20. Android开发之Drag&Drop框架实现拖放手势

热门文章

  1. 使用Python脚本强化LLDB调试器
  2. version_info
  3. Liunx 配置IDE
  4. <六>面向对象分析之UML核心元素之业务实体
  5. ajax请求总是不成功?浏览器的同源策略和跨域问题详解
  6. .NET之美——1.1 C#中的泛型
  7. POJ 3233 Matrix Power Serie
  8. hihoCoder 1385 A Simple Job
  9. c# 进行AE开发时,如何在地图上定位出一个点
  10. POJ2987 Firing 最大权闭合图