nginx源码编辑带第三方模块lua
2015-08-05 11:31
549 查看
系统环境:
下载ngx_devel_kit
nginxconfig中加入
location /hello {
default_type 'text/plain';
content_by_lua 'ngx.say("hello, lua")';
}
访问192.168.100.1/hello
会出现“hello,lua”
lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 12.04.5 LTS Release: 12.04 Codename: precise下载nginx_lua_module
下载ngx_devel_kit
安装 luajit apt-get install libluajit-5.1-dev luajit ls /opt/nginx_comp lua-nginx-module-0.9.16 nginx-1.2.7-no_buffer-v6.patch nginx_upload_module-2.2.0.tar.gz ngx_devel_kit-0.2.19 pcre-8.34.zip lua-nginx-module-0.9.16.tar.gz nginx-1.2.7.tar.gz nginx-upload-progress-module-master ngx_devel_kit-0.2.19.tar.gz php-5.5.7 nginx-1.2.7 nginx_upload_module-2.2.0 nginx-upload-progress-module-master.zip pcre-8.34 php-5.5.7.tar.gz cd /opt/nginx_comp/nginx-1.2.7/ ./configure --user=www-data --group=www-data --prefix=/usr/local/nginx-1.2.7/ --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_gzip_static_module --with-http_mp4_module --add-module=../ngx_devel_kit-0.2.19 --add-module=../lua-nginx-module-0.9.16 vi objs/Makefile CFLAGS = -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -DNDK_SET_VAR CFLAGS = -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -g -DNDK_SET_VAR make -j4 make install测试是否成功:
nginxconfig中加入
location /hello {
default_type 'text/plain';
content_by_lua 'ngx.say("hello, lua")';
}
访问192.168.100.1/hello
会出现“hello,lua”
相关文章推荐
- Nginx的启动、停止、平滑启动、平滑升级
- linux环境安装Nginx
- tornado + supervisor + nginx 的一点记录
- Apache与Nginx的优缺点比较
- Nginx+fastcgi 部署Django项目
- Django+uwsgi+nginx配置详解
- Nginx Location配置总结及基础最佳实践
- nginx禁止访问某个后缀名的文件
- nginx源码分析1———进程间的通信机制五(文件锁)
- 在阿里云服务器(ECS)上从零开始搭建nginx服务器
- Nginx 笔记与总结(7)Location:正则匹配
- Nginx负载均衡配置实例详解
- nginx搭建流媒体服务器的方法详解
- Nginx+Keepalived实现Web服务器负载均衡
- Nginx+Keepalived实现Web服务器负载均衡
- Ubuntu下nginx的编译与安装
- nginx如何设置访问跳转到一个固定页面
- fast_nginx_module二次开发_结合imageMagick
- CentOS_6.5安装Nginx+PHP+MySQL
- 关于NGINX的502的装逼打怪之路