编译安装nginx并添加echo-nginx-module模块
2015-10-25 20:26
471 查看
准备
下载
先下载nginx源码,和echo-nginx-module搜狐nginx镜像
echo模块
wget http://mirrors.sohu.com/nginx/nginx-1.9.5.tar.gz[/code]wget https://github.com/openresty/echo-nginx-module/archive/v0.58.tar.gz[/code]解压
tar -zxvf nginx-1.9.5.tar.gztar -zxvf v0.58.tar.gz安装
进入nginx解压后的文件夹./configure --prefix=/usr/local/nginx1.9 --add-module=/usr/hezhichao/echo-nginx-module-0.58
–prefix为nginx安装位置,–add-module为需要添加的模块路径,这里添加你的echo-nginx-module路径
运行后发现
nginx rewrite模块需要PCRE库,通过yum 安装PCRE库yum install pcre*
重新运行./configure 巴拉巴拉巴拉,发现
通过yum 安装opensslyum install openssl*
重新运行./configure 巴拉巴拉巴拉,发现这次没有错误了,然后执行make
顺利,最后执行make install测试
进入nginx安装目录(configure 步骤–prefix后的路径)cd /usr/local/nginx1.9/
修改nginx配置文件vim conf/nginx.conf
修改server节点下的location / 节点配置如下
default_type 默认输出类型
保存后启动nginx应用sbin/nginx
根据我们的配置文件,打开localhost(确保localhost已经指向本地,否则修改/etc/hosts文件),即可看到
同理可以添加其他非官方的nginx 模块,that’s all.
相关文章推荐
- 从源码安装Mysql/Percona 5.5
- nginx代理指定目录
- 访问Nginx发生SSL connection error的一种情况
- Nginx+Naxsi部署专业级Web应用防火墙
- CentOS 6.2实战部署Nginx+MySQL+PHP
- 在 AppImage、Flathub 和 Snapcraft 平台上搜索 Linux 应用
- nginx中http核心模块的配置指令2
- nginx中http核心模块的配置指令3
- nginx中http核心模块的配置指令4
- nginx中http的fastcgi模块的配置指令1
- 解决vc中unable to connect to the MKS:Internal error问题
- Nginx 学习笔记(一)
- 网站502与504错误分析
- 杰奇一些安装详细说明文件,比官方更细
- 无线网卡安装DIY
- 网卡安装常见问题精解
- DB2数据库的安装
- CentOS下DB2数据库安装过程详解