下载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包)

不指定任何配置选项,应该可以成功通过,得到如下的消息

  1. Configuration summary
  2. + using system PCRE library
  3. + OpenSSL library is not used
  4. + md5: using system crypto library
  5. + sha1: using system crypto library
  6. + using system zlib library
  7.  
  8. nginx path prefix: "/usr/local/nginx"
  9. nginx binary file: "/usr/local/nginx/sbin/nginx"
  10. nginx configuration prefix: "/usr/local/nginx/conf"
  11. nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
  12. nginx pid file: "/usr/local/nginx/logs/nginx.pid"
  13. nginx error log file: "/usr/local/nginx/logs/error.log"
  14. nginx http access log file: "/usr/local/nginx/logs/access.log"
  15. nginx http client request body temporary files: "client_body_temp"
  16. nginx http proxy temporary files: "proxy_temp"
  17. nginx http fastcgi temporary files: "fastcgi_temp"
  18. nginx http uwsgi temporary files: "uwsgi_temp"
  19. 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的更多相关文章

  1. 在CentOS 7下编译安装Nginx+PHP+MySQL环境

    本文转载自:http://www.softeng.cn/?p=156,本文已获得作者授权,未经作者同意,不可转载. 1.前言 本文适合于已经对Linux操作系统具有基本操作经验,并且能够在Linux或 ...

  2. Centos 7下编译安装Nginx

    一.下载源代码 百度云网盘下载地址:https://pan.baidu.com/s/19MQODvofRNnLV9hdAT-R6w 提取码:zi0u 二.安装依赖及插件 yum -y install ...

  3. linux下编译安装nginx

    1.首先下载稳定版nginx1.10.2 使用wget命令下载 wget http://nginx.org/download/nginx-1.10.2.tar.gz 2.然后解压 tar -zxvf  ...

  4. CentOS 7 下编译安装lnmp之nginx篇详解

    一.安装环境 宿主机=> win7,虚拟机 centos => 系统版本:CentOS Linux release 7.5.1804 (Core),ip地址 192.168.1.168   ...

  5. CentOS 6.5 下编译安装 Nginx 1.8.0

    转自:https://i.cnblogs.com/EditPosts.aspx?postid=8303227&update=1 安装编译依赖的包 yum -y install gcc gcc- ...

  6. centos 6.3 编译安装 nginx +mysql + php

    这篇文章是对另一篇文章的整理,作为记录收藏 1,配置防火墙,开启80端口.3306端口 配置iptables,开启80端口.3306端口 vi /etc/sysconfig/iptables -A I ...

  7. centos源码编译安装nginx过程记录

    前言:Centos系统编译安装LNMP环境是每来一台新服务器或换电脑都需要做的事情.这里仅做一个记录.给初学者一个参考! 一.安装前的环境 这里用的是centos 7系统. 我们默认把下载的软件放在 ...

  8. CentOS Linux下编译安装MySQL

    本文参考张宴的Nginx 0.8.x + PHP 5.2.13(FastCGI)搭建胜过Apache十倍的Web服务器(第6版)[原创]完成.所有操作命令都在CentOS 6.4 64位操作系统下实践 ...

  9. Centos 6.5编译安装Nginx+php+Mysql

    说明: 操作系统:CentOS 6.5 64位 准备篇: 一.配置好IP.DNS .网关,确保使用远程连接工具能够连接服务器 二.配置防火墙,开启80端口.3306端口 vi /etc/sysconf ...

随机推荐

  1. cs的变态语法

    int? a = null; //?指示a为可空checked { ... } //赋值溢出抛异常unchecked { ... } //赋值溢出不抛异常expr1??expr2 //空结合运算符,e ...

  2. the.book.of.gimp.pdf文字不显示

    逆天了,不是中文也不显示. https://bugs.freedesktop.org/show_bug.cgi?id=70529 说要升级libfreetype,可是已经是wheezy最新了,其他不稳 ...

  3. oracle数据库兼容mysql的差异写法

    1.sysdate改为sysdate(),或者now(); 2.nvl(expr1,expr2) 改为IFNULL(expr1,expr2) nvl2(expr1,expr2,expr3)改为 IF( ...

  4. zencart的modules下数据库操作templates排版和common首页引用

    把这个学会,zencart的数据库操作,以及各种函数的调用基本会了 这个东西非常有用,你需要认真看一下,不要闲代码多. 如何在数据库中调出自己想要的产品,让它显示在首页. 据我本人不科学的理解,在in ...

  5. vs2005中分割线怎么插入

    用Label控件,将Label控件的AutoSize设为False,然后清除Text属性,再将BorderStyle属性设为Fixed3D,宽度设为2个像素,就可以成为分割线. 效果:

  6. css3的::selection属性

    大家都知道浏览器对选中的文本默认样式都是统一的,Windows下是一个深蓝色的背景,白字的前景,而在Mac下是一个淡蓝色背景,白色字体,就如上图所展示的一样,自从有了这个“::selection”选择 ...

  7. GPU

    GPU主要是进行计算机图形这种大运算量的图形处理器,包括顶点设置.光影.像素操作.对CPU发出的数据和指令,进行着色,材质填充,渲染. 在没有GPU的系统中,3D游戏中物体移动时的坐标转换与光源处理, ...

  8. MySQL 导出命令

    mysqldump --no-defaults -u root -p dbname > c:\www\test.sql windows 下使用.

  9. 实战3--项目开始--准备:::资源分类, 日志系统, 写BaseDao

     项目资源分类: 1.   package: base, dao, dao.impl, domain, service, service.impl, util, view.action 2.   co ...

  10. Unity3d之流光效果

    所谓流光效果,如一个图片上一条刀光从左闪到右边,以下为实现代码: c#代码: using System; using UnityEngine; public class WalkLightEffect ...