1. 安装依赖的软件包

yum install readline-devel pcre-devel openssl-devel gcc

2. 安装openresty

-- 1. 下载openresty源码: http://openresty.org/cn/download.html
$ wget https://openresty.org/download/openresty-1.9.7.4.tar.gz -- 2. 解压tar包
$ tar xzvf openresty-1.9.7.4.tar.gz -- 3. 配置编译选项,可以根据你的实际情况增加、减少相应的模块
$ ./configure --prefix=/opt/openresty --with-luajit --without-http_redis2_module --with-http_iconv_module -- 4. 编译并安装
$ make
$ make install

3. HelloWorld

-- 1. 修改配置文件如下:
$ cat /opt/openresty/nginx/conf/nginx.conf
worker_processes 1;
error_log logs/error.log info; events {
worker_connections 1024;
} http {
server {
listen 8003; location / {
content_by_lua 'ngx.say("hello world.")';
}
}
} -- 2. 启动nginx
$ /opt/openresty/nginx/sbin/nginx -- 3. 检查nginx
$ curl http://127.0.0.1:8003/
hello world.

4. 性能测试

-- 1. 安装压力测试工具
$ yum install httpd-tools -- 2. 测试
$ ab -c10 -n50000 http://localhost:8003/
...
Concurrency Level: 10
Time taken for tests: 2.825 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Total transferred: 8050000 bytes
HTML transferred: 650000 bytes
Requests per second: 17697.26 [#/sec] (mean)
Time per request: 0.565 [ms] (mean)
Time per request: 0.057 [ms] (mean, across all concurrent requests)
Transfer rate: 2782.48 [Kbytes/sec] received
...

ref

http://openresty.org/cn/installation.html 
http://openresty.org/cn/getting-started.html 
http://openresty.org/cn/using-luarocks.html

openresty--centos7下开发环境安装的更多相关文章

  1. 基于GTK+3 开发远程控制管理软件(C语言实现)系列二 Centos7下开发环境搭建

    一.安装gcc gcc-c++ make等编译工具 yum install gcc gcc-c++ kernel-devel 这一步,其实可以不用做,你在安装Centos7的时候,如果选择开发模式安装 ...

  2. centos7下python2环境安装pip2、kazoo、bottle、beaker

    摘自:https://mp.weixin.qq.com/s?src=11&timestamp=1576355125&ver=2034&signature=mNp2na6VjFz ...

  3. linux系统下开发环境安装与配置

    安装系统环境 CentOS 6.8 64位 jdk版本 7u80 64位 Tomcat版本 Tomcat7 maven版本 Apache Maven 3.6.0 vsftpd版本 vsftpd-2.2 ...

  4. centos7 php开发环境安装-composer

    1.安装composer cd /usr/local/src curl -sS https://getcomposer.org/installer | php mv composer.phar /us ...

  5. 【转】android 最新 NDK r8 在window下开发环境搭建 安装配置与使用 详细图文讲解,完整实际配置过程记录(原创)

    原文网址:http://www.cnblogs.com/zdz8207/archive/2012/11/27/android-ndk-install.html android 最新 NDK r8 在w ...

  6. 搭建centos7的开发环境3-Spark安装配置

    说起大数据开发,必然就会提到Spark,在这片博文中,我们就介绍一下Spark的安装和配置. 这是Centos7开发环境系列的第三篇,本篇的安装会基于之前的配置进行,有需要的请回复搭建centos7的 ...

  7. android 最新 NDK r8 在window下开发环境搭建 安装配置与使用 详细图文讲解,完整实际配置过程记录(原创)

      android 最新 NDK r8 在window下开发环境搭建 安装配置与使用 详细图文讲解,完整实际配置过程记录(原创) 一直想搞NDK开发却一直给其他事情耽搁了,参考了些网上的资料今天终于把 ...

  8. Android NDK r8 Cygwin CDT 在window下开发环境搭建 安装配置与使用 具体图文解说

    版权声明:本博客全部文章均为原创.欢迎交流.欢迎转载:转载请勿篡改内容,而且注明出处,谢谢! https://blog.csdn.net/waldmer/article/details/3272500 ...

  9. legend3---Windows 7/8/10 系统下Laravel框架的开发环境安装及部署详解(Vagrant + Homestead)

    legend3---Windows 7/8/10 系统下Laravel框架的开发环境安装及部署详解(Vagrant + Homestead) 一.总结 一句话总结: 1.安装的话就是下载好git,va ...

随机推荐

  1. windows中使用mysql配置my.ini时的坑

    windows中安装mysql的一般步骤: mysql版本:5.7.16 1.解压 2.把解压的文件夹bin目录地址添加到环境变量PATH里面 3.在文件加中添加配置文件my.ini——配置内容后面说 ...

  2. POJ-3122(二分算法)

    //题意:这是一个分蛋糕的游戏, t个测试数据,输入n, f n代表的是n块蛋糕,蛋糕的高为1, f代表的是f个人朋友,然后输入每份蛋糕的半径 // 将n块蛋糕分成 f+1 份 每一份都是完成的一块蛋 ...

  3. 最短路径算法(I)

    弗洛伊德算法(Floyed-Warshall) 适用范围及时间复杂度 该算法的时间复杂度为O(N^3),适用于出现负边权的情况. 可以求取最短路径或判断路径是否连通.可用于求最小环,比较两点之间的大小 ...

  4. “Hello World!”团队第七周召开的第一次会议

    今天是我们团队“Hello World!”团队第七周召开的第一次会议.博客内容: 一.会议时间 二.会议地点 三.会议成员 四.会议内容 五.Todo List 六.会议照片 七.燃尽图 一.会议时间 ...

  5. 查看struts包源码

  6. 周总结<8>

    周次 学习时间 新编代码行数 博客量 学到知识点 15 15 100 1 Html页面设计:虚拟机:(C语言)排序 Html案例: <!DOCTYPE html PUBLIC "-// ...

  7. TCP系列44—拥塞控制—7、SACK关闭的快速恢复

    ) return;    delta = ssthresh - in_flight;     prr_delivered += newly_acked_sacked; if (delta < 0 ...

  8. 3dContactPointAnnotationTool开发日志(二五)

    记录一下当前进度:

  9. linux 下svn忽略文件

    假设想忽略文件temp 1. cd到temp所在的目录下: 2. svn propedit svn:ignore . 注意:请别漏掉最后的点(.表示当前目录),如果报错请看下面 3. 打开的文件就是忽 ...

  10. 使用JsonConfig中的setExcludes方法过滤不需要转换的属性

    Hibernate的many-to-one双向关联中,查询many方时会将one方数据顺带着查询,同时one中会有List<Many>,然后又会去查Many中的数据... 周而复始,结果j ...