LNMP Smooth upgrade nginx and install Ngx_lua module tutorial

Source: Internet
Author: User

#ngx_lua Module Project address https://Github.com/chaoslawful/lua-nginx-moduleafter installing the package in LNMP, recompile the Nginx and add the Ngx_lua module1"downloadwget http://luajit.org/download/luajit-2.0.4.tar.gzwget https://github.com/simpl/ngx_devel_kit/archive/v0.2.19.tar.gzwget https://github.com/chaoslawful/lua-nginx-module/archive/v0.9.16.tar.gzwget http://nginx.org/download/nginx-1.9.2.tar.gz2the installation Luajittar-ZXVF luajit-2.0.4. TAR.GZCD Luajit-2.0.4Makemake installexport luajit_lib=/usr/local/Libexport luajit_inc=/usr/local/include/luajit-2.03"copy module CP v0.2.19. tar.gz/usr/local/SRCCP v0.9.16. tar.gz/usr/local/Srctar-ZXVF V0.2.19. Tar.gztar-ZXVF V0.9.16. tar.gz unzip the downloaded Ngx_devel_kit and Lua-nginx-module to/usr/local/src directory, i.e./usr/local/src/lua-nginx-module-0.9. -//usr/local/src/ngx_devel_kit-0.2. +/3"Recompile Nginxtar-ZXVF nginx-1.9.2. tar.gz Unzip the Nginx package, configure (refer to the LNMP installation package, no other modifications)./configure--user=www--group=www--prefix=/usr/local/nginx--with-ld-opt="-wl,-rpath, $LUAJIT _lib"--with-http_stub_status_module--with-http_ssl_module--with-http_gzip_static_module--with-IPv6--add-module=/usr/local/src/lua-nginx-module-0.9. -/ --add-module=/usr/local/src/ngx_devel_kit-0.2. +/Make after OK, do not install, or overwrite the installation4"Backup replacement made after the OBJS directory more nginx, that is, the new version of the program to back up the old Nginx program CP/usr/local/nginx/sbin/nginx/usr/local/nginx/sbin/Nginx.bak New Nginx program covers the old CP Objs/nginx/usr/local/nginx/sbin/Nginx If prompted "Cp:cannot Create regular file "/usr/local/nginx/sbin/nginx': Text file Busy "It is recommended to use the following statement CPCP-RFP objs/nginx/usr/local/nginx/sbin/Nginx Test the new Nginx program is correct/usr/local/nginx/sbin/nginx-tnginx:theconfiguration File/usr/local/nginx/conf/nginx.conf syntax isoknginx:configuration File/usr/local/nginx/conf/nginx.conf test issuccessful smooth restart Nginx/usr/local/nginx/sbin/nginx-s Reload View NGIXN version and its compilation parameters/usr/local/nginx/sbin/nginx-v"Problem Solving"1. If you are unable to find the library file echo "/usr/local/lib ">/etc/ld.so.conf.d/Usr_local_lib.confldconfig can2./usr/local/nginx/sbin/nginx:error whileLoading shared libraries:libluajit-5.1. So.2: Cannot open sharedObjectfile:no such file or directory in Nginx compile, you need to specify RPATH, remember to add the following options:./configure--with-ld-opt="-wl,-rpath, $LUAJIT _lib"or export Ld_library_path=/usr/local/lib/: $LD _library_path need luafilesystem for reference: Install luarocks for nginx Luajit and install Luafilesystem

LNMP Smooth upgrade nginx and install Ngx_lua module tutorial

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.