Compiling nginx 1.9.2

#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.1
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=0

cd /ffp/home/root/compile/$NEW_BUILD_NAME_AND_VER
~/x.sh ffpg-all
./configure --help > configure.help.txt

#additional modules
#+nginx-dav-ext-module
#+ngx_devel_kit-0.2.19
#+lua-nginx-module-0.9.16rc3
#+echo-nginx-module-0.58
#+rds-json-nginx-module-0.14
#+drizzle-nginx-module-0.1.9
#+set-misc-nginx-module-0.29
#
#--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-stream --with-stream_ssl_module --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/set-misc-nginx-module-0.29 --add-module=$HOME/compile/nginx-modules/drizzle-nginx-module-0.1.9 --add-module=$HOME/compile/nginx-modules/echo-nginx-module-0.58 --add-module=$HOME/compile/nginx-modules/rds-json-nginx-module-0.14 --add-module=$HOME/compile/nginx-modules/lua-nginx-module-0.9.16rc3 --with-pcre --with-pcre-jit

#ERROR (lua-nginx-module-0.9.16rc1)
	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

#ERROR (drizzle-nginx-module-0.1.8)
	/ffp/home/root/compile/nginx-modules/drizzle-nginx-module-0.1.9/src/ngx_http_drizzle_util.c:607:13: error: 'ngx_http_upstream_state_t' has no member named 'response_sec'
		 u->state->response_sec = tp->sec;
				 ^
	/ffp/home/root/compile/nginx-modules/drizzle-nginx-module-0.1.8/src/ngx_http_drizzle_util.c:608:13: error: 'ngx_http_upstream_state_t' has no member named 'response_msec'
		 u->state->response_msec = tp->msec;
#SOLUTION
	#Replace any "->response_msec" with "->response_time".
	#Comment any line containing: "->response_sec =".
	#Replace any "&& u->state->response_time" with "&& u->state->response_time".
	#Do the above replacements/comments using these commands:
	sed -i s/"\s\s\su->state->response_sec"/"\/\/u->state->response_sec"/g /ffp/home/root/compile/nginx-modules/drizzle-nginx-module-0.1.8/src/ngx_http_drizzle_util.c
	sed -i s/"u->state->response_msec"/"u->state->response_time"/g /ffp/home/root/compile/nginx-modules/drizzle-nginx-module-0.1.8/src/ngx_http_drizzle_util.c
	sed -i s/"u->state->response_sec"/"u->state->response_time"/g /ffp/home/root/compile/nginx-modules/drizzle-nginx-module-0.1.8/src/ngx_http_drizzle_util.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 by nginx in order 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

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