Nginx1.10.2安装配置
以下操作均在当前用户目录操作(root的目录,截止2016.11.2最新版本)
1、安装常用工具及基础包:
yum -y install wget git vim make gcc gcc-c++ openssl-devel
mkdir -p /nginx/module
2、安装pcre模块:
wget -P/src/ http://nchc.dl.sourceforge.net/project/pcre/pcre/8.39/pcre-8.39.tar.gz
tar -xzvf /src/pcre-8.39.tar.gz -C /nginx/module/
3、安装OpenSSL模块:
wget -P /src/ https://www.openssl.org/source/openssl-1.0.2j.tar.gz
tar -xzvf /src/openssl-1.0.2j.tar.gz -C /nginx/module/
4、安装zlib模块:
wget -P /src/ http://zlib.net/zlib-1.2.8.tar.gz
tar -xzvf /src/zlib-1.2.8.tar.gz -C /nginx/module/
5、安装LuaJIT模块:
wget -P /src/ http://luajit.org/download/LuaJIT-2.0.4.tar.gz
tar -xzvf /src/LuaJIT-2.0.4.tar.gz -C /src/
cd /src/LuaJIT-2.0.4
make
make install
6、安装lua-nginx-module模块:
wget -P /src/ https://github.com/openresty/lua-nginx-module/archive/v0.10.6.tar.gz
tar -xzvf /src/v0.10.6.tar.gz -C /nginx/module/
7、安装nginx sticky模块:
wget -P /src/ https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/1.2.6.zip
mv 1.2.6.zip nginx-sticky-module-1.2.6.zip
unzip -x nginx-sticky-module-1.2.6.zip
mv nginx-sticky-module-1.2.6 /nginx/module/nginx-sticky-module-1.2.6
8、安装echo-nginx模块:
wget -P /src/ https://github.com/openresty/echo-nginx-module/archive/v0.60.tar.gz
mv /src/v0.60.tar.gz /src/echo-nginx-module-0.60.tar.gz
tar -xzvf /src/echo-nginx-module-0.60.tar.gz -C /nginx/module/
9、安装ngx_cache_purge模块:
wget -P /src/ https://github.com/FRiCKLE/ngx_cache_purge/archive/2.3.tar.gz
mv /src/2.3.tar.gz /src/ngx_cache_purge-2.3.tar.gz
tar -xzvf /src/ngx_cache_purge-2.3.tar.gz -C /nginx/module/
10、安装ngx_http_lower_upper_case:
wget -P /src/ https://github.com/replay/ngx_http_lower_upper_case/archive/master.zip
mv /src/master.zip /src/ngx_http_lower_upper_case-master.zip
unzip -x ngx_http_lower_upper_case-master.zip
mv ngx_http_lower_upper_case-master /nginx/module/ngx_http_lower_upper_case
11、安装、配置Nginx:
wget -P /src/ http://nginx.org/download/nginx-1.10.2.tar.gz
tar -xzvf /src/nginx-1.10.2.tar.gz -C /src/
cd /src/nginx-1.10.2
[root@iZ94z6kec72Z nginx-1.10.2]#./configure --prefix=/nginx \
--with-http_v2_module \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--with-pcre=/nginx/module/pcre-8.39 \
--with-zlib=/nginx/module/zlib-1.2.8 \
--with-openssl=/nginx/module/openssl-1.0.2j \
--add-module=/nginx/module/lua-nginx-module-0.10.6 \
--add-module=/nginx/module/nginx-sticky-module-1.2.6 \
--add-module=/nginx/module/echo-nginx-module-0.60 \
--add-module=/nginx/module/ngx_cache_purge-2.3 \
--add-module=/nginx/module/ngx_http_lower_upper_case
[root@iZ94z6kec72Z nginx-1.10.2]# make
[root@iZ94z6kec72Z nginx-1.10.2]# make install
=========================================================================
ssl_dhparam /nginx/ssl/dhparam.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
/nginx/sbin/nginx -c /nginx/conf/nginx.conf
[root@iZ94z6kec72Z sbin]# /nginx/sbin/nginx -c /nginx/conf/nginx.conf
/nginx/sbin/nginx: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory
# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
# echo "/usr/local/lib" >> /etc/ld.so.conf
# ldconfig
[root@iZ94z6kec72Z sbin]# /nginx/sbin/nginx -c /nginx/conf/nginx.conf
1、关闭firewall:
[root@node-01 ~]# systemctl stop firewalld.service
#停止firewall
[root@node-01 ~]# systemctl disable firewalld.service 或 systemctl mask firewalld.service
#禁止firewall开机启动
2、安装iptables防火墙
[root@node-01 ~]# yum install iptables-services -y
[root@node-01 ~]# systemctl enable iptables
开放80的Web访问规则
[root@node-01 ~]# vi /etc/sysconfig/iptables
添加一条配置规则,如要想开放8080的端口,如下所示:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 –j ACCEPT
重启iptables
[root@node-01 ~]# systemctl restart iptables.service
Nginx1.10.2安装配置的更多相关文章
- centos nginx-1.10.3 安装
wget http://nginx.org/download/nginx-1.13.1.tar.gz nginx 依赖 pcre 库,要先安装pcre,因为nginx 要在rewrite 要解析正则表 ...
- lnmp之nginx1.10.2安装
linux下nginx的安装 为了后面避免缺失,还是什么都安装一下(后面安装php和mysql就不需要重复再执行下面这个了,当然你再执行一遍也没问题) [root@localhost src]# yu ...
- Windows 10下安装配置Caffe并支持GPU加速(修改版)
基本环境 建议严格按照版本来 - Windows 10 - Visual Studio 2013 - Matlab R2016b - Anaconda - CUDA 8.0.44 - cuDNN v4 ...
- linux Nginx-1.10.2 安装部署教程
一.下载Nginx以及依赖组件[root@localhost src]# wget http://nginx.org/download/nginx-1.10.2.tar.gz [root@localh ...
- Windows和Linux下apache-artemis-2.10.0安装配置
window下安装配置 一.官网下载 http://activemq.apache.org/artemis/download.html 二.百度网盘下载 链接:https://pan.baidu.c ...
- Solr4.10.3安装配置
系统环境 window版本为:windows 8.1 64位 软件环境 JDK版本:1.7 solr版本:4.10.3 tomcat版本:tomcat 7 安装过程 步骤一:将下载好的solr-4.1 ...
- MySQL 5.7.10 免安装配置
# 配置环境:windows 64bit # 安装版本:mysql-5.7.10-win32(zip archive版本) 1. ZIP Archive版是免安装的,只需把mysql-5.7.10-w ...
- Kafka0.10.0安装配置
1 解压文件 tar -zvxf kafka_2.11-0.10.0.0.tgz 2 修改配置server.properties vim server.properties broker.id=1 z ...
- mac osx 10.9安装配置macvim
如果你已经安装了macvim,升级后又不能用了,建议你可以看看http://kodira.de/2013/10/macvim-osx-10-9-mavericks/这篇文章,如果你还没有安装,下面由我 ...
随机推荐
- C++模拟实现Objective-C协议和代理模式
Objective-C的协议和代理是运用最多的特性之一,可以说在苹果系列开发中无处不在.事实上很多人都不知道其背后的原理.事实上简单点说,这就是设计模式中的代理模式的经典运用.代理模式简单点说就是为其 ...
- 《你不知道的javascript》上卷笔记整理(一)
函数声明和变量声明都会被提升,但函数声明会被提升到普通变量前,而 var foo = function bar(){}; 赋值操作不会被提升. 闭包: 基于词法作用域(作用域是根据名称查找变量的一套规 ...
- linux和window环境下安装ruby和sass
linux下安装ruby 下载linux的ruby安装包 http://www.ruby-lang.org/en/downloads/ 将ruby安装包在linux环境下解压 tar -x ...
- 2019/10/9 CSP-S 模拟测
T1:最大约数和 给定一个正整数 S,现在要求你选出若干个互不相同的正整数,使得它们的和不大于 S,而且每个数的因数(不包括本身)之和最大.S <= 1000 分析: 其实考完才听他们说是背包, ...
- HTML 颜色表示
三种表示方法 1 颜色单词 : blue green red pink 2 10进制表示: RGB(255, 10, 0) 3 16进制表示: #FF0000(红) #00FF00(绿)
- 2018CCPC吉林赛区 | 部分题解 (HDU6555 HDU6556 HDU6559 HDU6561)
// 杭电上的重现赛:http://acm.hdu.edu.cn/contests/contest_show.php?cid=867 // 杭电6555~6566可交题 A - The Fool 题目 ...
- StringBuffer清空
转载自:http://blog.sina.com.cn/s/blog_56fd58ab0100qfcz.html 在开发程序的时候,经常使用StringBuffer来进行字符串的拼接.如果在循环中来反 ...
- Python学习之while练习--九九乘法表
效果如下: 实现代码; m = 1n = 1while(m<10): while(n<=m): print(n,"*",m,"=",m*n,end ...
- 【核心核心】8.Spring【AOP】注解方式
1.引入jar包 sprig框架基础包+JUntil整合包+日志包+AOP包 spring的传统AOP的开发的包 spring-aop-4.2.4.RELEASE.jar com.springsour ...
- 廖雪峰Java9正则表达式-2正则表达式进阶-5非贪婪匹配
1.贪婪匹配 问题:给定一个字符串表示的数字,判断该数字末尾0的个数? "123000": 3个0 "10100": 2个0 "1001": ...