centos6 源码编译安装nginx 1.6 教程 nginx安装脚本
- 操作系统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安装脚本的更多相关文章
- centos6源码编译安装lnmp环境
操作系统 版本 64位 CentOS-6.6 10.0.0.20 安装环境所需依赖包 yum -y install gcc automake autoconf libtool make gcc- ...
- 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 ...
- Nginx-入门(源码编译安装http://nginx.org/en/download.html)
比较早的时候 web主要经典组合--->LAMP 近几年---->nginx后来居上--->LNMP=LEMP Nginx = Engine x Nginx和Apache 都是 ...
- LAMP源码编译安装
php加速器 XCache 快速而且稳定的PHP opcode缓存,经过严格测试且被大量用于生产环境. 项目地址:http://xcache.lighttpd.net/,收录EPEL源 实现XCach ...
- 源码编译搭建LNMP环境
LNMP源码编译 1.LNMP介绍 LNMP=Linux Nginx Mysql PHP Nginx ("engine x") 是一个高性能的 HTTP 和 反向代理 服务器.Ng ...
- Linux系统 - 源码编译安装Nginx
什么是Nginx? Nginx ("engine x") 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器,在高连接并发的情况下N ...
- 源码编译安装nginx及设置开机启动项
1.上传nginx文档:解压到/data目录下,并安装依赖包tar xf nginx-1.20.1.tar.gz -C /data/cd /data/nginx-1.20.1/ && ...
- centos6.5环境源码编译安装mysql5.6.34
centos6.5环境源码编译安装mysql5.6.34 源码下载地址http://dev.mysql.com/downloads/mysql/5.6.html#downloads 选择Generic ...
- mysql5.7.10 源码编译安装记录 (centos6.4)【转】
一.准备工作 1.1 卸载系统自带mysql 查看系统是否自带MySQL, 如果有就卸载了, 卸载方式有两种yum, rpm, 这里通过yum卸载 rpm -qa | grep mysql //查看系 ...
随机推荐
- bugku_web_变量1(CTF)
这道题考察php全局变量GLOBALS的用法,同样是个php审计题. 看一下代码: flag In the variable ! <?php error_reporting(0); includ ...
- Spring学习笔记-Spring之旅-01
使用Spring简化JAVA开发 Spring的四种关键策略: ●基于POJO的轻量级和最小侵入式编程: ●通过依赖注入(DI)和面向接口实现松耦合: ●基于切面(AOP)和惯例进行声明式编程. ●通 ...
- 获取redis指定实例中所有的key
需求:获取redis指定的实例中所有的key的名字. 千万不要使用keys *,可以使用scan命令的递归方式获取. 以下给出自己写的脚本,经过测试效果还可以. db_ip=5.5.5.101 db_ ...
- git 命令 总结
1.添加所有文件 git add . 2.添加某个文件 git add filename 3.commit 注释 git commit -m'commit 注释' 4.修改commit 注释 git ...
- Web Workers - (Worker(专有) and SharedWorker(共享))
Web Worker为Web内容在后台线程中运行脚本提供了一种简单的方法 线程可以执行任务而不干扰用户界面 可以使用XMLHttpRequest执行 I/O (尽管responseXML和channe ...
- Latex字体属性
Latex字体有五种属性:编码.族.系列.尺寸.形状:其中,一般用户不会涉及字体的编码属性.用户可以自定义字体属性,定义属性的命令称为声明,声明无参数,直接在文档中使用.1. 族(family)属性: ...
- 微信小程序 获取用户昵称、头像
前段时间微信小程序对获取用户昵称和头像方法进行了更新,网上很多的文章都已经不适用了,这里简单总结一下,首先,传统接口wx.getUserInfo的效果会弹出一个给用户的弹窗,需要用户授权,经过测试传统 ...
- 牛客CSP-S提高组赛前集训营4 赛后总结
复读数组 分成 3 种区间算答案: 一个块内的区间 两个块交界处,长度小于块长的区间 长度不小于块长的区间 对于第三种区间,容易发现每个区间的权值一样,只需要算出个数即可. 对于前两种空间,我的思路是 ...
- Ubuntu中chrome浏览器安装、卸载
一.卸载 sudo apt-get autoremove google-chrome-stable 删除下载源:sudo rm /etc/apt/sources.list.d/google-chrom ...
- 二、vim的保存文件和退出命令
vim的保存文件和退出命令 命令 简单说明 :w 保存编辑后的文件内容,但不退出vim编辑器.这个命令的作用是把内存缓冲区中的数据写到启动vim时指定的文件中. :w! 强制写文件,即强制覆盖原有 ...