Centos6安装Tengine+Lua

简介:

添加epel源


1
2
rpm -ivh http: //dl .fedoraproject.org /pub/epel/6/x86_64/epel-release-6-8 .noarch.rpm
yum  install  readline readline-devel zlib zlib-devel


下面安装 lua


1
2
3
4
5
6
7
8
tar  xvf LuaJIT-2.0.3. tar .gz
cd  LuaJIT-2.0.3/                                                                                            
make
make  install
ln  -s  /usr/local/lib/libluajit-5 .1.so.2  /lib64/libluajit-5 .1.so.2
 
echo   "export LUAJIT_LIB=/usr/local/lib"  >>  /etc/profile
export  "LUAJIT_INC=/usr/local/include/luajit-2.0/"  >>  /etc/profile


编译openssl

1
2
3
4
5
wget http: //www .openssl.org /source/openssl-1 .0.1g. tar .gz
tar  zxf openssl-1.0.1g. tar .gz
cd  openssl-1.0.1g
. /config  shared zlib
make  &&  make  install

 接下来就可以编译 tengine 了


1
2
3
4
5
yum  install  -y pcre-devel pcre libxml2 libxml2-devel libxslt-devel gd-devel geoip geoip-devel
cd  tengine-2.1.2
. /configure  --with-cc-opt= '-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2'  --prefix= /usr/share/nginx  --conf-path= /etc/nginx/nginx .conf --http-log-path= /var/log/nginx/access .log --error-log-path= /var/log/nginx/error .log --lock-path= /var/lock/nginx .lock --pid-path= /run/nginx .pid --http-client-body-temp-path= /var/lib/nginx/body  --http-fastcgi-temp-path= /var/lib/nginx/fastcgi  --http-proxy-temp-path= /var/lib/nginx/proxy  --http-scgi-temp-path= /var/lib/nginx/scgi  --http-uwsgi-temp-path= /var/lib/nginx/uwsgi  --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module  --with-http_sub_module --with-http_xslt_module --with-http_concat_module --with-http_lua_module --with-luajit-lib= /usr/local/lib/  --with-luajit-inc= /usr/local/include/luajit-2 .0/ --with-lua-inc= /usr/local/include/luajit-2 .0/ --with-lua-lib= /usr/local/lib/  --with-ld-opt=-Wl,-rpath, /usr/local/lib  --with-openssl= /root/openssl-1 .0.1g
make  &&  make  install
cp  /usr/share/nginx/sbin/nginx  /usr/sbin/nginx

测试:修改/etc/nginx/nginx.conf

 

location /lua_content {
            default_type 'text/plain';
            content_by_lua "ngx.say('Hello,world!')";
        }


浏览器访问 http://x.x.x.x/lua_content



本文转自 转身撞墙角 51CTO博客,原文链接:http://blog.51cto.com/chentianwang/1969991
相关文章
|
1月前
|
Linux 网络安全 数据安全/隐私保护
如何在 VM 虚拟机中安装 CentOS Linux 9 操作系统保姆级教程(附链接)
如何在 VM 虚拟机中安装 CentOS Linux 9 操作系统保姆级教程(附链接)
144 0
|
2月前
|
关系型数据库 MySQL Linux
centos7.0环境下安装MySql_8.0.12
centos7.0环境下安装MySql_8.0.12
|
1月前
|
存储 JavaScript Linux
Linux环境下安装nmp(Centos环境)保姆级教学 一步到位
Linux环境下安装nmp(Centos环境)保姆级教学 一步到位
|
2月前
|
关系型数据库 MySQL Linux
CentOS7环境下安装MySQL5.6
CentOS7环境下安装MySQL5.6
195 0
|
2月前
|
缓存 负载均衡 应用服务中间件
如何在 CentOS 7 上为 NGINX 安装开源 HTTP 加速器:Varnish
如何在 CentOS 7 上为 NGINX 安装开源 HTTP 加速器:Varnish
70 1
如何在 CentOS 7 上为 NGINX 安装开源 HTTP 加速器:Varnish
|
3天前
|
关系型数据库 MySQL Linux
centos7安装mysql-带网盘安装包
centos7安装mysql-带网盘安装包
33 2
|
10天前
|
存储 Linux Shell
centos 部署docker容器 安装 、基本使用方法(一)
centos 部署docker容器 安装 、基本使用方法(一)
19 0
|
10天前
|
分布式计算 Hadoop Java
centos 部署Hadoop-3.0-高性能集群(一)安装
centos 部署Hadoop-3.0-高性能集群(一)安装
12 0
|
10天前
|
关系型数据库 MySQL Linux
CentOS 7 下使用yum安装MySQL5.7.20 最简单 图文详解
CentOS 7 下使用yum安装MySQL5.7.20 最简单 图文详解
47 0
|
16天前
|
IDE Linux 开发工具
CentOS7.4+REDHAWK2.3.1安装教程——折腾篇
CentOS7.4+REDHAWK2.3.1安装教程——折腾篇
18 0

热门文章

最新文章