• 操作系统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. web服务器的解析漏洞罗列

    前言 服务器相关中间件存在一些解析漏洞,攻击者可通过上传一定格式的文件,被服务器的中间件进行了解析,这样就对系统造成一定危害.常见的服务器解析漏洞涉及的中间件有IIS,apache.nginx等.可利 ...

  2. 让bat文件自动以管理员身份运行

    · 让bat文件自动以管理员身份运行 如何让bat文件自动以管理员身份运行,将这段写在bat文件的前头即可 : %1 mshta vbscript:CreateObject("Shell.A ...

  3. PHPMailer发送邮件遇坑小记

    一:phpmailer发送邮件成功了 数据库发送状态也更改 但是用户就是没收到邮件. 出现原因:发送邮件太多 导致邮箱服务器被腾讯封了 发送的邮件统统进入了邮件服务器的草稿箱里. 解决方案: 重新修改 ...

  4. 题解 AT3718 【[ABC081B] Shift only】

    题目传送门 分析 直接暴力. 我们可以根据题意进行模拟,使用二重循环即可. 代码讲解 定义变量\(n\)和计数数组\(cnt\),再定义数组\(a\)并输入. int a[1000000]; int ...

  5. 题解 AT1812 【テレビ】

    题目大意 高桥君有一个宽\(w\),高\(h\)的电视机. 判定\(w:h\)是\(4:3\)还是\(16:9\). 分析 我们可以理解成把一个比\(w:h\)化为最简整数比,也就是将\(w:h\)化 ...

  6. react-发表评论案例

    评论列表组件 import React from 'react' import CMTItem from './CmtItem.jsx' import CMTBox from './CmtBox.js ...

  7. 使用xshell

    将选定的文本自动复制到剪贴板 并且 鼠标向右按钮定义为粘贴剪贴板内容

  8. UI中class的用法:

    easyui的引入:<link rel="stylesheet" type="text/css" href="easyui/themes/def ...

  9. Date工具类中CompareTo()

    A<B 结果是-1 A>B 结果是1 A==B 结果是0

  10. canvas转盘转动?

    怎么实现类似转盘转动的效果? 现在这种实现思路是,canvas每次draw()并不是让图形在旋转,而是让每一份的颜色改变到达好像是转动的效果, 但是现在有一个问题,一开始渲染的颜色数量于份数是相同的, ...