Openresty 官网

http://openresty.org

Openresty源码下载页面

http://openresty.org/en/download.html

Openresty 简易安装说明页面

http://openresty.org/en/installation.html

安装步骤如下

  1. yum install gcc gcc-c++ make automake autoconf libtool wget unzip -y
  2.  
  3. if [ ! -d "/usr/local/software" ]; then mkdir /usr/local/software
  4. fi
  5.  
  6. cd /usr/local/software
  7.  
  8. if [ ! -f "/usr/local/software/openresty-1.15.8.2.tar.gz" ]; then
  9. wget https://openresty.org/download/openresty-1.15.8.2.tar.gz
  10. fi
  11.  
  12. if [ ! -f "/usr/local/software/ngx_http_upstream_check_module.tar.gz" ]; then
  13. wget http://download.zhufunin.com/ngx_http_upstream_check_module.tar.gz
  14. fi
  15.  
  16. if [ ! -f "/usr/local/software/nginx-upstream-dynamic-servers-master.zip" ]; then
  17. wget http://download.zhufunin.com/nginx-upstream-dynamic-servers-master.zip
  18. fi
  19.  
  20. if [ ! -f "/usr/local/software/libmaxminddb-1.3.2.tar.gz" ]; then
  21. wget http://download.zhufunin.com/libmaxminddb-1.3.2.tar.gz
  22. fi
  23.  
  24. if [ ! -f "/usr/local/software/maxmind-city.mmdb.tar.gz" ]; then
  25. wget http://download.zhufunin.com/maxmind-city.mmdb.tar.gz
  26. fi
  27.  
  28. if [ ! -f "/usr/local/software/openssl-1.1.0e.tar.gz" ]; then
  29. wget http://download.zhufunin.com/openssl-1.1.0e.tar.gz
  30. fi
  31.  
  32. if [ ! -f "/usr/local/software/pcre-8.42.tar.gz" ]; then
  33. wget http://download.zhufunin.com/pcre-8.42.tar.gz
  34. fi
  35.  
  36. if [ ! -f "/usr/local/software/zlib-1.2.11.tar.gz" ]; then
  37. wget http://download.zhufunin.com/zlib-1.2.11.tar.gz
  38. fi
  39.  
  40. if [ ! -f "/usr/local/software/ngx_http_geoip2_module.zip" ]; then
  41. wget http://download.zhufunin.com/ngx_http_geoip2_module.zip
  42. fi
  43.  
  44. #if [ ! -f "/usr/local/software/nginx-rtmp-module-master.tar.gz" ]; then
  45. #wget http://download.zhufunin.com/nginx-rtmp-module-master.tar.gz
  46. #fi
  47.  
  48. tar zxvf openresty-1.15.8.2.tar.gz
  49. unzip -o nginx-upstream-dynamic-servers-master.zip
  50. tar zxvf ngx_http_upstream_check_module.tar.gz
  51. tar zxvf libmaxminddb-1.3..tar.gz
  52. tar zxvf maxmind-city.mmdb.tar.gz
  53. tar zxvf openssl-1.1.0e.tar.gz
  54. tar zxvf pcre-8.42.tar.gz
  55. tar zxvf zlib-1.2..tar.gz
  56. unzip -o ngx_http_geoip2_module.zip
  57. #tar zxvf nginx-rtmp-module-master.tar.gz
  58.  
  59. cd ./libmaxminddb-1.3.
  60. ./configure
  61. make && make install
  62. [[ -z `cat /etc/ld.so.conf |grep "\/usr\/local\/lib"` ]] && echo "/usr/local/lib" >> /etc/ld.so.conf
  63. ldconfig
  64.  
  65. groupadd www
  66. useradd -g www -s /sbin/nologin www
  67.  
  68. cd ../openresty-1.15.8.2
  69. ./configure \
  70. --user=www \
  71. --group=www \
  72. --prefix=/usr/local \
  73. --with-http_ssl_module \
  74. --with-http_sub_module \
  75. --with-http_gzip_static_module \
  76. --with-http_gunzip_module \
  77. --with-http_stub_status_module \
  78. --with-http_realip_module \
  79. --with-pcre-jit \
  80. --with-stream \
  81. --with-http_v2_module \
  82. --with-http_iconv_module \
  83. --with-threads \
  84. --with-openssl=/usr/local/software/openssl-1.1.0e \
  85. --with-zlib=/usr/local/software/zlib-1.2. \
  86. --with-pcre=/usr/local/software/pcre-8.42 \
  87. --error-log-path=/usr/local/nginx/logs/error.log \
  88. --http-log-path=/usr/local/nginx/logs/access.log \
  89. --http-client-body-temp-path=/usr/local/nginx/tmp/client_body \
  90. --http-proxy-temp-path=/usr/local/nginx/tmp/proxy \
  91. --http-fastcgi-temp-path=/usr/local/nginx/tmp/fastcgi \
  92. --http-uwsgi-temp-path=/usr/local/nginx/tmp/uwsgi \
  93. --http-scgi-temp-path=/usr/local/nginx/tmp/scgi \
  94. --with-ld-opt="-Wl,-rpath,/usr/local/lib" \
  95. --with-luajit \
  96. --add-module=/usr/local/software/ngx_http_geoip2_module-master \
  97. --add-module=/usr/local/software/ngx_http_upstream_check_module \
  98. --add-module=/usr/local/software/nginx-upstream-dynamic-servers-master \
  99. --without-mail_pop3_module \
  100. --without-mail_imap_module \
  101. --without-mail_smtp_module -j2
  102. make -j2
  103. make install
  104. mkdir -p /usr/local/nginx/tmp/client_body
  1. echo "export PATH=$PATH:/usr/local/nginx/sbin/" >> /etc/profile
  2. source /etc/profile
  1. mkdir -p /usr/local/nginx/ssl
  2.  
  3. openssl req -x509 -nodes -days -newkey rsa: -keyout /usr/local/nginx/ssl/nginx.key -out /usr/local/nginx/ssl/nginx.crt -subj "/C=US/ST=US/L=US/O=ssl/OU=ssl/CN=ssl.com/emailAddress=admin@ssl.com"
  1. echo "ulimit -n 65535" >> /etc/profile
  2. echo "root soft nofile 65535" >> /etc/security/limits.conf
  3. echo "root hard nofile 65535" >> /etc/security/limits.conf
  4. echo "* soft nofile 65535" >> /etc/security/limits.conf
  5. echo "* hard nofile 65535" >> /etc/security/limits.conf
  6. source /etc/profile

 

j2代表双核处理,如果CPU是4核,可以写出j4

请在这个网站生成配置文件https://www.digitalocean.com/community/tools/nginx

本人的自用配置反向代理,https://www.cnblogs.com/faberbeta/p/nginx-install004.html

centos 7 源码安装openresty的更多相关文章

  1. CentOS下源码安装Apache2.4+PHP5.4+MySQL5.5

    一.准备(把所有的源文件放在‘/home/yuanjun’目录下) apr http://mirror.bjtu.edu.cn/apache/apr/apr-1.4.6.tar.gz apr-util ...

  2. 在 Ubuntu 上使用源码安装 OpenResty

    镜像下载.域名解析.时间同步请点击 阿里云开源镜像站 本文将介绍如何在 Ubuntu 上使用源码安装 OpenResty. 目标 Ubuntu 18.04 OpenResty 1.19.3.2 安装依 ...

  3. CentOS下源码安装vsftpd-3.0.0,并设置指定用户访问指定目录(附带完整配置文件)

    1.卸载系统已经存在的ftp服务器 因为是源码安装,所以不能通过rpm -qa的方式查看是否已经安装ftp服务器,可以通过find / | grep vsftp*方式查看系统中存在哪些与vsftpd相 ...

  4. 在 CentOS 下源码安装 Xen

    http://www.vpsee.com/2010/04/install-xen-on-centos-from-source/ 在 CentOS 源码编译安装 Xen 的过程和在 Debian 上编译 ...

  5. Centos下源码安装git

    1.centos下git版本太久了,才1.8几,而官方更新的还是很活跃的,于是我就想源码安装一个新版本. 2.首先到: https://github.com/git/git/releases 下载最新 ...

  6. centos上源码安装clang 3.8

    之前想在centos系统上安装clang 3.6版本,由于yum上版本太低,想通过源码编译安装.按照网上说的源码安装步骤,下好llvm.clang.clang-tools-extra和compiler ...

  7. centos环境源码安装postgresql9.4

    源码安装简要步骤 下载PostgreSQL 源码包  下载根目录地址:http://ftp.postgresql.org/  本人选择的是当前最新版本v9.4.1:http://ftp.postgre ...

  8. centos 7 源码安装gogs

    gogs 是轻量级的私有git 平台,允许个人通过低配置的服务器安装私有git gogs 的官网地址是:https://gogs.io/ 安装步骤 1)源码安装mysql 2)  源码安装git 3) ...

  9. 在CentOS7上源码安装OpenResty

    您必须将这些库perl 5.6.1+libreadlinelibpcrelibssl安装在您的电脑之中. 对于 Linux来说, 您需要确认使用 ldconfig 命令,让其在您的系统环境路径中能找到 ...

随机推荐

  1. Python json 序列号字典 文本的存储和读取

    rootDir='./resources/v1/'# 根目录 # 按钮测试图片 btnTestPicUrl = { 'armyAttack' : rootDir+'testPic/gj2.jpg', ...

  2. Electron – 基础学习(3): 项目打包成exe桌面应用 之electron-builder

    前次用 electron-packager 打包成功,这次改用 electron-builder 打包,然后根据项目中实际需要进行选择使用. 第一步:全局安装 electron-builder,便于系 ...

  3. Android Studio 学习笔记(四):Adapter和RecyclerView说明

    在现版本中,滚动控件有多种,而相比于ListView,GridView,RecyclerView的用途更广,因此将前两者作为Adapter适配器的引入,再对RecyclerView进行简单讲解. MV ...

  4. JN_0019:CMD命令窗口常用操作

    1,回到根目录下 cd\ 2,

  5. ts中基本数据类型(上)

      /* 定义数组*/ var arr: number[] = [1, 2, 3]; var arr1: Array<number> = [1, 2, 3]; var arr2: [str ...

  6. git rm与git rm --cached的区别

    git rm与git rm --cached的区别 当我们需要删除暂存区或分支上的文件, 同时工作区也不需要这个文件了, 可以使用. git rm file_path git commit -m 'd ...

  7. C# MVC 中自定义权限特性[Authorize]中对于Ajax访问的处理

    在MVC中定义自己的权限特性. 下例中是简单的登录判断,登录信息存与Session中,如果Session中没有登录信息,那么就不通过. 在处理无权限的时候,判断当前请求是否为Ajax请求,如果是Aja ...

  8. day 9 深浅拷贝

    浅copy 现有数据 data = { "name":"alex", "age":18, "scores":{ &quo ...

  9. python3-cookbook笔记:第六章 数据编码和处理

    python3-cookbook中每个小节以问题.解决方案和讨论三个部分探讨了Python3在某类问题中的最优解决方式,或者说是探讨Python3本身的数据结构.函数.类等特性在某类问题上如何更好地使 ...

  10. DOM基础+domReady+元素节点类型判断

    DOM节点类型  nodeType element  1    Node.ELEMENT_NODE   元素节点 attr  2   Node.ATTRIBUTE_NODE  属性节点 text  3 ...