Bug 167494 - www/nginx - Feature Request - Add Upstream Sticky module to Nginx
Summary: www/nginx - Feature Request - Add Upstream Sticky module to Nginx
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Sergey A. Osokin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-01 18:30 UTC by mike
Modified: 2012-05-11 11:43 UTC (History)
0 users

See Also:


Attachments
file.diff (1.90 KB, patch)
2012-05-01 18:30 UTC, mike
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mike 2012-05-01 18:30:11 UTC
I would like to see the upstream sticky module added to www/nginx

See nginx_patch.txt

Fix: Patch attached with submission follows:
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-05-01 18:30:57 UTC
Responsible Changed
From-To: freebsd-ports-bugs->osa

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Sergey A. Osokin freebsd_committer freebsd_triage 2012-05-02 11:19:41 UTC
It looks like its impossible to build ngx_http_sticky module without ngx_ssl_module:

===>  Building for nginx-1.2.0_1,1
make -f objs/Makefile
cc -c -pipe -g -g -I /usr/local/include  -I src/core  -I src/event  -I src/event/modules  -I src/os/unix  -I objs  -I src/http  -I src/http/modules  -I src/mail  -o objs/addon/nginx-sticky-module-1.0/ngx_http_sticky_misc.o  /usr/home/osa/ports/www/nginx/work/nginx-sticky-module-1.0/ngx_http_sticky_misc.c
/usr/home/osa/ports/www/nginx/work/nginx-sticky-module-1.0/ngx_http_sticky_misc.c: In function 'ngx_http_sticky_misc_hmac_md5':
/usr/home/osa/ports/www/nginx/work/nginx-sticky-module-1.0/ngx_http_sticky_misc.c:155: error: 'MD5_CBLOCK' undeclared (first use in this function)
/usr/home/osa/ports/www/nginx/work/nginx-sticky-module-1.0/ngx_http_sticky_misc.c:155: error: (Each undeclared identifier is reported only once
/usr/home/osa/ports/www/nginx/work/nginx-sticky-module-1.0/ngx_http_sticky_misc.c:155: error: for each function it appears in.)
*** Error code 1

Any idea?
Comment 3 bpmikec 2012-05-03 01:05:37 UTC
On 5/2/2012 3:19 AM, Sergey A. Osokin wrote:
> It looks like its impossible to build ngx_http_sticky module without ngx_ssl_module:
>
> ===>   Building for nginx-1.2.0_1,1
> make -f objs/Makefile
> cc -c -pipe -g -g -I /usr/local/include  -I src/core  -I src/event  -I src/event/modules  -I src/os/unix  -I objs  -I src/http  -I src/http/modules  -I src/mail  -o objs/addon/nginx-sticky-module-1.0/ngx_http_sticky_misc.o  /usr/home/osa/ports/www/nginx/work/nginx-sticky-module-1.0/ngx_http_sticky_misc.c
> /usr/home/osa/ports/www/nginx/work/nginx-sticky-module-1.0/ngx_http_sticky_misc.c: In function 'ngx_http_sticky_misc_hmac_md5':
> /usr/home/osa/ports/www/nginx/work/nginx-sticky-module-1.0/ngx_http_sticky_misc.c:155: error: 'MD5_CBLOCK' undeclared (first use in this function)
> /usr/home/osa/ports/www/nginx/work/nginx-sticky-module-1.0/ngx_http_sticky_misc.c:155: error: (Each undeclared identifier is reported only once
> /usr/home/osa/ports/www/nginx/work/nginx-sticky-module-1.0/ngx_http_sticky_misc.c:155: error: for each function it appears in.)
> *** Error code 1
>
> Any idea?
I forgot that I had enabled SSL in my configuration, so I did no notice 
that the module would not compile without it.

I've submitted a ticket with the ngx_http_sticky maintainer. They do not 
list that ngx_ssl_module is required in their documentation.

Would it be a problem to require SSL for the sticky module?

Mike C
Comment 4 Sergey A. Osokin freebsd_committer freebsd_triage 2012-05-03 10:44:54 UTC
> I forgot that I had enabled SSL in my configuration, so I did no notice 
> that the module would not compile without it.
> 
> I've submitted a ticket with the ngx_http_sticky maintainer. They do not 
> list that ngx_ssl_module is required in their documentation.
> 
> Would it be a problem to require SSL for the sticky module?

This is not the problem, could you create a new patch with correct
dependences.
Comment 5 bpmikec 2012-05-07 17:50:49 UTC
On 5/3/2012 2:44 AM, Sergey A. Osokin wrote:
>> I forgot that I had enabled SSL in my configuration, so I did no notice
>> that the module would not compile without it.
>>
>> I've submitted a ticket with the ngx_http_sticky maintainer. They do not
>> list that ngx_ssl_module is required in their documentation.
>>
>> Would it be a problem to require SSL for the sticky module?
> This is not the problem, could you create a new patch with correct
> dependences.
Ok, how is this?

--- /usr/ports/www/nginx/Makefile       2012-04-26 01:11:11.000000000 -0700
+++ /root/nginx/Makefile        2012-05-07 08:49:58.822836843 -0700
@@ -72,6 +72,7 @@
                 HTTP_UPLOAD_PROGRESS    "3rd party uploadprogress 
module" off \
                 HTTP_UPSTREAM_FAIR      "3rd party upstream fair 
module" off \
                 HTTP_UPSTREAM_HASH      "3rd party upstream hash 
module" off \
+               HTTP_UPSTREAM_STICKY    "3rd party upstream sticky 
module" off \
                 HTTP_ZIP_MODULE         "3rd party http_zip module" off \
                 ARRAYVAR_MODULE         "3rd party array_var module" off \
                 CHUNKIN_MODULE          "3rd party chunkin module" off \
@@ -423,6 +424,16 @@
  EXTRA_PATCHES+=        ${PATCHDIR}/extra-patch-ngx_http_upstream.h
  .endif

+.if defined(WITH_HTTP_UPSTREAM_STICKY)
+NGINX_OPENSSL=  yes
+CONFIGURE_ARGS+=--with-http_ssl_module
+NGINX_UPSTREAM_STICKY_VERSION=         1.0
+MASTER_SITES+= 
http://nginx-sticky-module.googlecode.com/files/:upstreamsticky
+DISTFILES+=    
nginx-sticky-module-${NGINX_UPSTREAM_STICKY_VERSION}.tar.gz:upstreamsticky
+CONFIGURE_ARGS+=--add-module=${WRKDIR}/nginx-sticky-module-${NGINX_UPSTREAM_STICKY_VERSION}
+.endif
+
+
  .if defined(WITH_HTTP_XSLT_MODULE)
  USE_GNOME=     libxml2 libxslt
  CONFIGURE_ARGS+=--with-http_xslt_module
@@ -715,6 +726,9 @@
  .if defined(WITH_HTTP_UPSTREAM_FAIR)
         @${ECHO_MSG} "Enable http_ssl module to build upstream_fair 
with SSL support"
  .endif
+.if defined(WITH_HTTP_UPSTREAM_STICKY)
+       @${ECHO_MSG} "Enable http_ssl module to build upstream_sticky"
+.endif
  .if defined(WITH_PASSENGER_MODULE)
         @${ECHO_MSG} "This port install Passenger module only"
  .endif
diff -u /usr/ports/www/nginx/distinfo /root/nginx/distinfo
--- /usr/ports/www/nginx/distinfo       2012-04-26 01:11:11.000000000 -0700
+++ /root/nginx/distinfo        2012-05-01 09:17:54.438836199 -0700
@@ -46,6 +46,8 @@
  SIZE (nginx_upstream_fair-20090923.tar.gz) = 10024
  SHA256 (Nginx_upstream_hash-0.3.1.tar.gz) = 
51929c5352d4c2608b3f852987830be08b6946baf20da346fe520d9b12e39968
  SIZE (Nginx_upstream_hash-0.3.1.tar.gz) = 5049
+SHA256 (nginx-sticky-module-1.0.tar.gz) = 
415beaac0dd229c271128b461f6059601f4889714b548b20a4720fc5f0a86b60
+SIZE (nginx-sticky-module-1.0.tar.gz) = 114184
  SHA256 (mod_zip-1.1.6.tar.gz) = 
d30546b4be8308c721df0240ebc38c474c6b577381a110321eded6dbed5104b1
  SIZE (mod_zip-1.1.6.tar.gz) = 21991
  SHA256 (agentzh-chunkin-nginx-module-v0.22rc1-0-gb0a3ee3.tar.gz) = 
23c41a6743803f8521c55b9c76d5c35b20e9870576478ce9152d2ecddffbf2ca
Comment 6 Sergey A. Osokin freebsd_committer freebsd_triage 2012-05-11 11:42:59 UTC
State Changed
From-To: open->closed

I committed my version, thanks for report!