zoukankan      html  css  js  c++  java
  • 1.linux源码安装nginx

    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启动成功:
  • 相关阅读:
    继承中的构造函数的问题base,this的用法 Carl
    apache+php+mysql服务器环境配置注意点
    收藏音乐
    doubleClickv2as3.0 概述
    doubleClickv2as3.0 学习笔记(2)
    doubleclickv2as3.0模板
    as 2.0 笔记
    Html css 推荐文章
    [经济杂谈]如果你读懂了 股市就是取款机(要保存的) 管理帖子
    字符编码 UTF8 gb2312
  • 原文地址:https://www.cnblogs.com/mmdln/p/8947139.html
Copyright © 2011-2022 走看看