码迷,mamicode.com
首页 > 其他好文 > 详细

CentOS配置OpenResty

时间:2017-03-17 00:39:03      阅读:544      评论:0      收藏:0      [点我收藏+]

标签:process   sse   proc   cat   centos   log   环境   openresty   open   

1、打开网址:https://openresty.org/en/download.html,看最新的版本号,比如说现在的版本号是1.11.2.1

2、wget https://openresty.org/download/openresty-1.11.2.1.tar.gz

3、tar zxvf openresty-1.11.2.1.tar.gz -C ~/openresty/

4、cd ~/openresty/

5、cd openresty-1.11.2.1

6、./configure --prefix=/opt/openresty --with-luajit --without-http_redis2_module --with-http_iconv_module

7、gmake

8、gmake install

9、设置环境变量:vim /etc/profile              把/opt/openresty/nginx/sbin加入PATH变量中

10、使用source /etc/profile来使配置生效,可以使用echo $PATH来查看是否确保生效。

11、mkdir -p ~/openresty-test ~/openesty-test/conf ~/openresty-test/logs

12、~/openesty-test/conf

13、vim nginx.conf

worker_processes 1;
error_log logs/error.log;
events{
        worker_connections 1024;
}

http{
        server{
                listen 6699;
                location / {
                        default_type text/html;
                        content_by_lua_block{
                                ngx.say("hello world !")
                        }
                }
        }
}

14、使用下面的命令来开启openresty:nginx -p ~/openresty-test

15、curl http://localhost:6699 -i

 

CentOS配置OpenResty

标签:process   sse   proc   cat   centos   log   环境   openresty   open   

原文地址:http://www.cnblogs.com/ha666/p/6562234.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!