nginx 

Send to Kindle
home » snippets » os_x » macports » nginx



Installing with redis2, luajit, echo, etc. support.

Get the nginx module sources

cd ~/vcs_3p
git clone git://github.com/agentzh/redis2-nginx-module.git
git clone git://github.com/chaoslawful/lua-nginx-module.git
git clone git://github.com/simpl/ngx_devel_kit.git
git clone git://github.com/agentzh/echo-nginx-module.git

Update the Portfile to add these variants.

sudo port edit nginx

Add these contents

variant redis2 description {ngx_redis2 module} {
    configure.args-append   --add-module=/Users/chirayu/vcs_3p/redis2-nginx-module
}

variant echo description {echo module} {
    configure.args-append   --add-module=/Users/chirayu/vcs_3p/echo-nginx-module
}

variant ngx_devel_kit description {ngx_devel_kit module} {
    configure.args-append   --add-module=/Users/chirayu/vcs_3p/ngx_devel_kit
}

variant lua requires ngx_devel_kit description {lua module} {
    # NOTE: lua-nginx-module doesn't support LUA 5.2 yet.  luajit 2.0 is supported.
    #     We need to prepend the luajit include path here this way to avoid using the LUA 5.2
    #     header files that will result in errors such as LUA_GLOBALSINDEX being undefined.
    configure.cflags        -I/opt/local/include/luajit-2.0/ ${configure.cflags}
    configure.env           LUAJIT_INC=/opt/local/include/luajit-2.0/
    configure.env           LUAJIT_LIB=/opt/local/lib
    configure.args-append   --add-module=/Users/chirayu/vcs_3p/lua-nginx-module
    depends_lib-append      port:luajit
    # depends_lib-append      port:luajit port:lua
}

Now install it.

sudo port install nginx +gzip_static+redis+ssl+status+upload+zip+redis2+echo+lua

# May need this?
# sudo port activate -f nginx @<VERSION>++gzip_static+redis+ssl+status+upload+zip+redis2+echo+lua