Linux Nginx安装以及可能出现错误

转载请标明出处 http://coderknock.com安装过程

从 http://nginx.org/download/nginx-1.9.15.tar.gz下载nginx包(或者wget http://nginx.org/download/nginx-1.9.15.tar.gz直接在Linux上用命令下载)

解压并转到目录下

tar -zxvf nginx-1.9.15.tar.gz

cd nginx-1.9.15

设置一下配置信息 ./configure --prefix=/usr/local/nginx ,或者不执行此步,直接默认配置

编译安装

make

make install

make的过程是把各种语言写的源码文件,变成可执行文件和各种库文件;

make install是把这些编译出来的可执行文件和库文件复制到合适的地方。

可能出现错误在配置信息./configure --prefix=/usr/local/nginx 的时,出现错误:

/configure: error: the HTTP rewrite module requires the PCRE library.

解决方法:安装pcre

yum -y install pcre pcre-devel

-y 是跳过所有需要手动确认的环节

缺少ssl错误,错误信息如下:

./configure: error: the HTTP cache module requires md5 functions

from OpenSSL library. You can either disable the module by using

--without-http-cache option, or install the OpenSSL library into the system,

or build the OpenSSL library statically from the source with nginx by using

--with-http_ssl_module --with-openssl= options.

解决方法:安装openssl

yum -y install openssl openssl-devel

缺少编译器,错误信息如下:

./configure: error: C compiler cc is not found

解决方法:安装gcc-c++

yum -y install gcc-c++ autoconf automake

autoconf是自动配置,automake是自动编译

缺少zlib包,错误信息如下:

./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 by using –with-zlib= option.

解决方法:安装zlib

yum install -y zlib-devel

确实libxml2,错误信息如下:

./configure: error: the HTTP XSLT module requires the libxml2/libxslt

libraries. You can either do not enable the module or install the libraries.

解决方法:

yum -y install libxml2 libxml2-dev

yum -y install libxslt-devel

http_image_filter_module是nginx提供的集成图片处理模块,需要gd-devel的支持,错误信息如下:

./configure: error: the HTTP image filter module requires the GD library.

You can either do not enable the module or install the libraries.

解决方法:

yum -y install gd-devel

缺少ExtUtils,错误信息如下:

./configure: error: perl module ExtUtils::Embed is required

解决方法:

yum -y install perl-devel perl-ExtUtils-Embed

缺少GeoIP,错误信息如下:

./configure: error: the GeoIP module requires the GeoIP library.

You can either do not enable the module or install the library.

解决方法:

yum -y install GeoIP GeoIP-devel GeoIP-data

安装完成后启动安装成功后 /usr/local/nginx 目录下如下

fastcgi.conf koi-win nginx.conf.default

fastcgi.conf.default logs scgi_params

fastcgi_params mime.types scgi_params.default

fastcgi_params.default mime.types.default uwsgi_params

html nginx uwsgi_params.default

koi-utf nginx.conf win-utf

启动

确保系统的 80 端口没被其他程序占用,运行/usr/local/nginx/nginx 命令来启动 Nginx,

netstat -ano|grep 80

如果查不到结果后执行,有结果则忽略此步骤(ubuntu下必须用sudo启动,不然只能在前台运行)

sudo /usr/local/nginx/nginx

打开浏览器访问此机器的 IP,如果浏览器出现 Welcome to nginx! 则表示 Nginx 已经安装并运行成功。

linux nginx 安装出错,Linux Nginx安装以及可能出现错误相关推荐

  1. linux qt3编译出错,Linux下编译Qt 5版本源码

    由于需要基于Centos下调用Qt的webkit来进行web相关的开发工作,所以需要对Qt进行源码编译,再编译出对应的webkit相关的库来. 在编译的过程中,遇到了一些坑,特此记录一下. Qt源码编 ...

  2. thingsboard从搭建环境到安装部署,给安装出错,或者安装失败的小伙伴现场写一遍(修正版)

    全过程实录,防止出现一些小伙伴出现的问题,我没遇到的问题 一.安装java环境 jdk现在地址:https://www.oracle.com/technetwork/java/javase/downl ...

  3. linux定义别名出错,Linux自定义别名alias重启失效问题

    Linux上的别名功能非常方便,例如ll可以显示文件列表的长信息,但是却不是以human能读懂的方式显示,所以我尝试直接在命令行中自定义一个别名: alisa lk='ls -lh' 然后lk就能正常 ...

  4. linux ant命令 出错,linux ant 解决 错误: 找不到或无法加载主类 org.apache.tools.ant.launch.Launcher...

    在使用ant进行java程序编译的时候出错.错误提示: Error: Could not find or load main class org.apache.tools.ant.launch.Lau ...

  5. linux调用python出错,linux里面python调用系统命令问题

    想用linux里的awk处理一个文本,输入行号,打印出来.因为数据是逗号分隔的csv文件,我第一时间就想起了awk.但是在写python时,出错了. 以下是用shell写的程序可以运行: #!/bin ...

  6. linux 防火墙查看出错,linux防火墙状态查看的方法实例

    linux防火墙状态查看的方法 1.基本操作 # 查看防火墙状态 service iptables status # 停止防火墙 service iptables stop # 启动防火墙 servi ...

  7. python生成图文并茂的pdf--财务报表(一)--reportlab库简介解决安装出错问题

    鄙人在金融公司,领导给了个任务让我用python生产FOF财务报表.觉得帆软生成的不合意,倾向用python,UI给了个设计,让我先行研究开发. 网上的资料不是很多,但是了解到是用到reportlab ...

  8. linux 下 Nginx 0.8.40的安装

      Nginx作为一个后起之秀,他的迷人之处已经让很多人都投入了他的怀抱.配置简单,实现原理简单.做一个负载平衡的再好不过了.  一.依赖的程序  1. gzip module requires zl ...

  9. linux中安装httpd安装错误,linux安装httpd和nginx常见问题及解决办法

    1 httpd-2.4.23.tar.gz安装 安装httpd之前,需要安装:gcc.apr.apr-util.pcre.zlib. 文件参考:D:\01soft\02测试\02悬镜管家\web服务\ ...

最新文章

  1. 基于mimeTex的数学公式Webservice的部署和实现
  2. VS2017离线包下载
  3. 长春理工大学第十四届程序设计竞赛(重现赛)F.Successione di Fixoracci
  4. Java 线程多线程编程1---基础
  5. 公司培训文档-JavaScript[对象.属性]集锦
  6. 《Python Cookbook 3rd》笔记(5.14):忽略文件名编码
  7. python scrapy框架 抓取的图片路径打不开图片_Python中Scrapy爬虫图片处理详解
  8. jquery $(document).ready() 与js原生的window.onload的区别总结
  9. 【java笔记】字符编码和字符集
  10. PHP团队 编码规范 代码样式风格规范
  11. 【C语言】递归详解汉诺塔问题
  12. 冒泡法排序c语言代码大全,C语言实现选择排序、冒泡排序和快速排序的代码示例...
  13. python异步编程 图书_Python异步编程介绍
  14. 基于STM32设计的WiFi语音播报日程表
  15. xenu死链接工具使用
  16. Android跳转小项目-CHANGE页面-Recycylerview、List、Context(二)
  17. Node的文件操作、文件系统、数据流
  18. vue开发之图片加载不出来问题解决
  19. 鹿晓亮:基于大数据云计算的语音识别深度平台
  20. dicom是指_DCM是什么文件

热门文章

  1. .NET APlayer播放器 demo
  2. Microsoft Dynamics CRM 数据库连接存储位置在哪里 是在注册表里
  3. 今天是 OSChina 上线 6 周年!
  4. ogre研究之第一个程序(一)
  5. ASP注入漏洞基础教程(二)
  6. java 内存分布_一图看懂JVM内存分布,永久记住!
  7. haarcascades---各种分类器xml文件下载地址
  8. 主板扩展槽图解_子板:扩展到主板
  9. oracle12537错误,ORA-12537:TNS:connection closed错误处理方法
  10. avr uart打印_AVR | 在16x2 LCD上打印HELLO WORLD