• 操作系统centos 6.9
  • 安装nginx需要pcre zlib openssl的库,下文都是在官网直接下载用作编译安装
  • 该nginx安装教程,有安装maxmind IP 库
  • 该教材有修改最大打开文件描述符数到最大
  • 该教程是nginx安#!/bin/bas
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 chkconfig iptables on
service iptables start
iptables -F
service iptables save
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..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 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..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 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 cd /usr/local/src/nginx-1.16.
./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 \--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 65536" >> /etc/profile
echo "root soft nofile 65536" >> /etc/security/limits.conf
echo "root hard nofile 65536" >> /etc/security/limits.conf
echo "* soft nofile 65536" >> /etc/security/limits.conf
echo "* hard nofile 65536" >> /etc/security/limits.conf
source /etc/profile

nginx

启动/usr/local/nginx/sbin/nginx

reload: /usr/local/nginx/sbin/nginx -s reload

停止:  /usr/local/nginx/sbin/nginx -s quit

centos6 源码编译安装nginx 1.6 教程 nginx安装脚本的更多相关文章

  1. centos6源码编译安装lnmp环境

    操作系统 版本 64位 CentOS-6.6    10.0.0.20 安装环境所需依赖包 yum -y install gcc automake autoconf libtool make gcc- ...

  2. ubuntu 16.04源码编译和配置caffe详细教程 | Install and Configure Caffe on ubuntu 16.04

    本文首发于个人博客https://kezunlin.me/post/b90033a9/,欢迎阅读! Install and Configure Caffe on ubuntu 16.04 Series ...

  3. Nginx-入门(源码编译安装http://nginx.org/en/download.html)

    比较早的时候  web主要经典组合--->LAMP 近几年---->nginx后来居上--->LNMP=LEMP   Nginx = Engine x Nginx和Apache 都是 ...

  4. LAMP源码编译安装

    php加速器 XCache 快速而且稳定的PHP opcode缓存,经过严格测试且被大量用于生产环境. 项目地址:http://xcache.lighttpd.net/,收录EPEL源 实现XCach ...

  5. 源码编译搭建LNMP环境

    LNMP源码编译 1.LNMP介绍 LNMP=Linux Nginx Mysql PHP Nginx ("engine x") 是一个高性能的 HTTP 和 反向代理 服务器.Ng ...

  6. Linux系统 - 源码编译安装Nginx

    什么是Nginx? Nginx ("engine x") 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器,在高连接并发的情况下N ...

  7. 源码编译安装nginx及设置开机启动项

    1.上传nginx文档:解压到/data目录下,并安装依赖包tar xf nginx-1.20.1.tar.gz -C /data/cd /data/nginx-1.20.1/ && ...

  8. centos6.5环境源码编译安装mysql5.6.34

    centos6.5环境源码编译安装mysql5.6.34 源码下载地址http://dev.mysql.com/downloads/mysql/5.6.html#downloads 选择Generic ...

  9. mysql5.7.10 源码编译安装记录 (centos6.4)【转】

    一.准备工作 1.1 卸载系统自带mysql 查看系统是否自带MySQL, 如果有就卸载了, 卸载方式有两种yum, rpm, 这里通过yum卸载 rpm -qa | grep mysql //查看系 ...

随机推荐

  1. youhua

  2. 【Vue2.x笔记2】从源码看computed对象

    computed 初始化函数 const computedWatcherOptions = { lazy: true } function initComputed (vm: Component, c ...

  3. 设置display:inline-block 元素间隙

    上代码: <div class="page"> <a href="" class="num">共1231条</ ...

  4. 使用word时在方块中打钩

    ☑ 方法一: 第一步: 输入:2611 第二步: 选中2611 第三步: 按Alt + X Get :  ☑ 同样:用2610代替2611会得到☐ ☐2610 ☑2611 方法二 1.选择[插入]-- ...

  5. windows安装python64位和32位的方法

    1.先安装python 64位的 python,创建一个64位的python虚拟环境: 2.再安装python 32位的 python,创建一个32位的python虚拟环境即可. 注意:两个版本安装在 ...

  6. MySQL 中like的使用对于索引的影响

    今天看了一篇对于like使用对索引的影响的文章,发现自己实践的跟文章得出结论不大一样.所以还是建议自己再看别人文章的时候自己亲自动手实践一下.以免学到不全面的知识. 列子: 先建立一张表: -- 创建 ...

  7. vs code使用指南

    https://blog.csdn.net/weixin_45601379/article/details/100550421

  8. 二、vim的保存文件和退出命令

    vim的保存文件和退出命令   命令 简单说明 :w 保存编辑后的文件内容,但不退出vim编辑器.这个命令的作用是把内存缓冲区中的数据写到启动vim时指定的文件中. :w! 强制写文件,即强制覆盖原有 ...

  9. C#连接数据库时Appsettings 与connectionStrings的区别

    C#连接数据库时Appsettings 与connectionStrings的区别 转载lscyo 最后发布于2018-08-08 18:38:04 阅读数 3366  收藏 展开 一..Appset ...

  10. Codeforces Round #601 (Div. 2) D Feeding Chicken

    //为了连贯,采取一条路形式,从第一行开始 也就是s型 #include <bits/stdc++.h> using namespace std; ; char str[MAXN][MAX ...