centos7 源码编译安装nginx教程 nginx安装脚本 lua-nginx-module
- 安装nginx需要pcre zlib openssl的库,下文都是在官网直接下载用作编译安装
- 该nginx安装教程,有安装maxmind IP 库
- 该nginx安装教程有安装lua-nginx-module, 但是建议如果要用lua-nginx-module的时候使用Tengine或者Openrestry
- 系统使用了centos 7
- 该教程有修改最大打开文件描述符数到最大
- 该教程是nginx安装的shell脚本
#!/bin/bash yum install epel-release -y
yum install gcc gcc-c++ make automake autoconf libtool iptables-services wget bind-utils unzip -y cd /usr/local/src
rm -rf * mv /etc/localtime /etc/localtime.bak
/bin/cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo 'ZONE="CST"' > /etc/sysconfig/clock setenforce
sed -i "s/=enforcing/=disabled/g" /etc/selinux/config systemctl disable firewalld
systemctl stop firewalld chkconfig iptables on
service iptables start
iptables -F
service iptables save wget https://github.com/openresty/luajit2/archive/v2.1-agentzh.zip
unzip v2.-agentzh.zip cd luajit2-2.1-agentzh
mkdir -p /usr/local/nginx/
make install PREFIX=/usr/local/nginx/luajit
echo "/usr/local/nginx/luajit/lib" > /etc/ld.so.conf.d/usr_local_luajit_lib.conf
ldconfig cd /usr/local/src/
wget https://github.com/maxmind/libmaxminddb/releases/download/1.3.2/libmaxminddb-1.3.2.tar.gz
tar zxf libmaxminddb-1.3.2.tar.gz
cd libmaxminddb-1.3.2
./configure
make && make install
[[ -z `cat /etc/ld.so.conf |grep "\/usr\/local\/lib"` ]] && echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig mkdir -p /usr/local/nginx/temp
mkdir -p /usr/local/nginx/geoip
cd /usr/local/nginx/geoip wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz
tar zxf GeoLite2-City.tar.gz
cd GeoLite2-City_*
mv GeoLite2-City.mmdb maxmind-city.mmdb
mv maxmind-city.mmdb /usr/local/nginx/geoip/ cd /usr/local/src/
wget http://nginx.org/download/nginx-1.16.1.tar.gz
tar zxf nginx-1.16.1.tar.gz wget -O openssl-master.zip https://github.com/openssl/openssl/archive/master.zip
unzip openssl-master.zip wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
tar xzf pcre-8.43.tar.gz wget http://zlib.net/zlib-1.2.11.tar.gz
tar -zxf zlib-1.2..tar.gz #wget -O lua-nginx-module-master.zip https://github.com/openresty/lua-nginx-module/archive/master.zip
wget http://download.zhufunin.com/lua-nginx-module.zip
unzip lua-nginx-module.zip
wget -O ngx_devel_kit-master.zip https://github.com/simplresty/ngx_devel_kit/archive/master.zip
unzip ngx_devel_kit-master.zip
wget -O ngx_http_geoip2_module-master.zip https://github.com/leev/ngx_http_geoip2_module/archive/master.zip
unzip ngx_http_geoip2_module-master.zip useradd -M -s /sbin/nologin www export LUAJIT_LIB=/usr/local/nginx/luajit/lib
export LUAJIT_INC=/usr/local/nginx/luajit/include/luajit-2.1 cd /usr/local/src/nginx-1.16.1
./configure \
--user=www \
--group=www \
--prefix=/usr/local/nginx \
--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-http_v2_module \
--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/temp/client_body_temp \
--http-proxy-temp-path=/usr/local/nginx/temp/proxy_temp \
--http-fastcgi-temp-path=/usr/local/nginx/temp/fastcgi_temp \
--http-scgi-temp-path=/usr/local/nginx/temp/scgi_temp \
--http-uwsgi-temp-path=/usr/local/nginx/temp/uwsgi_temp \
--with-openssl=/usr/local/src/openssl-master \
--with-zlib=/usr/local/src/zlib-1.2. \
--with-pcre=/usr/local/src/pcre-8.43 \
--with-ld-opt='-ljemalloc' \
--with-ld-opt='-Wl,-rpath,/usr/local/nginx/luajit/lib' \
--add-module=/usr/local/src/ngx_devel_kit-master \
--add-module=/usr/local/src/lua-nginx-module-master \
--add-module=/usr/local/src/ngx_http_geoip2_module-master make && make install 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
centos7 源码编译安装nginx教程 nginx安装脚本 lua-nginx-module的更多相关文章
- Centos7源码编译安装PHP7.2(生产环境)
安装PHP依赖包,否则在编译的过程中可能会出现各种报错 # Centos 安装epel-release源并将系统包更新到最新版本 $ yum install epel-release-y $ yum ...
- centos7源码编译安装lamp/lnmp
centos7源码编译安装lamp/lnmp 进程:是包工头(相当于是个门,只管开门关门,不管门内的事儿) 线程:是各种工种(cpu调度的是线程) 进程 是一件事情, 线程 是 同一个时间范围内 同时 ...
- CentOS7 源码编译安装Nginx
源码编译安装nginx 1.下载nginx源码包(这里以nginx-1.18.0为例) wget http://nginx.org/download/nginx-1.18.0.tar.gz 2 ...
- centos7 源码编译安装TensorFlow CPU 版本
一.前言 我们都知道,普通使用pip安装的TensorFlow是万金油版本,当你运行的时候,会提示你不是当前电脑中最优的版本,特别是CPU版本,没有使用指令集优化会让TensorFlow用起来更慢. ...
- centos7源码编译安装Subversion 1.9.5
svn是Subversion的简称,是一个开放源代码的版本控制系统.svn有两种运行方式:1.独立服务器(svn://xxx.xxx/xxx) 2.借助apache(http://svn.xxx.xx ...
- Centos7源码编译安装mysql8
前面介绍了很多关于mysql的文章,下面主要介绍一下mysql8的源码编译安装 一 基本环境 [root@CentOS-7-x86-64-Minimal-1810 ~]# cd /usr/local/ ...
- centos7 源码编译安装 nginx
安装步骤 下载 nginx 源码包 官网 $ wget http://nginx.org/download/nginx-1.16.0.tar.gz 解压 nginx 压缩包 $ tar -zxvf n ...
- centos7源码编译安装LNMP+ZABBIX4.0LTS(1)——nginx
环境:192.168.117.132--zabbix server192.168.117.133--zabbix proxy 安装路径为/zabbix 安装nginx 1.安装包下载http://ng ...
- centos7 源码编译nginx
使用configure命令配置编译.它定义了系统的各个方面,包括允许使用 nginx 进行连接处理的方法.最后它创建一个Makefile.该configure命令支持以下参数: --prefix=pa ...
随机推荐
- 关于文件中"wb"与"rb"的理解
“rb”,”wb”这两种方式在操作文件时,直接跳过了系统的编码方式,在windows系统中,用的编码为gbk: ①:with open(“a.txt”,”w”) as f1: F1.write(“aa ...
- Npoi常用操作方法介绍
1.ShiftRows(startRow,endRow,moveRows) 将开始行到结束行向上或者向下移动moveRows行,moveRows为正数向下移动,为负数向上移动(向上移动,会把之前的行覆 ...
- 在iOS下-input[disabled] 颜色变浅兼容&& input[readonly]仍可获取焦点解决方法
目标:在写input输入框时,想让其只读不写. 环境:在iPhone上 本来用的时readonly,可是readonly,居然可以获取焦点,不能弹出键盘:安卓手机完全木有问题,所以去用了disable ...
- Spring Batch 批处理原则与建议
Spring Batch 批处理原则与建议 当我们构建一个批处理的过程时,必须注意以下原则: 通常情况下,批处理的过程对系统和架构的设计要够要求比较高,因此尽可能的使用通用架构来处理批量数据处理,降低 ...
- virtual box虚拟机跨物理机迁移
VirtualBox保存虚机数据的是vdi文件,但是直接拷贝在新的VirtualBox中不能打开,因为每个vdi文件都包含了一个uuid的数据,如果直接拷贝,uuid在新的VirtualBox中是不能 ...
- 基于Dapper的开源Lambda扩展LnskyDB 3.0已支持Mysql数据库
LnskyDB LnskyDB是基于Dapper的Lambda扩展,支持按时间分库分表,也可以自定义分库分表方法.而且可以T4生成实体类免去手写实体类的烦恼.,现在已经支持MySql和Sql serv ...
- mysql 连接权限
命令解释: . 第一个表示库,第二个表示表; .对全部数据库的全部表授权,so.ok 表示只对so这个库中的ok表授权 root 表示要给哪个用户授权,这个用户可以是存在的用户,也可以是不存在的 '% ...
- AcWing 7. 混合背包问题
#include<iostream> #include<algorithm> #include<cstring> using namespace std ; ; i ...
- leetcode top-100-liked-questions刷题总结
一.起因 宅在家中,不知该做点什么.没有很好的想法,自己一直想提升技能,语言基础自不必言,数据结构还算熟悉,算法能力一般.于是乎,就去刷一通题. 刷题平台有很多,我选择了在leetcode进行刷题.回 ...
- BOM笔记
目录 BOM (浏览器对象模型) 简介 window对象 子对象 history 子对象 lacation 子对象 navigator 子对象 screen 子对象 frames BOM (浏览器对象 ...