nginx安装-源码编译
2024-08-27 23:27:59
官方文档: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 如果看到以下效果,说明正确安装了
最新文章
- rails利用big_sitemap生成sitemap
- BZOJ 2566 xmastree(树分治+multiset)
- CentOS终端界面登入Linux
- L - Connections in Galaxy War - zoj 3261
- mobile优化
- Javascript Promise 学习 (中)
- android蓝牙的调试(博通蓝牙工作 and 低功耗模式)
- 依赖注入(IOC)
- [HMLY]3.如何使用Xcode Targets管理开发和生产版本?
- VMware Workstation 12 Pro 之安装林耐斯优麒麟 X64系统
- 【转】Reflector、reflexil、De4Dot、IL相关操作指令合集
- 题解-UOJ284 快乐游戏鸡
- 使用配置文件自定义Ribbon配置
- 18.4 运行脚本 sudo ./launcher.sh 必须先给他权限 才能使用
- Python处理微信利器——itchat
- 对Repository模式误用的反思和纠正
- leetcode:Same Tree【Python版】
- execution表达式
- python笔记2-冒泡排序
- Android开发之Drag&;Drop框架实现拖放手势