(一)依赖包安装

首先,gcc,pcre,zlib,openssl安装一边(可以用非-devel,但是嫌麻烦....用非-devel的看这个链接

yum  -y install gcc

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

(再次执行./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.)-->只是为了研究过程,实际中不需要每次都./configure

yum install pcre-devel

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

再次执行./configure
./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=<path> option.
yum install zlib-devel

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

再次执行./configure

Configuration summary
  + using system PCRE library
  + OpenSSL library is not used
  + using builtin md5 code
  + sha1 library is not found
  + using system zlib library

OK,现在可以执行make 了。
如果你想使用openssl 功能,sha1 功能。
那么安装openssl ,sha1 吧,骚年。
安装openssl
yum install openssl openssl-devel
安装sha1
 

yum install perl-Digest-SHA1.x86_64

开启ssl 模块   执行./configure --with-http_ssl_module

启用“server+status"页,执行./configure --with-http_stub_status_module

两个都启动,不用我说了。执行./configure --with-http_stub_status_module --with-http_ssl_module

( -devel和非-devel的区别:

devel 包主要是供开发用,至少包括以下2个东西:
1. 头文件
2. 链接库
有的还含有开发文档或演示代码。

以 glib 和 glib-devel 为例:
如果你安装基于 glib 开发的程序,只需要安装 glib 包就行了。

但是如果你要编译使用了 glib 的源代码,则需要安装 glib-devel。)


(二)Nginx安装

常规的非-devel包用这种方法:

$ cd /usr/local/
$ wget http://nginx.org/download/nginx-1.8.0.tar.gz
$ tar -zxvf nginx-1.8.0.tar.gz
$ cd nginx-1.8.0
$ ./configure --prefix=/usr/local/nginx
$ make
$ make install

在--prefix后面接以下命令:

--with-pcre=/usr/local/pcre-8.36 指的是pcre-8.36 的源码路径。
--with-zlib=/usr/local/zlib-1.2.8 指的是zlib-1.2.8 的源码路径

不过,现在既然用了-devel包,就直接操作!很简单直接。

------------------------------

那么configre 就通过了。

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

执行make 命令

执行make install 命令

至此,nginx 执行成功了

---------------------------------------------------------------------

启动

$ /usr/local/nginx/sbin/nginx
用浏览器直接访问ipv4,显示Nginx默认页面,搞定!

Centos6.9安装部署nginx服务器的更多相关文章

  1. CentOS6.7安装部署Nginx(详解主配置文件)

    keepalived + nginx   :实现高可用 nginx: web服务器 反向代理,也支持缓存(缓存在磁盘上) 支持FastCGI tengine:淘宝官方在nginx原有的代码的基础上对n ...

  2. 高级运维(四):Nginx常见问题处理、安装部署Tomcat服务器、使用Tomcat部署虚拟主机

    一.Nginx常见问题处理 目标: 本案例要求对Nginx服务器进行适当优化,以提升服务器的处理性能: 1> 不显示Nginx软件版本号 2> 如果客户端访问服务器提示“Too many ...

  3. debian7下部署nginx服务器

    笔者是在vmware中的Debian7下部署nginx服务器,采用离线部署方式.过程如下: 1.准备好需要的离线安装包 nginx-1.6.2.tar.gz,pcre-8.34.tar.gz,open ...

  4. [转]Centos 7 安装部署 GitLab 服务器

    Centos 7 安装部署 GitLab 服务器 转自:https://www.jianshu.com/p/79bfded68899 文前说明 作为码农中的一员,需要不断的学习,我工作之余将一些分析总 ...

  5. centos6.4下配置nginx服务器更改根目录

    安装完nginx服务器后发现nginx的根目录在/usr/share/nginx/html/下,但是对于部署文件来说,在该目录下是不太习惯的,我就尝试着更改nginx访问的根目录 #  vi /etc ...

  6. 二十二. 安装部署Tomcat服务器、使用Tomcat部署虚拟主机、使用Varnish加速Web

    web proxy web1 web2   1.安装部署Tomcat服务器 web1 1.1 使用RPM安装JDK环境 ]# yum -y install java-1.8.0-openjdk ]# ...

  7. 安装部署Tomcat服务器

                      安装部署Tomcat服务器 案例1:安装部署Tomcat服务器 案例2:使用Tomcat部署虚拟主机 案例3:使用Varnish加速Web 1案例1:安装部署Tom ...

  8. centos6.4安装配置vpn服务器步骤详解

      centos6.4安装配置vpn服务器步骤详解,从安装VPN到配置VPN服务器.配置VPN服务器的路由转发功能,每一步都很详细   一.VPN服务器环境说明 操作系统:CentOS release ...

  9. centos7 下 安装部署nginx

    centos7 下 安装部署nginx 1.nginx安装依赖于三个包,注意安装顺序 a.SSL功能需要openssl库,直接通过yum安装: #yum install openssl b.gzip模 ...

随机推荐

  1. java多线程(四)-自定义线程池

    当我们使用 线程池的时候,可以使用 newCachedThreadPool()或者 newFixedThreadPool(int)等方法,其实我们深入到这些方法里面,就可以看到它们的是实现方式是这样的 ...

  2. grpc介绍

    grpc入门(一) 一.什么是grpc grpc是谷歌开源的一款高性能的rpc框架 (https://grpc.io),可以使用protocol buffers作为IDL(Interface Defi ...

  3. vue2.0笔记《二》组件

    主要内容:如何注册组件.如何使用组件.父组件子组件之间值的传递 1.如何注册组件 第一步:通过import将子组件载入父组件的js中 // 第一步:通过import将子组件载入父组件的js中 impo ...

  4. System.Windows.Forms.PropertyGrid的使用

    PropertyGrid 控件简介 .NET 框架 PropertyGrid 控件是 Visual Studio .NET 属性浏览器的核心.PropertyGrid 控件显示对象或类型的属性,并主要 ...

  5. python爬虫入门-开发环境与小例子

    python爬虫入门 开发环境 ubuntu 16.04 sublime pycharm requests库 requests库安装: sudo pip install requests 第一个例子 ...

  6. (译)JToken的层次结构

     原文地址:https://stackoverflow.com/questions/38558844/jcontainer-jobject-jtoken-and-linq-confusion/3856 ...

  7. WebGL多模型光照综合实例

      原文地址:WebGL多模型光照综合实例   WebGL是一个非常的接近硬件底层的光栅化API, 从非常类似C/C++风格的API调用方式就可以看出来, 习惯了高级语言的我们会觉得很不友好,觉得特别 ...

  8. HyperLedger Fabric基于zookeeper和kafka集群配置解析

    简述 在搭建HyperLedger Fabric环境的过程中,我们会用到一个configtx.yaml文件(可参考Hyperledger Fabric 1.0 从零开始(八)--Fabric多节点集群 ...

  9. 85、flask之wtforms

    本篇导航: wtforms组件的使用 自定义From组件 一.wtforms组件的使用 1.flask中的wtforms WTForms是一个支持多个web框架的form组件,主要用于对用户请求数据进 ...

  10. 发布到ASP.NET CORE项目到 Windows server 2012

    原文: https://github.com/zeusro/MarkdownBlog/blob/master/2018/2018-01-17-01.md 发布到ASP.NET CORE项目到 Wind ...