下载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的更多相关文章

  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. logstash安装配置

    vim /usr/local/logstash/etc/hello_search.conf 输入下面: input { stdin { type => "human" }} ...

  2. MiniProfiler找不到jquery的

    我一直在使用MiniProfiler来衡量网站性能.当我从1.9版本升级到2.0,它停止工作.我改变了命名空间从MvcMiniProfiler StackExchange.Profiling的.但是, ...

  3. 设置HTML表格细边框

    简介:WEB前端|这是关于怎么设置HTML表格细边框的问题,把表格边框设置为细小的线条边框一般我们用表格的时候总会给它个border属性,比如:<tableborder="1" ...

  4. 深入浅出Ajax(四)

    function initPage() { btn.onmouseover = buttonOver; btn.onmouseover = buttonOut; } 如上,浏览器只会运行指定的最后一个 ...

  5. Android - Get Bluetooth UUID for this device

    Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join th ...

  6. 杀死进程kill和fuser

    1 kill -9 id 2   不行的话使用    fuser -k -SIGHUP /opt/bre/cookiemapping/wsapi/123 fuser有一个特别的用法在于它可以一次杀死那 ...

  7. PHP处理多表查询时的SQL语句拆分与重新组装

    在自己写框架时候会发现,多表查询组装SQL语句<?php $pre = "pre_"; $aid = "44"; $data = array(" ...

  8. 毕业论文评审意见、导师意见范文、模板_Smile~风_百度空间

    body{ font-family: "Microsoft YaHei UI","Microsoft YaHei",SimSun,"Segoe UI& ...

  9. Xcode8 去除系统日志输出

    Edit Scheme-> Run -> Arguments, 在Environment Variables里边添加 OS_ACTIVITY_MODE = disable

  10. SQL Server--导入和导出向导

    作用:创建一个只需要最少的转换就可以快速导入或导出数据的包 操作步骤: 1 打开打入和导出向导方式 有四种方式 1)在SSMS(SQL Server Management Studio)中,右击目标数 ...