Openresty 官网

http://openresty.org

Openresty源码下载页面

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

Openresty 简易安装说明页面

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

安装步骤如下

yum install gcc gcc-c++ make automake autoconf libtool wget unzip -y

if [ ! -d "/usr/local/software" ]; then mkdir /usr/local/software
fi cd /usr/local/software if [ ! -f "/usr/local/software/openresty-1.15.8.2.tar.gz" ]; then
wget https://openresty.org/download/openresty-1.15.8.2.tar.gz
fi if [ ! -f "/usr/local/software/ngx_http_upstream_check_module.tar.gz" ]; then
wget http://download.zhufunin.com/ngx_http_upstream_check_module.tar.gz
fi if [ ! -f "/usr/local/software/nginx-upstream-dynamic-servers-master.zip" ]; then
wget http://download.zhufunin.com/nginx-upstream-dynamic-servers-master.zip
fi if [ ! -f "/usr/local/software/libmaxminddb-1.3.2.tar.gz" ]; then
wget http://download.zhufunin.com/libmaxminddb-1.3.2.tar.gz
fi if [ ! -f "/usr/local/software/maxmind-city.mmdb.tar.gz" ]; then
wget http://download.zhufunin.com/maxmind-city.mmdb.tar.gz
fi if [ ! -f "/usr/local/software/openssl-1.1.0e.tar.gz" ]; then
wget http://download.zhufunin.com/openssl-1.1.0e.tar.gz
fi if [ ! -f "/usr/local/software/pcre-8.42.tar.gz" ]; then
wget http://download.zhufunin.com/pcre-8.42.tar.gz
fi if [ ! -f "/usr/local/software/zlib-1.2.11.tar.gz" ]; then
wget http://download.zhufunin.com/zlib-1.2.11.tar.gz
fi if [ ! -f "/usr/local/software/ngx_http_geoip2_module.zip" ]; then
wget http://download.zhufunin.com/ngx_http_geoip2_module.zip
fi #if [ ! -f "/usr/local/software/nginx-rtmp-module-master.tar.gz" ]; then
#wget http://download.zhufunin.com/nginx-rtmp-module-master.tar.gz
#fi tar zxvf openresty-1.15.8.2.tar.gz
unzip -o nginx-upstream-dynamic-servers-master.zip
tar zxvf ngx_http_upstream_check_module.tar.gz
tar zxvf libmaxminddb-1.3..tar.gz
tar zxvf maxmind-city.mmdb.tar.gz
tar zxvf openssl-1.1.0e.tar.gz
tar zxvf pcre-8.42.tar.gz
tar zxvf zlib-1.2..tar.gz
unzip -o ngx_http_geoip2_module.zip
#tar zxvf nginx-rtmp-module-master.tar.gz cd ./libmaxminddb-1.3.
./configure
make && make install
[[ -z `cat /etc/ld.so.conf |grep "\/usr\/local\/lib"` ]] && echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig groupadd www
useradd -g www -s /sbin/nologin www cd ../openresty-1.15.8.2
./configure \
--user=www \
--group=www \
--prefix=/usr/local \
--with-http_ssl_module \
--with-http_sub_module \
--with-http_gzip_static_module \
--with-http_gunzip_module \
--with-http_stub_status_module \
--with-http_realip_module \
--with-pcre-jit \
--with-stream \
--with-http_v2_module \
--with-http_iconv_module \
--with-threads \
--with-openssl=/usr/local/software/openssl-1.1.0e \
--with-zlib=/usr/local/software/zlib-1.2. \
--with-pcre=/usr/local/software/pcre-8.42 \
--error-log-path=/usr/local/nginx/logs/error.log \
--http-log-path=/usr/local/nginx/logs/access.log \
--http-client-body-temp-path=/usr/local/nginx/tmp/client_body \
--http-proxy-temp-path=/usr/local/nginx/tmp/proxy \
--http-fastcgi-temp-path=/usr/local/nginx/tmp/fastcgi \
--http-uwsgi-temp-path=/usr/local/nginx/tmp/uwsgi \
--http-scgi-temp-path=/usr/local/nginx/tmp/scgi \
--with-ld-opt="-Wl,-rpath,/usr/local/lib" \
--with-luajit \
--add-module=/usr/local/software/ngx_http_geoip2_module-master \
--add-module=/usr/local/software/ngx_http_upstream_check_module \
--add-module=/usr/local/software/nginx-upstream-dynamic-servers-master \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module -j2
make -j2
make install
mkdir -p /usr/local/nginx/tmp/client_body
echo "export PATH=$PATH:/usr/local/nginx/sbin/" >> /etc/profile
source /etc/profile
mkdir -p /usr/local/nginx/ssl

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"
echo "ulimit -n 65535" >> /etc/profile
echo "root soft nofile 65535" >> /etc/security/limits.conf
echo "root hard nofile 65535" >> /etc/security/limits.conf
echo "* soft nofile 65535" >> /etc/security/limits.conf
echo "* hard nofile 65535" >> /etc/security/limits.conf
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. codewars--js--counting duplicates

    题目描述: Count the number of Duplicates Write a function that will return the count of distinct case-in ...

  2. css如何玩转有序无序列表项list样式

    在无序列表ul>li中,无线列表的标志是出现在各列表前面的圆点.在有序列表ol>li中,前面默认带有数字,如何修改列表前面的项目符号,只需要通过list-style调整就好,常见的符号有( ...

  3. 寒假学习进度一(安卓配置环境的搭建和hello world)

    今天学习内容:观看了哔哩哔哩上的安卓教学视频,简单了解下了安卓的基本知识 具体内容: 一.配置安卓开发环境(安装Android studio,配置JDK) Android studio是个集成环境,不 ...

  4. 在服务器上搭建远端git仓库

    推荐使用运行Liunx的机器 请获取root权限后进行下面操作 安装git # 检查是否安装了git如果有版本号就无需再安装 git -v # 安装git sudo apt-get install g ...

  5. GitLab Runner

    GitLab Runner是一个开源项目,用于运行你的作业(jobs)并将结果发送回GitLab.它与GitLab CI结合使用,GitLab CI是GitLab用于协调jobs的开源持续集成服务. ...

  6. CentOS6 用yum安装mysql详解,简单实用

    一.查看CentOS下是否已安装mysql 输入命令 :yum list installed | grep mysql 二.删除已安装mysql 输入命令: yum -y remove mysql 如 ...

  7. python简明教程

    Python简明教程 MachinePlay关注 0.7072018.09.26 01:49:43字数 2,805阅读 9,287 Python一小时快速入门 1.Python简介   pylogo. ...

  8. POSIX简介

    POSIX:Potable Operating System Interface of UNIX (可移植操作系统接口),是IEEE为要在各种UNIX操作系统上运行软件,而定义API的一系列互相关联的 ...

  9. HDU-1754 I Hate It (树状数组模板题——单点更新,区间查询最大值)

    题目链接 ac代码(注意字符读入前需要注意回车的影响) #include<iostream> #include<cstdio> #include<cstring> ...

  10. JAVA JDK keytool 生成数字证书

    简介: 数字证书作为网络安全数据传输的凭证,web在传输时客户端(浏览器)和 服务端(服务器)先进行会话握手,在握手过程中服务端会验证客户端的是否已经在服务端做了认证,这是单向认证.如果是双向认证的话 ...