centos 7 源码安装openresty
2024-09-06 10:22:48
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
最新文章
- Android之SAX解析XML
- android webview远程调试
- Python“Non-ASCII character 'xe5' in file”报错问题(转)
- 异常和IO
- 通过JSTL用表格的形式显示
- Ubuntu频率较高的操作
- Asp.Net Mvc: 浅析TempData机制(转发 作者: Tristan G )
- 使用Material Design 创建App翻译系列----材料主题的使用(Using Material Theme)
- Win7如何取消用户登陆界面
- RPO(Relative Path Overwrite)
- machinekey生成工具 v1.0 官方最新版
- mysql主从复制延迟问题的相关知识与解决方案
- HDOJ2017_字符串统计
- php中的session过期思考一二
- 第五个神奇的电梯(代码抢先看<;1>;)
- while循环中出现ssh导致读取文件错误
- Java基础——网络编程(一)
- 【dfs】BZOJ1703-[Usaco2007 Mar]Ranking the Cows 奶牛排名
- 查询sql执行速度
- SQL SERVER技术内幕之8 分组集
热门文章
- .NET CORE(C#) WPF简单菜单MVVM绑定
- 静态SRAM芯片工作原理
- k8s CNI插件简单了解
- Learning hard 网络编程
- Qt编写的项目作品3-输入法V2018
- java数据结构---循环队列
- Orleans[NET Core 3.1] 学习笔记(四)( 2 )获取Grain的方式
- #6029. 「雅礼集训 2017 Day1」市场 [线段树]
- vue及vant框架,多语言配置
- Python爬虫连载9-JS加密之“盐”​、ajax请求