1. 从官网下载nginx.tar.gz源码包
  2. 拷贝至Linux系统下进行解压 tar -zxvf nginx.tar.gz
  3. 进入解压后的目录,需要./configure,此步骤会报多个错,比如没有安装gcc时,要求安装gcc等
  • ./confiure

在./configure时,可能会报错,如下:./configure: error: the HTTP rewrite module requires the PCRE library.You can either disable the module by using --without-http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcre=<path> option.

  • 解决办法是安装pcre-devel这个包,yum -y install pcre-devel   为了重写rewrite
  • 安装了上面这个包后,还会报错,提示./configure: error: the HTTP gzip module requires the zlib library. You can either disable the module by using --without-http_gzip_module option, or install the zlib library into the system, or build the zlib library statically from the source with nginx
  • 此时需要安装zlib-devel包,yum -y install  zlib-devel   为了gzip压缩

  4.make

  5.make install 或者4和5结合在一块,make && make install

  6.通过编译安装的程序都会保存在/usr/local目录下,如下:

  • [root@localhost nginx-1.14.0]# ls /usr/local/nginx/
    conf html logs sbin
    [root@localhost nginx-1.14.0]#

  7.运行命令 ./sbin/nginx就会启动nginx,通过ps -ef | grep nginx 或者通过netstat -anpl | grep 80可以查看进程或者端口状态

  • 访问 firefox localhost:80 ,如果出现如下界面,就表示nginx启动成功:

1.linux源码安装nginx的更多相关文章

  1. linux源码安装nginx

    任务目标:源码安装nginx,作为web服务修改配置文件,让配置生效,验证配置 首先要去官网nginx.org下载一个tar包: tar xvf 解包 进入到解包出来的目录,对configure进行配 ...

  2. linux 源码安装 Nginx

    1.安装前环境准备安装make:# yum -y install gcc automake autoconf libtool make安装g++:# yum install gcc gcc-c++ 2 ...

  3. Linux 源码安装nginx

    编译参数详解:https://www.cnblogs.com/houyongchong/p/compileArgs.html 配置参数详解:https://www.cnblogs.com/houyon ...

  4. Linux之源码安装nginx,并按照作业一描述的那样去测试使用

    作业五:源码安装nginx,并按照作业一描述的那样去测试使用 [root@localhost nginx]# yum install gcc-* glibc-* openssl openssl-dev ...

  5. 源码安装nginx以及平滑升级

                                                           源码安装nginx以及平滑升级                               ...

  6. Linux源码安装JDK1.8

    Linux源码安装Java 1.到官网下载 jdk-8u131-linux-x64.tar.gz 官网地址:http://www.oracle.com/technetwork/java/javase/ ...

  7. 源码安装Nginx以及用systemctl管理

    一.源码安装Nginx: 先安装gcc编译器(安装过的可以忽略) [root@localhost ~]# yum -y install gcc gcc-c++ wget 进入src目录 [root@l ...

  8. mysql-5.5 for linux源码安装

    mysql-5.5 for linux源码安装 1.使用Yum安装依赖软件包 # yum install -y gcc gcc-c++ gcc-g77 autoconf automake bison  ...

  9. 工作笔记-- 源码安装nginx

    源码安装nginx 1.安装nginx的依赖包 [root@localhost ~]# yum -y install gcc gcc-c++ openssl openssl-devel pcre pc ...

随机推荐

  1. python3----智能检测编码的工具

    f = open('C:/Users/Administrator/Desktop/100.txt', 'rb') data = f.read() # print(data) f.close() imp ...

  2. LeetCode具体分析 :: Recover Binary Search Tree [Tree]

    Recover the tree without changing its structure. Note: A solution using O(n) space is pretty straigh ...

  3. osx中使用defaults

    有时候须要改动osx系统的一些默认设置,这时候会用到defaults命令,查看一下defaults的man文档,对defaults的解释例如以下: defaults - access the Mac ...

  4. ViewPager页面切换特效

    ViewPager页面切换特效如下效果 看效果: 效果1: 效果2: 下面就开始讲解如何实现这两个页面翻转效果 1.首先你得会ViewPager控件的使用(废话!现在还有人不会使用吗???!!) 2. ...

  5. 《从零开始学Swift》学习笔记(Day 26)——可选链

    原创文章,欢迎转载.转载请注明:关东升的博客 在Swift程序表达式中会看到问号(?)和感叹号(!),它们代表什么含义呢?这些符号都与可选类型和可选链相关,下面来看看可选链. 可选链: 类图: 它们之 ...

  6. p:nth-last-child(2)

    <!DOCTYPE html><html><head><style> p:nth-last-child(2){background:#ff0000;}& ...

  7. XShell安装(五)

    Xshell就是一个远程控制Centos的软件:(用XShell比较方便,试用的都知道,界面也人性化) 详细介绍请看 百度百科 我随便百度下载了一个中文版的 给下地址  http://rj.baidu ...

  8. Spring学习笔记3—声明式事务

    1 理解事务 事务:在软件开发领域,全有或全无的操作被称为事务.事务允许我们将几个操作组合成一个要么全部发生要么全部不发生的工作单元. 事务的特性: 原子性:事务是由一个或多个活动所组成的一个工作单元 ...

  9. 小计---pandas读取带有中文文件名或者包含中文内容的文件

    python2下: # -*- coding: utf-8 -*- import pandas as pd mydata = pd.read_csv(u"例子.csv") #前面加 ...

  10. Python函数之—— 装饰器(Day13)

    一.什么是装饰器 顾名思义,装饰器指为其他函数添加新功能 装饰器定义:本质就是函数,功能是为其他函数添加新功能 二.装饰器需要遵循的原则 1.不修改被装饰函数的源代码(开放封闭原则) 2.为被装饰函数 ...