openresty.sh 758 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. fw_depends lua
  3. RETCODE=$(fw_exists ${IROOT}/openresty.installed)
  4. [ ! "$RETCODE" == 0 ] || { \
  5. source $IROOT/openresty.installed
  6. return 0; }
  7. OPENRESTY_VERSION="1.7.10.1"
  8. OPENRESTY=$IROOT/openresty
  9. OPENRESTY_HOME=$OPENRESTY-$OPENRESTY_VERSION
  10. fw_get -O http://openresty.org/download/ngx_openresty-$OPENRESTY_VERSION.tar.gz
  11. fw_untar ngx_openresty-$OPENRESTY_VERSION.tar.gz
  12. cd ngx_openresty-$OPENRESTY_VERSION
  13. ./configure --with-luajit-xcflags=-DLUAJIT_NUMMODE=2 --with-http_postgres_module --prefix=$OPENRESTY_HOME -j4
  14. make -j4
  15. make install
  16. echo "export OPENRESTY_HOME=${OPENRESTY_HOME}" > $IROOT/openresty.installed
  17. echo -e "export PATH=\$OPENRESTY_HOME/nginx/sbin:\$PATH" >> $IROOT/openresty.installed
  18. source $IROOT/openresty.installed