centos 7 源码安装openresty
Openresty 官网
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的更多相关文章
- 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 ...
- 在 Ubuntu 上使用源码安装 OpenResty
镜像下载.域名解析.时间同步请点击 阿里云开源镜像站 本文将介绍如何在 Ubuntu 上使用源码安装 OpenResty. 目标 Ubuntu 18.04 OpenResty 1.19.3.2 安装依 ...
- CentOS下源码安装vsftpd-3.0.0,并设置指定用户访问指定目录(附带完整配置文件)
1.卸载系统已经存在的ftp服务器 因为是源码安装,所以不能通过rpm -qa的方式查看是否已经安装ftp服务器,可以通过find / | grep vsftp*方式查看系统中存在哪些与vsftpd相 ...
- 在 CentOS 下源码安装 Xen
http://www.vpsee.com/2010/04/install-xen-on-centos-from-source/ 在 CentOS 源码编译安装 Xen 的过程和在 Debian 上编译 ...
- Centos下源码安装git
1.centos下git版本太久了,才1.8几,而官方更新的还是很活跃的,于是我就想源码安装一个新版本. 2.首先到: https://github.com/git/git/releases 下载最新 ...
- centos上源码安装clang 3.8
之前想在centos系统上安装clang 3.6版本,由于yum上版本太低,想通过源码编译安装.按照网上说的源码安装步骤,下好llvm.clang.clang-tools-extra和compiler ...
- centos环境源码安装postgresql9.4
源码安装简要步骤 下载PostgreSQL 源码包 下载根目录地址:http://ftp.postgresql.org/ 本人选择的是当前最新版本v9.4.1:http://ftp.postgre ...
- centos 7 源码安装gogs
gogs 是轻量级的私有git 平台,允许个人通过低配置的服务器安装私有git gogs 的官网地址是:https://gogs.io/ 安装步骤 1)源码安装mysql 2) 源码安装git 3) ...
- 在CentOS7上源码安装OpenResty
您必须将这些库perl 5.6.1+libreadlinelibpcrelibssl安装在您的电脑之中. 对于 Linux来说, 您需要确认使用 ldconfig 命令,让其在您的系统环境路径中能找到 ...
随机推荐
- Mock模拟数据,前后端分离
安装 使用npm安装: npm install mockjs; 或直接<script src="http://mockjs.com/dist/mock.js">< ...
- [算法] Dijkstra算法(带权有向图 最短路径算法)
一.带权有向图 二.算法原理 1)由于我们的节点是从1-6,所以我们创建的列表或数组都是n+1的长度,index=0的部分不使用,循环范围为1-6(方便计算). 2)循环之前,我们先初始化dis数组和 ...
- 百度大脑发布“AI开发者‘战疫’守护计划”,AI支援抗疫再升级
面对新冠肺炎疫情,AI开发者们正在积极运用算法.算力.软件等“武器”助力抗疫.针对开发者们在疫情防控期间的开发与学习需求,2月6日,百度大脑推出“AI开发者‘战疫’守护计划”, 正在进行疫情防控相关应 ...
- 记一次Postgres CPU爆满故障
问题描述 公司项目测试环境调用某些接口的时候,服务器立即崩溃,并一定时间内无法提供服务. 问题排查 服务器配置不够 第一反应是服务器需要升配啦,花钱解决一切!毕竟测试服务器配置确实不高,2CPU + ...
- Mac下appium-doctor提示错误汇总
一. 提示 [Error: Could not detect Mac OS X Version from sw_vers output: '10.12'] 解决方法: 1.终端执 ...
- jmeter-json提取器提取的内容含”引号
这时如果直接赋值会报错 解决方法: 1.用vars.get("Object")提取变量的值 2.用代码提取,最后把提取到的Object或Array转为String
- set()和get()方法
在很多程序中,都喜欢定义一个privata变量,然后为这个私有变量加上get(),set()方法.那为什么不直接定义一个public变量呢?这样做到底有什么好处和意义呢?难道真的仅仅只是为了代码规范? ...
- #AcWing系列课程Level-2笔记——4. 浮点数二分算法
浮点数二分算法 编写浮点数二分,记住下面的思路,代码也就游刃有余了! 1.首先找到数组的中间值,mid=(left+right)>>1,区间[left, right]被划分成[left, ...
- 剑指offer-面试题39-数组中出现次数超过一半的数字-抵消法
/* 题目: 数组中有一个数字出现的次数超过数组长度的一半,请找出这个数字. 例如输入一个长度为9的数组{1,2,3,2,2,2,5,4,2}.由于数字2在数组中出现了5次,超过数组长度的一半,因此输 ...
- VSCode常用插件之vscode-stylelint使用
更多VSCode插件使用请访问:VSCode常用插件汇总 vscode-stylelint这是一个检验CSS/SASS/LESS代码规范的插件. StyleLint 使用指南 vscode-style ...