一、安装nginx

yum安装nginx 折叠源码
1
2
3
4
5
6
7
8
9
10
11
12
# 添加nginx源
rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
# 查看nginx的yum源
yum info nginx
# 安装nginx
yum install nginx
# 查看nginx安装模块
nginx -vV
 
 
...
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'

二、下载nginx源码包

wget下载源码 折叠源码
1
2
3
4
5
# 下载
wget http://nginx.org/download/nginx-1.14.2.tar.gz
# 解压
# tar xf nginx-1.14.2.tar.gz
# cd nginx-1.14.2

三、编译

添加:--with-threads模块

编译nginx 折叠源码
1
2
./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' --with-threads
make && make install

四、reload服务器

reload服务器 折叠源码
1
nginx -s reload

最新文章

  1. 二维码合成,将苹果和安卓(ios和android)合成一个二维码,让用户扫描一个二维码就可以分别下载苹果和安卓的应用
  2. 从零自学Hadoop(09):使用Maven构建Hadoop工程
  3. tomcat 设置根目录访问
  4. linux 下 用户与用户组
  5. windows7 密码保护 共享文件
  6. C#使用ConditionalAttribute特性来实现代码调试
  7. Android内存泄漏问题(一)
  8. Glibc辅助运行库 (C RunTime Library): crt0.o,crt1.o,crti.o crtn.o,crtbegin.o crtend.o
  9. .NET MVC插件化开发框架源码(插件功能完善版)
  10. HTML5 总结-表单-表单元素
  11. 使用Python改写的身份证信息查询小程序
  12. HPU--1141 蜗牛爬树
  13. springMVC源码分析--HandlerMethod
  14. python爬虫之Cookie
  15. 论文阅读笔记二十五:Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition(SPPNet CVPR2014)
  16. 加密算法之非对称加密RSA
  17. idea:打包jar(原文by曲高终和寡)
  18. nginx配置location总结及rewrite规则写法(2)
  19. Sophus链接错误
  20. BZOJ.1031.[JSOI2007]字符加密(后缀数组)

热门文章

  1. 剑指 Offer 43. 1~n 整数中 1 出现的次数 + 数位模拟 + 思维
  2. .Net Core 处理跨域问题Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource
  3. 推荐模型AutoRec:原理介绍与TensorFlow2.0实现
  4. RFC2544吞吐量测试详细步骤-MiniSMB-HurricaneII软件操作演示
  5. java将数据生成csv文件
  6. Python-tkinter-window
  7. 10 分钟轻松学会 Jackson 反序列化自动适配子类
  8. Error message: Failed to spawn: unable to access process with pid 413 due to system restrictions; try `sudo sysctl kernel.yama.ptrace_scope=0`, or run Frida as root
  9. 全量同步Elasticsearch方案之Canal
  10. 手机浏览器通过Scheme跳转APP,兼容各种手机浏览器