全網最詳細的Centos7系統裏安裝Openresty(圖文詳解)

 

 

    很少說,直接上乾貨!html

 

 

介紹:nginx

   Nginx 採用一個 master 進程管理多個 worker 進程(master-worker)模式,基本的事件處理都在 woker 中,master 負責一些全局初始化,以及對 worker 的管理。在OpenResty中,每一個 woker 使用一個 LuaVM,當請求被分配到 woker 時,將在這個 LuaVM 裏建立一個 coroutine(協程)。協程之間數據隔離,每一個協程具備獨立的全局變量_G。OpenResty致力於將服務器應用徹底運行與nginx中,充分利用nginx事件模型進行非阻塞I/O通訊。其對MySQL、redis、Memcached的I\O通訊操做也是非阻塞的,能夠輕鬆應對10K以上的超高鏈接併發。redis

 

 

 

 

 

 

 安裝centos

   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) 

 

 

 

 

 

 

 

 

 

 

 

 

相關文章
相關標籤/搜索