HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Tips/Tricks/Mods (http://www.howtoforge.com/forums/forumdisplay.php?f=29)
-   -   Adding ngx_lua to nginx (http://www.howtoforge.com/forums/showthread.php?t=61890)

Kubek 19th May 2013 13:10

Adding ngx_lua to nginx
 
Hi, I just followed the The Perfect Server - Debian Wheezy (nginx, BIND, Dovecot, ISPConfig 3).

Now I wonder how can I add the ngx_lua module to nginx.
I want to implement advanced caching mechanism right in nginx.

I think I need to recompile the nginx with ngx_lua module but i am not sure how can i do it. I do not want to break anything. So far I found these instructions, but I don't know where nginx have to be installed.

Thank you for help :)

Kubek 21st May 2013 16:45

How to
 
I finally done it. Only few seconds downtime.
So here are some instructions for other people

1. Download and install LuaJIT:

Code:

cd /tmp
wget http://luajit.org/download/LuaJIT-2.0.1.tar.gz
tar -xzvf LuaJIT-2.0.1.tar.gz
cd LuaJIT-2.0.1.tar.gz
make && sudo make install

It will automatically install LuaJIT to /usr/local/

2. Download the latest version of the ngx_devel_kit (NDK) module:
Code:

cd /tmp
wget https://github.com/simpl/ngx_devel_kit/archive/v0.2.18.tar.gz
tar -xzvf v0.2.18.tar.gz

3. Download the latest version of ngx_lua:
Code:

cd /tmp
wget https://github.com/chaoslawful/lua-nginx-module/archive/v0.8.2rc1.tar.gz
tar -xzvf v0.8.2rc1.tar.gz

4. Download the latest version of Nginx:
Code:

cd /tmp
wget http://nginx.org/download/nginx-1.4.1.tar.gz
tar -xzcf nginx-1.4.1.tar.gz

5. Prepare Nginx with module
Code:

cd nginx-1.4.1.tar.gz
//Add here everything you have in nginx -V
./configure --add-module=/path/to/ngx_devel_kit
./configure --add-module=/path/to/lua-nginx-module

6. Stop Nginx, install, Start new Nginx:
Code:

make
nginx -s stop
nginx make install
nginx

Enjoy your new Nginx.

*AUTOMATIC UPDATES CAN BREAK YOUR NGINX


All times are GMT +2. The time now is 00:26.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.