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. 笔记-Android学习历程

    1. Junit 配置:在manifest节点下 写入instrumentation,在其兄弟节点下配置application <instrumentation android:name=&qu ...

  2. Unity3D delegate 用法

    delegate:委托机制,不做一一说明: 功能需求1: 音量,为一事件为B: 改变音量如为0,为事件A.也触发事件B: 音量变,所有音乐,如场景,特效,角色,打斗.其所有音量都得变.为C: 思路: ...

  3. 【spring boot logback】spring boot中logback日志乱码问题

    在初次使用logback的自定义配置文件完整的控制spring boot日志后,发现了一个无法忍受的问题,就是日志乱码. 控制台看到打印日志乱码如下: 而日志文件打开: 记事本打开 sublime打开 ...

  4. ios 制作自已的framework

    本文转载至 http://blog.csdn.net/chen505358119/article/details/9190731   ios中我们写的代码有时不愿意让别人看到,可能对它进行封装,生成一 ...

  5. hihocoder 1279(状压)

    坑爹的题目.不过不能说不是一道挺好的题目. 坑主要坑在,妹的我一样的复杂度,写的姿势略差了点然后就一直超时. 比赛的时候我还直接就看错题目,把AND运算看成了OR...还敲完交了一发. 这题很容易想到 ...

  6. hdu1174(3维射线与圆是否相交)

    简单的题意,要注意z2 = h2*0.9-r2 #include <iostream> #include <cmath> #include <vector> #in ...

  7. Introduction to Mathematical Thinking - Week 3

    there exists and all there exists 证明根号2是无理数 all 习题 3. Which of the following formal propositions say ...

  8. JavaScript数据结构与算法-散列练习

    散列的实现 // 散列类 - 线性探测法 function HashTable () { this.table = new Array(137); this.values = []; this.sim ...

  9. 报表生成之Hyperion SQR

    SQR(Structured Query Reporter)是为从数据库管理系统生成报告而设计的一种编程语言.名称是结构化查询报告的缩写,这表明它与SQL(结构化查询语言)的关系.任何SQL语句可以嵌 ...

  10. Vue中浏览器的的前进和后退

    项目开发的时候,有时候可能需要我们来对页面后退和前进,这个东西跟浏览器自带的前进后退功能很像,下面来大致讲一下在vue中浏览器的前进和后退 一.后退功能 vue中的后退有好多种方法可以使用,使用这些方 ...