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

最新文章

  1. Android之SAX解析XML
  2. android webview远程调试
  3. Python“Non-ASCII character 'xe5' in file”报错问题(转)
  4. 异常和IO
  5. 通过JSTL用表格的形式显示
  6. Ubuntu频率较高的操作
  7. Asp.Net Mvc: 浅析TempData机制(转发 作者: Tristan G )
  8. 使用Material Design 创建App翻译系列----材料主题的使用(Using Material Theme)
  9. Win7如何取消用户登陆界面
  10. RPO(Relative Path Overwrite)
  11. machinekey生成工具 v1.0 官方最新版
  12. mysql主从复制延迟问题的相关知识与解决方案
  13. HDOJ2017_字符串统计
  14. php中的session过期思考一二
  15. 第五个神奇的电梯(代码抢先看<1>)
  16. while循环中出现ssh导致读取文件错误
  17. Java基础——网络编程(一)
  18. 【dfs】BZOJ1703-[Usaco2007 Mar]Ranking the Cows 奶牛排名
  19. 查询sql执行速度
  20. SQL SERVER技术内幕之8 分组集

热门文章

  1. .NET CORE(C#) WPF简单菜单MVVM绑定
  2. 静态SRAM芯片工作原理
  3. k8s CNI插件简单了解
  4. Learning hard 网络编程
  5. Qt编写的项目作品3-输入法V2018
  6. java数据结构---循环队列
  7. Orleans[NET Core 3.1] 学习笔记(四)( 2 )获取Grain的方式
  8. #6029. 「雅礼集训 2017 Day1」市场 [线段树]
  9. vue及vant框架,多语言配置
  10. Python爬虫连载9-JS加密之“盐”​、ajax请求