很少说,直接上干货!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)