Skip to content

Instantly share code, notes, and snippets.

@ashee
Forked from ejlp12/install_openresty_in_mac.md
Last active February 17, 2018 04:48
Show Gist options
  • Save ashee/3d86b8788387a7532df32ed88ef93c64 to your computer and use it in GitHub Desktop.
Save ashee/3d86b8788387a7532df32ed88ef93c64 to your computer and use it in GitHub Desktop.
Install openresty in Mac OS-X

Install 3scale self managed API gateway (openresty) in Mac OS-X

brew update
brew install pcre openssl

wget http://openresty.org/download/ngx_openresty-1.9.7.2.tar.gz
tar xzvf ngx_openresty-1.9.7.2.tar.gz
cd ngx_openresty-1.9.7.2

./configure \
   --with-cc-opt="-I/usr/local/opt/openssl/include/ -I/usr/local/opt/pcre/include/" \
   --with-ld-opt="-L/usr/local/opt/openssl/lib/ -L/usr/local/opt/pcre/lib/" \
   -j8
 make
 make install
 export PATH=/usr/local/openresty/bin:/usr/local/openresty/nginx/sbin:$PATH

luarocks

OR_HOME=$HOME/opt/openresty
./configure \
   --prefix=$OR_HOME \
   --lua-suffix=jit \
   --with-lua=$OR_HOME/luajit \
   --with-lua-include=$OR_HOME/luajit/include/luajit-2.1 \
   --with-lua-lib=$OR_HOME/luajit/lib \
   --rocks-tree=$OR_HOME/luajit

lapis

Modify rockspec and change cjson dependency to cjson2

amitava:lapis amitava$ git diff
diff --git a/lapis-dev-1.rockspec b/lapis-dev-1.rockspec
index 7c36319..0e44d76 100644
--- a/lapis-dev-1.rockspec
+++ b/lapis-dev-1.rockspec
@@ -1,5 +1,5 @@
 package = "lapis"
-version = "dev-1"
+version = "1.6.0-1"

 source = {
        url = "git://github.com/leafo/lapis.git"
@@ -20,7 +20,7 @@ dependencies = {
        "etlua",
        "loadkit",
        "lpeg",
-       "lua-cjson",
+       "lua-cjson2",
        "luaossl",
        "luafilesystem",
        "luasocket",
	
$ ln -s lapis-dev-1.rockspec lapis-1.6.0-1.rockspec

$ luarocks make --pack-binary-rock 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment