zoukankan      html  css  js  c++  java
  • 全网最详细的Centos7系统里安装Openresty(图文详解)

        不多说,直接上干货!

    介绍:

       Nginx 采用一个 master 进程管理多个 worker 进程(master-worker)模式,基本的事件处理都在 woker 中,master 负责一些全局初始化,以及对 worker 的管理。在OpenResty中,每个 woker 使用一个 LuaVM,当请求被分配到 woker 时,将在这个 LuaVM 里创建一个 coroutine(协程)。协程之间数据隔离,每个协程具有独立的全局变量_G。OpenResty致力于将服务器应用完全运行与nginx中,充分利用nginx事件模型进行非阻塞I/O通信。其对MySQL、redis、Memcached的IO通信操作也是非阻塞的,可以轻松应对10K以上的超高连接并发。

     安装

       1)、通过在CentOS 系统中添加 openresty 仓库,便于未来安装或更新我们的软件包(通过 yum update 命令)

     

    [root@ninbdcpp ~]# sudo yum install yum-utils

    [root@ninbdcpp ~]# sudo yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo

      2)、安装openresty

    [root@ninbdcpp ~]# sudo yum install openresty
    Is this ok [y/N]: y
    Is this ok [y/d/N]: y
    Is this ok [y/d/N]: y

      3)、安装命令行工具 resty

    [root@ninbdcpp ~]# sudo yum install openresty-resty
    Is this ok [y/d/N]: y

      命令行工具 opm 在 openresty-opm 包里,而 restydoc 工具在 openresty-doc 包里头。

       4)、查看openresty 仓库里头的软件包

    [root@ninbdcpp ~]# sudo yum --disablerepo="*" --enablerepo="openresty" list available
    Loaded plugins: fastestmirror, langpacks
    Loading mirror speeds from cached hostfile
    Available Packages
    openresty-asan.x86_64                                                                                        1.13.6.2-5.el7.centos                                                                      openresty
    openresty-asan-debuginfo.x86_64                                                                              1.13.6.2-5.el7.centos                                                                      openresty
    openresty-debug.x86_64                                                                                       1.13.6.2-1.el7.centos                                                                      openresty
    openresty-debug-debuginfo.x86_64                                                                             1.13.6.2-1.el7.centos                                                                      openresty
    openresty-debuginfo.x86_64                                                                                   1.13.6.2-1.el7.centos                                                                      openresty
    openresty-doc.noarch                                                                                         1.13.6.2-1.el7.centos                                                                      openresty
    openresty-openssl-asan.x86_64                                                                                1.1.0h-8.el7.centos                                                                        openresty
    openresty-openssl-asan-debuginfo.x86_64                                                                      1.1.0h-8.el7.centos                                                                        openresty
    openresty-openssl-asan-devel.x86_64                                                                          1.1.0h-8.el7.centos                                                                        openresty
    openresty-openssl-debug.x86_64                                                                               1.1.0h-3.el7.centos                                                                        openresty
    openresty-openssl-debug-debuginfo.x86_64                                                                     1.1.0h-3.el7.centos                                                                        openresty
    openresty-openssl-debug-devel.x86_64                                                                         1.1.0h-3.el7.centos                                                                        openresty
    openresty-openssl-debuginfo.x86_64                                                                           1.1.0h-3.el7.centos                                                                        openresty
    openresty-openssl-devel.x86_64                                                                               1.1.0h-3.el7.centos                                                                        openresty
    openresty-opm.noarch                                                                                         1.13.6.2-1.el7.centos                                                                      openresty
    openresty-pcre-asan.x86_64                                                                                   8.42-12.el7.centos                                                                         openresty
    openresty-pcre-asan-debuginfo.x86_64                                                                         8.42-12.el7.centos                                                                         openresty
    openresty-pcre-asan-devel.x86_64                                                                             8.42-12.el7.centos                                                                         openresty
    openresty-pcre-debuginfo.x86_64                                                                              8.42-1.el7.centos                                                                          openresty
    openresty-pcre-devel.x86_64                                                                                  8.42-1.el7.centos                                                                          openresty
    openresty-valgrind.x86_64                                                                                    1.13.6.2-1.el7.centos                                                                      openresty
    openresty-valgrind-debuginfo.x86_64                                                                          1.13.6.2-1.el7.centos                                                                      openresty
    openresty-zlib-asan.x86_64                                                                                   1.2.11-11.el7.centos                                                                       openresty
    openresty-zlib-asan-debuginfo.x86_64                                                                         1.2.11-11.el7.centos                                                                       openresty
    openresty-zlib-asan-devel.x86_64                                                                             1.2.11-11.el7.centos                                                                       openresty
    openresty-zlib-debuginfo.x86_64                                                                              1.2.11-3.el7.centos                                                                        openresty
    openresty-zlib-devel.x86_64                                                                                  1.2.11-3.el7.centos                                                                        openresty
    perl-Lemplate.noarch                                                                                         0.15-1.el7.centos                                                                          openresty
    perl-Spiffy.noarch                                                                                           0.46-3.el7.centos                                                                          openresty
    perl-Test-Base.noarch                                                                                        0.88-2.el7.centos                                                                          openresty
    perl-Test-LongString.noarch                                                                                  0.17-1.el7.centos                                                                          openresty
    perl-Test-Nginx.noarch                                                                                       0.26-1.el7.centos                                                                          openresty
    [root@ninbdcpp ~]# 

      至此安装成功,默认安装在  /usr/local/openresty

    [root@ninbdcpp ~]# cd /usr/local/openresty/
    [root@ninbdcpp openresty]# pwd
    /usr/local/openresty
    [root@ninbdcpp openresty]# ll
    total 24
    drwxr-xr-x. 2 root root    36 Jan 25 21:41 bin
    -rw-r--r--. 1 root root 22924 May 15  2018 COPYRIGHT
    drwxr-xr-x. 6 root root    56 Jan 25 21:40 luajit
    drwxr-xr-x. 5 root root    59 Jan 25 21:40 lualib
    drwxr-xr-x. 7 root root    68 Jan 25 21:40 nginx
    drwxr-xr-x. 4 root root    28 Jan 25 21:40 openssl
    drwxr-xr-x. 3 root root    17 Jan 25 21:40 pcre
    drwxr-xr-x. 3 root root    20 Jan 25 21:40 site
    drwxr-xr-x. 3 root root    17 Jan 25 21:40 zlib
    [root@ninbdcpp openresty]# 

    测试

      启动

    [root@ninbdcpp openresty]# sudo /sbin/service openresty start
    Starting openresty (via systemctl):                        [  OK  ]
    [root@ninbdcpp openresty]# 

     

     

    [root@ninbdcpp openresty]# sudo /sbin/service openresty stop
    Stopping openresty (via systemctl):                        [  OK  ]
    [root@ninbdcpp openresty]# 
    欢迎大家,加入我的微信公众号:大数据躺过的坑        人工智能躺过的坑
     
     
     

    同时,大家可以关注我的个人博客

       http://www.cnblogs.com/zlslch/   和     http://www.cnblogs.com/lchzls/      http://www.cnblogs.com/sunnyDream/   

       详情请见:http://www.cnblogs.com/zlslch/p/7473861.html

      人生苦短,我愿分享。本公众号将秉持活到老学到老学习无休止的交流分享开源精神,汇聚于互联网和个人学习工作的精华干货知识,一切来于互联网,反馈回互联网。
      目前研究领域:大数据、机器学习、深度学习、人工智能、数据挖掘、数据分析。 语言涉及:Java、Scala、Python、Shell、Linux等 。同时还涉及平常所使用的手机、电脑和互联网上的使用技巧、问题和实用软件。 只要你一直关注和呆在群里,每天必须有收获

          对应本平台的讨论和答疑QQ群:大数据和人工智能躺过的坑(总群)(161156071) 

     

  • 相关阅读:
    zookeeper集群搭建
    kafka集群安装与配置
    Spring Task 定时任务配置与使用
    6.Spark SQL 及其DataFrame的基本操作
    10 期末大作业
    09 spark连接mysql数据库
    08 学生课程分数的Spark SQL分析
    从RDD创建DataFrame 07
    RDD 编程5
    05 RDD练习:词频统计
  • 原文地址:https://www.cnblogs.com/zlslch/p/10318884.html
Copyright © 2011-2022 走看看