Compiling nginx 1.9.0

#See https://adrhc.go.ro/wordpress/common-commands-when-building/ for building environment, x.sh script and other things not defined here.
#Before starting do declare the environment variables specified to the link above.

NEW_BUILD_NAME=nginx
NEW_BUILD_VER=1.9.0
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=1

cd /ffp/home/root/compile/nginx-1.9.0
~/x.sh ffpg
./configure --help > configure.help.txt

#additional modules
#+nginx-dav-ext-module
#+ngx_devel_kit-0.2.19
#+lua-nginx-module-0.9.16rc1
#+echo-nginx-module-0.57
#+rds-json-nginx-module
#+drizzle-nginx-module
#
#--with-pcre-jit -> must be the last

./configure --prefix=/ffp --conf-path=/ffp/etc/nginx/nginx.conf --error-log-path=/ffp/log/nginx-error.log --pid-path=/ffp/var/run/nginx.pid --user=nobody --group=nobody --with-file-aio --with-http_ssl_module --with-http_spdy_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_perl_module --with-perl=/ffp/bin/perl --http-log-path=/ffp/log/nginx-access.log --http-client-body-temp-path=/ffp/tmp/nginx/client-body --http-proxy-temp-path=/ffp/tmp/nginx/proxy --http-fastcgi-temp-path=/ffp/tmp/nginx/fastcgi --http-uwsgi-temp-path=/ffp/tmp/nginx/uwsgi --http-scgi-temp-path=/ffp/tmp/nginx/scgi --with-cc=/ffp/bin/cc --with-cpp=/ffp/bin/cpp --with-cpu-opt=armv5te --with-debug --add-module=$HOME/compile/nginx-modules/nginx-dav-ext-module --add-module=$HOME/compile/nginx-modules/ngx_devel_kit-0.2.19 --add-module=$HOME/compile/nginx-modules/drizzle-nginx-module --add-module=$HOME/compile/nginx-modules/echo-nginx-module-0.57 --add-module=$HOME/compile/nginx-modules/rds-json-nginx-module --add-module=$HOME/compile/nginx-modules/lua-nginx-module-0.9.16rc1 --with-pcre --with-pcre-jit

ERROR
    ngx_http_lua_initworkerby.c:(.text+0x2b8): undefined reference to `ngx_http_set_connection_log'
    objs/addon/src/ngx_http_lua_timer.o: In function `ngx_http_lua_timer_handler':
    ngx_http_lua_timer.c:(.text+0x4c0): undefined reference to `ngx_http_set_connection_log'
SOLUTION
    sed -i s/"ngx_http_set_connection_log"/"ngx_set_connection_log"/ nginx-modules/lua-nginx-module-0.9.16rc1/src/ngx_http_lua_timer.c
    sed -i s/"ngx_http_set_connection_log"/"ngx_set_connection_log"/ nginx-modules/lua-nginx-module-0.9.16rc1/src/ngx_http_lua_initworkerby.c

nohup /ffp/bin/make -C ~/compile/$NEW_BUILD_NAME_AND_VER &
renice -11 `pidof cc1plus` -p `pidof make` -p `pidof as` -p `pidof ld` -p `pidof configure` -p `pidof cc1` -p `pidof ccmake`
tail -f nohup.out

#directories required for nginx to run with default settings
mkdir -p /ffp/tmp/nginx/client-body
mkdir -p /ffp/tmp/nginx/proxy
mkdir -p /ffp/tmp/nginx/fastcgi
mkdir -p /ffp/tmp/nginx/uwsgi
mkdir -p /ffp/tmp/nginx/scgi

rm -r $HOME/temp/$NEW_BUILD_NAME_AND_VER
make install DESTDIR=$HOME/temp/$NEW_BUILD_NAME_AND_VER
cd $HOME/temp/$NEW_BUILD_NAME_AND_VER
makepkg $NEW_BUILD_NAME $NEW_BUILD_VER $NEW_BUILD_NR
cp -v /tmp/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz ~/ffp_0.7_armv5/packages/
funpkg -q $NEW_BUILD_NAME
funpkg -i ~/apache-htdocs/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.