Centos6安装Tengine+Lua

前端之家收集整理的这篇文章主要介绍了Centos6安装Tengine+Lua前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
  1. 添加epel
  2.  
  3. #rpm-ivh
  4. #yuminstallreadlinereadline-develzlibzlib-devel


下面安装 lua


  1. #wgethttp://www.lua.org/ftp/lua-5.3.0.tar.gz
  2. #tarxvflua-5.3.0.tar.gz
  3.  
  4. #cdlua-5.3.0/
  5. #makelinuxmakeinstall
  6. #cd..
  7. #wget
  8. #tarxfLuaJIT-2.0.3.tar.gz
  9. #cdLuaJIT-2.0.3/
  10. #makemakeinstall
  11. #ln-s/usr/local/lib/libluajit-5.1.so.2/lib64/libluajit-5.1.so.2
  12. #exportLUAJIT_LIB=/usr/local/lib
  13. #exportLUAJIT_INC=/usr/local/include/luajit-2.0/


接下来就可以编译 tengine 了

  1. #wgethttp://www.openssl.org/source/openssl-1.0.1g.tar.gz
  2. #tarzxfopenssl-1.0.1g.tar.gz
  3. #cdopenssl-1.0.1g
  4. #./configsharedzlib
  5. #make&&makeinstall
  6. #yuminstall-ypcre-develpcrelibxml2libxml2-devellibxslt-develgd-develgeoipgeoip-devel
  7. #./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
  8. #make&&makeinstall


测试:修改/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

猜你在找的CentOS相关文章