centos 6 下编译安装 nginx
下载nginx源码包,可以到nginx官方的下载文件归档里 http://nginx.org/download/ 下载
下载pcre源码,并编译安装,从pcre官方下载 ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.21.zip
解压缩 unzip pcre-8.21.zip
进入源码目录 cd pcre-8.21/
./configure
make
make install
全部使用默认,不必要指定目录,这样包容易被找到。
安装nginx
这里使用nginx 1.0.8为例。
下载源码包 wget http://nginx.org/download/nginx-1.0.8.tar.gz
解压缩 tar xvf nginx-1.0.8.tar.gz
进入源码目录 cd nginx-1.0.8/
查看配置参数 ./configure --help (此步可以省略)
简单配置 ./configure
(注:centos 6 默认安装pcre包的,但是其安装位置并不为nginx识别,而且即使手工指定好像也不行,编译过程中会提示找不到文件;所以才需要先安装pcre包)
不指定任何配置选项,应该可以成功通过,得到如下的消息
Configuration summary
+ using system PCRE library
+ OpenSSL library is not used
+ md5: using system crypto library
+ sha1: using system crypto library
+ using system zlib library nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
然后就是 make
应该不会出问题,接着make install 就安装好了。
先测试一下是否可以运行,执行 /usr/local/nginx/sbin/nginx 没有消息提示,通过浏览器打开nginx所在的ip地址,应该可以看到
Welcome to nginx!
安装nginx所需要的pcre-devel库,是为了是Nginx支持http Rewrite模块。
openssl-devel
yum -y install openssl openssl-devel
这样的一个简单页面,证明nginx可以工作。
接下来的工作就是配置nginx了,其配置文件为/usr/local/nginx/conf/nginx.conf
centos 6 下编译安装 nginx的更多相关文章
- 在CentOS 7下编译安装Nginx+PHP+MySQL环境
本文转载自:http://www.softeng.cn/?p=156,本文已获得作者授权,未经作者同意,不可转载. 1.前言 本文适合于已经对Linux操作系统具有基本操作经验,并且能够在Linux或 ...
- Centos 7下编译安装Nginx
一.下载源代码 百度云网盘下载地址:https://pan.baidu.com/s/19MQODvofRNnLV9hdAT-R6w 提取码:zi0u 二.安装依赖及插件 yum -y install ...
- linux下编译安装nginx
1.首先下载稳定版nginx1.10.2 使用wget命令下载 wget http://nginx.org/download/nginx-1.10.2.tar.gz 2.然后解压 tar -zxvf ...
- CentOS 7 下编译安装lnmp之nginx篇详解
一.安装环境 宿主机=> win7,虚拟机 centos => 系统版本:CentOS Linux release 7.5.1804 (Core),ip地址 192.168.1.168 ...
- CentOS 6.5 下编译安装 Nginx 1.8.0
转自:https://i.cnblogs.com/EditPosts.aspx?postid=8303227&update=1 安装编译依赖的包 yum -y install gcc gcc- ...
- centos 6.3 编译安装 nginx +mysql + php
这篇文章是对另一篇文章的整理,作为记录收藏 1,配置防火墙,开启80端口.3306端口 配置iptables,开启80端口.3306端口 vi /etc/sysconfig/iptables -A I ...
- centos源码编译安装nginx过程记录
前言:Centos系统编译安装LNMP环境是每来一台新服务器或换电脑都需要做的事情.这里仅做一个记录.给初学者一个参考! 一.安装前的环境 这里用的是centos 7系统. 我们默认把下载的软件放在 ...
- CentOS Linux下编译安装MySQL
本文参考张宴的Nginx 0.8.x + PHP 5.2.13(FastCGI)搭建胜过Apache十倍的Web服务器(第6版)[原创]完成.所有操作命令都在CentOS 6.4 64位操作系统下实践 ...
- Centos 6.5编译安装Nginx+php+Mysql
说明: 操作系统:CentOS 6.5 64位 准备篇: 一.配置好IP.DNS .网关,确保使用远程连接工具能够连接服务器 二.配置防火墙,开启80端口.3306端口 vi /etc/sysconf ...
随机推荐
- nginx初级安装配置
nginx初级安装配置 转自:(lykyl原创)http://www.cnblogs.com/lykyl/archive/2012/11/21/2781077.html 实验环境:系统 CENTOS5 ...
- 转 SQL 基础--> NEW_VALUE 的使用
--=============================== -- SQL 基础--> NEW_VALUE 的使用 --=============================== 通常 ...
- jQuery常用及基础知识总结(一)
Attribute: $(”p”).addClass(css中定义的样式类型); 给某个元素添加样式$(”img”).attr({src:”test.jpg”,alt:”test Image”}); ...
- Android利用canvas画各种图形 及Paint用法 .
引自:http://blog.csdn.net/carlfan/article/details/8139984 1.首先说一下canvas类: Class Overview The Canvas cl ...
- Java 六种异常处理的陋习(转)
Java 六种异常处理的陋习 原文链接: http://www.cnblogs.com/Android-and-android/archive/2013/05/02/3054469.html 你觉得 ...
- 块和内嵌总结,以及各个标签的应用。其中的ul ol dl特殊定义为auto,使得里面的内容展开
<!doctype html> <html> <head> <meta charset="UTF-8"/> <title> ...
- 一个门外汉的理解 ~ Faster R-CNN
首先放R-CNN的原理图 显然R-CNN的整过过程大致上划分为四步: 1.输入图片 2.生成候选窗口 3.对局部窗口进行特征提取(CNN) 4.分类(Classify regions) 而R-CNN的 ...
- smarty(原理概述)
转自:http://www.cnblogs.com/RightDear/archive/2012/11/06/2756218.html smarty(模板引擎,模板技术) 使用smarty主要是为了实 ...
- post(c),get(r),put(u),delete(d)
http://whui0110.iteye.com/blog/1682388看这个帖子知道人们常说的幂等意思就是可以重复执行,结果是一样的:帖子中说put(update)是幂等的,其实update v ...
- Windows系统字体与文件对照表
源:Windows系统字体与文件对照表 宋体 (TrueType) = SIMSUN.TTF 黑体 (TrueType) = simhei.ttf 楷体_GB2312 (TrueType) = sim ...