Skip to content

Instantly share code, notes, and snippets.

@rhykw
Created April 25, 2016 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rhykw/b7d10721937fab08c6d17890a7afa61c to your computer and use it in GitHub Desktop.
Save rhykw/b7d10721937fab08c6d17890a7afa61c to your computer and use it in GitHub Desktop.
ngx_mruby add_with_openssl test shell
#!/bin/bash
openssl_ver=1.0.2g
nginx_ver=1.9.14
set -ex
tempdir=/var/tmp/ngx_mruby_build_$( date "+%Y%m%d%H%M%S" )
mkdir -p $tempdir
cd $tempdir
curl -ks https://www.openssl.org/source/openssl-${openssl_ver}.tar.gz | tar -zx
curl -ks http://nginx.org/download/nginx-${nginx_ver}.tar.gz | tar -zx
git clone https://github.com/rhykw/ngx_mruby.git
cd ngx_mruby
git checkout add_with_openssl
if [ -z "$WITH_OPENSSL" ] ; then
./configure --with-ngx-src-root=../nginx-${nginx_ver}
else
./configure --with-ngx-src-root=../nginx-${nginx_ver} --with-openssl-src=$(pwd)/../openssl-${openssl_ver}
fi
make build_mruby
make generate_gems_config
cd ../nginx-${nginx_ver}
./configure \
--with-openssl=$(pwd)/../openssl-${openssl_ver} \
--with-http_ssl_module \
--add-module=../ngx_mruby \
--prefix=$(pwd)/.install
make
make install
sed -e '/listen/ s/80/8080/' -i $(pwd)/.install/conf/nginx.conf
$(pwd)/.install/sbin/nginx -t
@rhykw
Copy link
Author

rhykw commented Apr 25, 2016

not added --with-openssl-src

$ WITH_OPENSSL="" bash ./t_ngx_mruby_awo.sh ; echo $?
++ date +%Y%m%d%H%M%S
+ tempdir=/var/tmp/ngx_mruby_build_20160425225345
+ mkdir -p /var/tmp/ngx_mruby_build_20160425225345
+ cd /var/tmp/ngx_mruby_build_20160425225345
+ curl -ks https://www.openssl.org/source/openssl-1.0.2g.tar.gz
+ tar -zx
+ curl -ks http://nginx.org/download/nginx-1.9.14.tar.gz
+ tar -zx
+ git clone https://github.com/rhykw/ngx_mruby.git

......

++ pwd
+ sed -e '/listen/ s/80/8080/' -i /var/tmp/ngx_mruby_build_20160425225345/nginx-1.9.14/.install/conf/nginx.conf
++ pwd
+ /var/tmp/ngx_mruby_build_20160425225345/nginx-1.9.14/.install/sbin/nginx -t
./t_ngx_mruby_awo.sh: line 40: 30775 Segmentation fault      $(pwd)/.install/sbin/nginx -t
139

@rhykw
Copy link
Author

rhykw commented Apr 25, 2016

added --with-openssl-src

# WITH_OPENSSL="yes" bash ./t_ngx_mruby_awo.sh ; echo $?
++ date +%Y%m%d%H%M%S
+ tempdir=/var/tmp/ngx_mruby_build_20160425230000
+ mkdir -p /var/tmp/ngx_mruby_build_20160425230000
+ cd /var/tmp/ngx_mruby_build_20160425230000
+ curl -ks https://www.openssl.org/source/openssl-1.0.2g.tar.gz
+ tar -zx
+ curl -ks http://nginx.org/download/nginx-1.9.14.tar.gz
+ tar -zx
+ git clone https://github.com/rhykw/ngx_mruby.git

......

++ pwd
+ sed -e '/listen/ s/80/8080/' -i /var/tmp/ngx_mruby_build_20160425230000/nginx-1.9.14/.install/conf/nginx.conf
++ pwd
+ /var/tmp/ngx_mruby_build_20160425230000/nginx-1.9.14/.install/sbin/nginx -t
nginx: the configuration file /var/tmp/ngx_mruby_build_20160425230000/nginx-1.9.14/.install/conf/nginx.conf syntax is ok
nginx: configuration file /var/tmp/ngx_mruby_build_20160425230000/nginx-1.9.14/.install/conf/nginx.conf test is successful
0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment