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 命令,让其在您的系统环境路径中能找到 ...
随机推荐
- Python json 序列号字典 文本的存储和读取
rootDir='./resources/v1/'# 根目录 # 按钮测试图片 btnTestPicUrl = { 'armyAttack' : rootDir+'testPic/gj2.jpg', ...
- Electron – 基础学习(3): 项目打包成exe桌面应用 之electron-builder
前次用 electron-packager 打包成功,这次改用 electron-builder 打包,然后根据项目中实际需要进行选择使用. 第一步:全局安装 electron-builder,便于系 ...
- Android Studio 学习笔记(四):Adapter和RecyclerView说明
在现版本中,滚动控件有多种,而相比于ListView,GridView,RecyclerView的用途更广,因此将前两者作为Adapter适配器的引入,再对RecyclerView进行简单讲解. MV ...
- JN_0019:CMD命令窗口常用操作
1,回到根目录下 cd\ 2,
- ts中基本数据类型(上)
/* 定义数组*/ var arr: number[] = [1, 2, 3]; var arr1: Array<number> = [1, 2, 3]; var arr2: [str ...
- git rm与git rm --cached的区别
git rm与git rm --cached的区别 当我们需要删除暂存区或分支上的文件, 同时工作区也不需要这个文件了, 可以使用. git rm file_path git commit -m 'd ...
- C# MVC 中自定义权限特性[Authorize]中对于Ajax访问的处理
在MVC中定义自己的权限特性. 下例中是简单的登录判断,登录信息存与Session中,如果Session中没有登录信息,那么就不通过. 在处理无权限的时候,判断当前请求是否为Ajax请求,如果是Aja ...
- day 9 深浅拷贝
浅copy 现有数据 data = { "name":"alex", "age":18, "scores":{ &quo ...
- python3-cookbook笔记:第六章 数据编码和处理
python3-cookbook中每个小节以问题.解决方案和讨论三个部分探讨了Python3在某类问题中的最优解决方式,或者说是探讨Python3本身的数据结构.函数.类等特性在某类问题上如何更好地使 ...
- DOM基础+domReady+元素节点类型判断
DOM节点类型 nodeType element 1 Node.ELEMENT_NODE 元素节点 attr 2 Node.ATTRIBUTE_NODE 属性节点 text 3 ...