# Nginx sticky module compile error

**URL:** <https://www.ruby-forum.com/t/nginx-sticky-module-compile-error/208360>\
**Category:** NGINX\
**Created:** [June 16, 2011, 9:56am UTC](https://www.ruby-forum.com/t/nginx-sticky-module-compile-error/208360 "2011-06-16T09:56:51Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [June 16, 2011, 9:56am UTC](https://www.ruby-forum.com/t/nginx-sticky-module-compile-error/208360/1 "2011-06-16T09:56:51Z")

</div>

Hello,

we have problems compiling the nginx-sticky module (downloaded from  
[Google Code Archive - Long-term storage for Google Code Project Hosting.](http://code.google.com/p/nginx-sticky-module/downloads/list)) in nginx  
version 1.0.3 and 1.0.4. Here is the output of the “make” command:

gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter  
-Wunused-function -Wunused-variable -Wunused-value -Werror -g -I  
src/core -I src/event -I src/event/modules -I src/os/unix -I objs   
-o objs/src/core/ngx\_crypt.o   
src/core/ngx\_crypt.c  
cc1: warnings being treated as errors  
src/core/ngx\_crypt.c: In function \u2018ngx\_crypt\_apr1\u2019:  
src/core/ngx\_crypt.c:76: warning: pointer targets in passing argument 2  
of \u2018ngx\_md5\_update\u2019 differ in signedness  
make[1]: \*\*\* [objs/src/core/ngx\_crypt.o] Error 1  
make[1]: Leaving directory `/root/src/nginx-1.0.3’  
make: \*\*\* [build] Error 2  
Does anybody know how to fix this error?

Thank you in advance!

Kind regards

Stephan

HEROLD Business Data GmbH  
Guntramsdorfer Straße 105  
A-2340 Mödling

FN 233171z  
Landesgericht Wiener Neustadt

Besuchen Sie uns online und mobil www.herold.at!

Weitere Informationen zu unseren Produkten finden Sie unter:  
[http://mobile.herold.at](http://mobile.herold.at)  
[http://daten.herold.at](http://daten.herold.at)

Werden Sie Fan von HEROLD auf Facebook!

Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen:  
www.clearsense.at

> **[Tupalo.com - Phone, Map, Review for Restaurants, Cafes, Salons, Shops](http://www.tupalo.com)**
>
> Local business reviews and recommendations of Restaurants, Cafes, Shops, Salons, Plumbers and more at Tupalo.com

www.aboutmedia.at  
www.love.at  
www.reise-hero.at  
www.urlauburlaub.at

Diese E-Mail kann vertrauliche und/oder rechtlich geschützte  
Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder  
diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den  
Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie  
die unbefugte Weitergabe dieser Mail sind nicht gestattet.

This e-mail may contain confidential and/or privileged information. If  
you are not the intended recipient (or have received this e-mail in  
error) please notify the sender immediately and delete this e-mail. Any  
unauthorized copying, disclosure or distribution of the material in this  
e-mail is strictly forbidden.

---

<div class="post-metadata">

**Author:** ![Stephan\_Wolfauer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/85e7bf/32.png) [@Stephan\_Wolfauer](https://www.ruby-forum.com/u/Stephan_Wolfauer)\
**Post date:** [June 16, 2011, 9:59am UTC](https://www.ruby-forum.com/t/nginx-sticky-module-compile-error/208360/2 "2011-06-16T09:59:58Z")

</div>

Hello!

On Thu, Jun 16, 2011 at 09:56:15AM +0200, Stephan Wolfauer wrote:

> src/core/ngx\_crypt.c  
> cc1: warnings being treated as errors  
> src/core/ngx\_crypt.c: In function \u2018ngx\_crypt\_apr1\u2019:  
> src/core/ngx\_crypt.c:76: warning: pointer targets in passing argument 2  
> of \u2018ngx\_md5\_update\u2019 differ in signedness  
> make[1]: \*\*\* [objs/src/core/ngx\_crypt.o] Error 1  
> make[1]: Leaving directory `/root/src/nginx-1.0.3’  
> make: \*\*\* [build] Error 2  
> Does anybody know how to fix this error?

This is fixed in 1.0.4.

Maxim D.

---

<div class="post-metadata">

**Author:** ![Stephan\_Wolfauer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/85e7bf/32.png) [@Stephan\_Wolfauer](https://www.ruby-forum.com/u/Stephan_Wolfauer)\
**Post date:** [June 16, 2011, 10:33am UTC](https://www.ruby-forum.com/t/nginx-sticky-module-compile-error/208360/3 "2011-06-16T10:33:56Z")

</div>

Hi,

actually, not it is not. We have the same error in 1.0.4, as stated.

Cheers,  
DJ

> > > Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 6/16/2011 9:59 \>\>\>  
> > > Hello!

On Thu, Jun 16, 2011 at 09:56:15AM +0200, Stephan Wolfauer wrote:

> Hello,
> 
> we have problems compiling the nginx-sticky module (downloaded from  
> [Google Code Archive - Long-term storage for Google Code Project Hosting.](http://code.google.com/p/nginx-sticky-module/downloads/list)) in  
> nginx  
> version 1.0.3 and 1.0.4. Here is the output of the “make” command:
> 
> gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter  
> -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I  
> src/core -I src/event -I src/event/modules -I src/os/unix -I objs   
> -o objs/src/core/ngx\_crypt.o   
> src/core/ngx\_crypt.c  
> cc1: warnings being treated as errors  
> src/core/ngx\_crypt.c: In function \u2018ngx\_crypt\_apr1\u2019:  
> src/core/ngx\_crypt.c:76: warning: pointer targets in passing argument  
> 2  
> of \u2018ngx\_md5\_update\u2019 differ in signedness  
> make[1]: \*\*\* [objs/src/core/ngx\_crypt.o] Error 1  
> make[1]: Leaving directory `/root/src/nginx-1.0.3’  
> make: \*\*\* [build] Error 2  
> Does anybody know how to fix this error?

This is fixed in 1.0.4.

Maxim D.

* * *

nginx mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> **[mailman.nginx.org archive](http://mailman.nginx.org/pipermail/)**

HEROLD Business Data GmbH  
Guntramsdorfer Straße 105  
A-2340 Mödling

FN 233171z  
Landesgericht Wiener Neustadt

Besuchen Sie uns online und mobil www.herold.at!

Weitere Informationen zu unseren Produkten finden Sie unter:  
[http://mobile.herold.at](http://mobile.herold.at)  
[http://daten.herold.at](http://daten.herold.at)

Werden Sie Fan von HEROLD auf Facebook!

Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen:  
www.clearsense.at

> **[Welcome to Tupalo](http://www.tupalo.com)**
>
> Local business reviews and recommendations of Restaurants, Cafes, Shops, Salons, Plumbers and more at Tupalo

www.aboutmedia.at  
www.love.at  
www.reise-hero.at  
www.urlauburlaub.at

Diese E-Mail kann vertrauliche und/oder rechtlich geschützte  
Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder  
diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den  
Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie  
die unbefugte Weitergabe dieser Mail sind nicht gestattet.

This e-mail may contain confidential and/or privileged information. If  
you are not the intended recipient (or have received this e-mail in  
error) please notify the sender immediately and delete this e-mail. Any  
unauthorized copying, disclosure or distribution of the material in this  
e-mail is strictly forbidden.

---

<div class="post-metadata">

**Author:** ![Stephan\_Wolfauer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/85e7bf/32.png) [@Stephan\_Wolfauer](https://www.ruby-forum.com/u/Stephan_Wolfauer)\
**Post date:** [June 16, 2011, 11:45am UTC](https://www.ruby-forum.com/t/nginx-sticky-module-compile-error/208360/4 "2011-06-16T11:45:48Z")

</div>

Hello!

On Thu, Jun 16, 2011 at 10:33:19AM +0200, Dalibor J. wrote:

> Hi,
> 
> actually, not it is not. We have the same error in 1.0.4, as stated.

Please provide output of make for 1.0.4 if you think it isn’t.

Maxim D.

> > cc1: warnings being treated as errors
> 
> Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder  
> diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den  
> Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie  
> die unbefugte Weitergabe dieser Mail sind nicht gestattet.
> 
> This e-mail may contain confidential and/or privileged information. If  
> you are not the intended recipient (or have received this e-mail in  
> error) please notify the sender immediately and delete this e-mail. Any  
> unauthorized copying, disclosure or distribution of the material in this  
> e-mail is strictly forbidden.

---

<div class="post-metadata">

**Author:** ![Stephan\_Wolfauer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/85e7bf/32.png) [@Stephan\_Wolfauer](https://www.ruby-forum.com/u/Stephan_Wolfauer)\
**Post date:** [June 16, 2011, 12:01pm UTC](https://www.ruby-forum.com/t/nginx-sticky-module-compile-error/208360/5 "2011-06-16T12:01:53Z")

</div>

Hi,

sure, here it is:

gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter  
-Wunused-function -Wunused-variable -Wunused-value -Werror -g -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-rc2/ngx\_http\_sticky\_misc.o   
../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c  
In file included from  
../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:11:  
src/core/ngx\_sha1.h:18:17: error: sha.h: No such file or directory  
In file included from  
../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:11:  
src/core/ngx\_sha1.h:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or  
‘ **attribute** ’ before ‘ngx\_sha1\_t’  
../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c: In  
function ‘ngx\_http\_sticky\_misc\_md5’:  
../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:115:  
error: ‘MD5\_DIGEST\_LENGTH’ undeclared (first use in this function)  
../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:115:  
error: (Each undeclared identifier is reported only once  
../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:115:  
error: for each function it appears in.)  
cc1: warnings being treated as errors  
../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:115:  
warning: unused variable ‘hash’  
../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c: In  
function ‘ngx\_http\_sticky\_misc\_sha1’:  
../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:133:  
error: ‘ngx\_sha1\_t’ undeclared (first use in this function)  
../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:133:  
error: expected ‘;’ before ‘sha1’  
../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:134:  
error: ‘SHA\_DIGEST\_LENGTH’ undeclared (first use in this function)  
../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:142:  
warning: implicit declaration of function ‘SHA1\_Init’  
../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:142:  
error: ‘sha1’ undeclared (first use in this function)  
../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:143:  
warning: implicit declaration of function ‘SHA1\_Update’  
../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:144:  
warning: implicit declaration of function ‘SHA1\_Final’  
../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:134:  
warning: unused variable ‘hash’  
make[1]: \*\*\*  
[objs/addon/nginx-sticky-module-1.0-rc2/ngx\_http\_sticky\_misc.o] Error 1  
make[1]: Leaving directory `/root/src/nginx-1.0.4’  
make: \*\*\* [build] Error 2

Seems that the error is a different one, i wasn’t aware of that.  
However, compiling fails..

Cheers,  
DJ

> > > Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 6/16/2011 11:45 \>\>\>  
> > > Hello!

On Thu, Jun 16, 2011 at 10:33:19AM +0200, Dalibor J. wrote:

> Hi,
> 
> actually, not it is not. We have the same error in 1.0.4, as stated.

Please provide output of make for 1.0.4 if you think it isn’t.

Maxim D.

> > we have problems compiling the nginx-sticky module (downloaded  
> > from  
> > [Google Code Archive - Long-term storage for Google Code Project Hosting.](http://code.google.com/p/nginx-sticky-module/downloads/list)) in  
> > nginx  
> > version 1.0.3 and 1.0.4. Here is the output of the “make” command:

> > gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter  
> > -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I  
> > src/core -I src/event -I src/event/modules -I src/os/unix -I objs  
> >   
> > -o objs/src/core/ngx\_crypt.o   
> > src/core/ngx\_crypt.c  
> > cc1: warnings being treated as errors  
> > src/core/ngx\_crypt.c: In function \u2018ngx\_crypt\_apr1\u2019:  
> > src/core/ngx\_crypt.c:76: warning: pointer targets in passing  
> > argument  
> > 2  
> > of \u2018ngx\_m  
> > d5\_update\u2019 differ in signedness  
> > nginx mailing list  
> > Besuchen Sie uns online und mobil www.herold.at!  
> > [www.tupalo.com](http://www.tupalo.com)  
> > www.aboutmedia.at  
> > www.love.at  
> > www.reise-hero.at  
> > www.urlauburlaub.at
> 
> Diese E-Mail kann vertrauliche und/oder rechtlich geschützte  
> Informationen enthalten. Wenn Sie nicht der richtige Adressat sind  
> oder  
> diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort  
> den  
> Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren  
> sowie  
> die unbefugte Weitergabe dieser Mail sind nicht gestattet.
> 
> This e-mail may contain confidential and/or privileged information.  
> If  
> you are not the intended recipient (or have received this e-mail in  
> error) please notify the sender immediately and delete this e-mail.  
> Any  
> unauthorized copying, disclosure or distribution of the material in  
> this  
> e-mail is strictly forbidden.

> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://nginx.org/mailman/listinfo/nginx)

* * *

nginx mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> **[mailman.nginx.org archive](http://mailman.nginx.org/pipermail/)**

HEROLD Business Data GmbH  
Guntramsdorfer Straße 105  
A-2340 Mödling

FN 233171z  
Landesgericht Wiener Neustadt

Besuchen Sie uns online und mobil www.herold.at!

Weitere Informationen zu unseren Produkten finden Sie unter:  
[http://mobile.herold.at](http://mobile.herold.at)  
[http://daten.herold.at](http://daten.herold.at)

Werden Sie Fan von HEROLD auf Facebook!

Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen:  
www.clearsense.at

> **[Welcome to Tupalo](http://www.tupalo.com)**
>
> Local business reviews and recommendations of Restaurants, Cafes, Shops, Salons, Plumbers and more at Tupalo

www.aboutmedia.at  
www.love.at  
www.reise-hero.at  
www.urlauburlaub.at

Diese E-Mail kann vertrauliche und/oder rechtlich geschützte  
Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder  
diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den  
Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie  
die unbefugte Weitergabe dieser Mail sind nicht gestattet.

This e-mail may contain confidential and/or privileged information. If  
you are not the intended recipient (or have received this e-mail in  
error) please notify the sender immediately and delete this e-mail. Any  
unauthorized copying, disclosure or distribution of the material in this  
e-mail is strictly forbidden.

---

<div class="post-metadata">

**Author:** ![Stephan\_Wolfauer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/85e7bf/32.png) [@Stephan\_Wolfauer](https://www.ruby-forum.com/u/Stephan_Wolfauer)\
**Post date:** [June 16, 2011, 12:58pm UTC](https://www.ruby-forum.com/t/nginx-sticky-module-compile-error/208360/6 "2011-06-16T12:58:06Z")

</div>

Hi,

you are right!

checking for OpenSSL sha1 crypto library … not found

Let me try to install the correct libs and recompile.

To be continued..

DJ

> > > Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 6/16/2011 12:15 \>\>\>  
> > > Hello!

On Thu, Jun 16, 2011 at 12:01:26PM +0200, Dalibor J. wrote:

> In file included from  
> ../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:115:  
> ../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:133:  
> warning: implicit declaration of function ‘SHA1\_Final’  
> ../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:134:  
> warning: unused variable ‘hash’  
> make[1]: \*\*\*  
> [objs/addon/nginx-sticky-module-1.0-rc2/ngx\_http\_sticky\_misc.o] Error  
> 1  
> make[1]: Leaving directory `/root/src/nginx-1.0.4’  
> make: \*\*\* [build] Error 2
> 
> Seems that the error is a different one, i wasn’t aware of that.  
> However, compiling fails..

It seems that you don’t have any library with SHA1 functions  
required for sticky module. Configure script should write  
something like ‘sha1: not found’ (but it doesn’t fail as SHA1 is  
considered to be optional by nginx itself).

Easiest way to fix this is to install OpenSSL library (and  
headers).

Maxim D.

> > actually, not it is not. We have the same error in 1.0.4, as  
> > stated.  
> > Hello!
> > 
> > On Thu, Jun 16, 2011 at 09:56  
> > :15AM +0200, Stephan Wolfauer wrote:
> > 
> > > Hello,
> > > 
> > > we have problems compiling the nginx-sticky module (downloaded  
> > > from  
> > > [Google Code Archive - Long-term storage for Google Code Project Hosting.](http://code.google.com/p/nginx-sticky-module/downloads/list)) in  
> > > nginx  
> > > version 1.0.3 and 1.0.4. Here is the output of the “make”  
> > > command:
> 
> > > gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter  
> > > -Wunused-function -Wunused-variable -Wunused-value -Werror -g  
> > > -I  
> > > src/core -I src/event -I src/event/modules -I src/os/unix -I  
> > > objs  
> > > make[1]: \*\*\* [objs/src/core/ngx\_crypt.o] Error 1  
> > > [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> > 
> > www.aboutmedia.at  
> > www.love.at  
> > www.reise-hero.at  
> > www.urlauburlaub.at
> > 
> > Diese E-Mail kann vertrauliche und/oder rechtlich geschützte  
> > Informationen enthalten. Wenn Sie nicht der richtige Adressat sind  
> > oder  
> > diese E-Mail irrtümlich erhalten haben, informieren Sie bitte  
> > sofort  
> > den  
> > Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren  
> > sowie  
> > die unbefugte Weitergabe dieser Mail sind nicht gestattet.
> > 
> > This e-mail may contain confidential and/or privileged  
> > information.  
> > If  
> > you are not the intended recipient (or have received this e-mail  
> > in  
> > error) please notify the sender immediately and delete this  
> > e-mail.  
> > Any  
> > unauthorized copying, disclosure or distribution of the material  
> > in  
> > nginx mailing list  
> > Besuchen Sie uns online und mobil www.herold.at!  
> > [www.tupalo.com](http://www.tupalo.com)  
> > www.aboutmedia.at  
> > www.love.at  
> > www.reise-hero.at  
> > www.urlauburlaub.at
> 
> Diese E-Mail kann vertrauliche und/oder rechtlich geschützte  
> Informationen enthalten. Wenn Sie nicht der richtige Adressat sind  
> oder  
> diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort  
> den  
> Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren  
> sowie  
> die unbefugte Weitergabe dieser Mail sind nicht gestattet.
> 
> This e-mail may contain confidential and/or privileged information.  
> If  
> you are not the intended recipient (or have received this e-mail in  
> error) please notify the sender immediately and delete this e-mail.  
> Any  
> unauthorized copying, disclosure or dist  
> ribution of the material in  
> this  
> e-mail is strictly forbidden.

> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://nginx.org/mailman/listinfo/nginx)

* * *

nginx mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> **[mailman.nginx.org archive](http://mailman.nginx.org/pipermail/)**

HEROLD Business Data GmbH  
Guntramsdorfer Straße 105  
A-2340 Mödling

FN 233171z  
Landesgericht Wiener Neustadt

Besuchen Sie uns online und mobil www.herold.at!

Weitere Informationen zu unseren Produkten finden Sie unter:  
[http://mobile.herold.at](http://mobile.herold.at)  
[http://daten.herold.at](http://daten.herold.at)

Werden Sie Fan von HEROLD auf Facebook!

Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen:  
www.clearsense.at

> **[Welcome to Tupalo](http://www.tupalo.com)**
>
> Local business reviews and recommendations of Restaurants, Cafes, Shops, Salons, Plumbers and more at Tupalo

www.aboutmedia.at  
www.love.at  
www.reise-hero.at  
www.urlauburlaub.at

Diese E-Mail kann vertrauliche und/oder rechtlich geschützte  
Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder  
diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den  
Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie  
die unbefugte Weitergabe dieser Mail sind nicht gestattet.

This e-mail may contain confidential and/or privileged information. If  
you are not the intended recipient (or have received this e-mail in  
error) please notify the sender immediately and delete this e-mail. Any  
unauthorized copying, disclosure or distribution of the material in this  
e-mail is strictly forbidden.

---

<div class="post-metadata">

**Author:** ![Stephan\_Wolfauer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/85e7bf/32.png) [@Stephan\_Wolfauer](https://www.ruby-forum.com/u/Stephan_Wolfauer)\
**Post date:** [June 16, 2011, 12:16pm UTC](https://www.ruby-forum.com/t/nginx-sticky-module-compile-error/208360/7 "2011-06-16T12:16:05Z")

</div>

Hello!

On Thu, Jun 16, 2011 at 12:01:26PM +0200, Dalibor J. wrote:

> In file included from  
> ../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:115:  
> ../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:133:  
> warning: implicit declaration of function ‘SHA1\_Final’  
> ../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:134:  
> warning: unused variable ‘hash’  
> make[1]: \*\*\*  
> [objs/addon/nginx-sticky-module-1.0-rc2/ngx\_http\_sticky\_misc.o] Error 1  
> make[1]: Leaving directory `/root/src/nginx-1.0.4’  
> make: \*\*\* [build] Error 2
> 
> Seems that the error is a different one, i wasn’t aware of that.  
> However, compiling fails..

It seems that you don’t have any library with SHA1 functions  
required for sticky module. Configure script should write  
something like ‘sha1: not found’ (but it doesn’t fail as SHA1 is  
considered to be optional by nginx itself).

Easiest way to fix this is to install OpenSSL library (and  
headers).

Maxim D.

> > > > > Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 6/16/2011 9:59 \>\>\>  
> > > > > version 1.0.3 and 1.0.4. Here is the output of the “make” command:  
> > > > > src/core/ngx\_crypt.c:76: warning: pointer targets in passing
> > 
> > Informationen enthalten. Wenn Sie nicht der richtige Adressat sind  
> > error) please notify the sender immediately and delete this e-mail.
> 
> Landesgericht Wiener Neustadt  
> Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen:  
> Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie  
> die unbefugte Weitergabe dieser Mail sind nicht gestattet.
> 
> This e-mail may contain confidential and/or privileged information. If  
> you are not the intended recipient (or have received this e-mail in  
> error) please notify the sender immediately and delete this e-mail. Any  
> unauthorized copying, disclosure or distribution of the material in this  
> e-mail is strictly forbidden.

---

<div class="post-metadata">

**Author:** ![Stephan\_Wolfauer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/85e7bf/32.png) [@Stephan\_Wolfauer](https://www.ruby-forum.com/u/Stephan_Wolfauer)\
**Post date:** [June 16, 2011, 8:28pm UTC](https://www.ruby-forum.com/t/nginx-sticky-module-compile-error/208360/8 "2011-06-16T20:28:41Z")

</div>

2011/6/16 Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> > -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I  
> > **attribute** before ngx\_sha1\_t  
> > warning: unused variable hash  
> > ../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:142:  
> > make: \*\*\* [build] Error 2
> > 
> > Seems that the error is a different one, i wasn’t aware of that.  
> > However, compiling fails..
> 
> It seems that you don’t have any library with SHA1 functions  
> required for sticky module. Configure script should write  
> something like ‘sha1: not found’ (but it doesn’t fail as SHA1 is  
> considered to be optional by nginx itself).

Hi maxim,

I’m the developper of the sticky module. In order to ensure that sha1  
and md5 functions exist, I’ve set the following variables in config  
file:  
USE\_SHA1=YES  
USE\_MD5=YES

but it seems not to be enough to ensure they are there. As SHA1 and  
MD5 are considered to be optional by nginx itself, what can be done to  
stop the configure script and correct this bug ?

thx  
++ jerome

---

<div class="post-metadata">

**Author:** ![Stephan\_Wolfauer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/85e7bf/32.png) [@Stephan\_Wolfauer](https://www.ruby-forum.com/u/Stephan_Wolfauer)\
**Post date:** [June 16, 2011, 9:47pm UTC](https://www.ruby-forum.com/t/nginx-sticky-module-compile-error/208360/9 "2011-06-16T21:47:44Z")

</div>

Hello!

On Thu, Jun 16, 2011 at 08:28:09PM +0200, Jérôme Loyet wrote:

> > > gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter  
> > > src/core/ngx\_sha1.h:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or  
> > > ../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:115:  
> > > warning: implicit declaration of function ‘SHA1\_Init’  
> > > make[1]: Leaving directory `/root/src/nginx-1.0.4’  
> > > Hi maxim,
> 
> I’m the developper of the sticky module. In order to ensure that sha1  
> and md5 functions exist, I’ve set the following variables in config  
> file:  
> USE\_SHA1=YES  
> USE\_MD5=YES
> 
> but it seems not to be enough to ensure they are there. As SHA1 and  
> MD5 are considered to be optional by nginx itself, what can be done to  
> stop the configure script and correct this bug ?

I don’t really think this is a bug in your module, but rather  
limitation of nginx itself. It doesn’t allow you to specify  
whether USE\_\* means “required” or “optional”.

For USE\_MD5 (and other libraries) it means “required” (in older  
versions configure failed, in 1.0.1+ we fallback to internal  
implementation). For SHA1 it’s historically “optional”.

I believe solution would be to add internal SHA1 implementation,  
effectively making SHA1 “required” as well.

Maxim D.

---

<div class="post-metadata">

**Author:** ![Stephan\_Wolfauer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/85e7bf/32.png) [@Stephan\_Wolfauer](https://www.ruby-forum.com/u/Stephan_Wolfauer)\
**Post date:** [June 16, 2011, 1:21pm UTC](https://www.ruby-forum.com/t/nginx-sticky-module-compile-error/208360/10 "2011-06-16T13:21:00Z")

</div>

Hi,

yes, it’s working now. I’ve installed the openssl devel package. and

checking for OpenSSL sha1 crypto library

says “found”

make succeeds.

thanks for that great support!

Cheers,  
DJ

> > > “Dalibor J.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 6/16/2011 12:57 \>\>\>

Hi,

you are right!

checking for OpenSSL sha1 crypto library … not found

Let me try to install the correct libs and recompile.

To be continued..

DJ

> > > Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 6/16/2011 12:15 \>\>\>  
> > > Hello!

On Thu, Jun 16, 2011 at 12:01:26PM +0200, Dalibor J. wrote:

> In file included from  
> ../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:115:  
> ../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:133:  
> warning: implicit declaration of function ‘SHA1\_Final’  
> ../modules/nginx-sticky-module-1.0-rc2//ngx\_http\_sticky\_misc.c:134:  
> warning: unused variable ‘hash’  
> make[1]: \*\*\*  
> [objs/addon/nginx-sticky-module-1.0-rc2/ngx\_http\_sticky\_misc.o] Error 1  
> make[1]: Leaving directory `/root/src/nginx-1.0.4’  
> make: \*\*\* [build] Error 2
> 
> Seems that the error is a different one, i wasn’t aware of that.  
> However, compiling fails..

It seems that you don’t have any library with SHA1 functions  
required for sticky module. Configure script should write  
something like ‘sha1: not found’ (but it doesn’t fail as SHA1 is  
considered to be optional by nginx itself).

Easiest way to fix this is to install OpenSSL library (and  
headers).

Maxim D.

> > > > > Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 6/16/2011 9:59 \>\>\>  
> > > > > version 1.0.3 and 1.0.4. Here is the output of the “make” command:  
> > > > > src/core/ngx\_crypt.c:76: warning: pointer targets in passing
> > 
> > Informationen enthalten. Wenn Sie nicht der richtige Adressat sind  
> > error) please notify the sender immediately and delete this e-mail.
> 
> Landesgericht Wiener Neustadt  
> Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen:  
> Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie  
> die unbefugte Weitergabe dieser Mail sind nicht gestattet.
> 
> This e-mail may contain confidential and/or privileged information. If  
> you are not the intended recipient (or have received this e-mail in  
> error) please notify the sender immediately and delete this e-mail. Any  
> unauthorized copying, disclosure or distribution of the material in this  
> e-mail is strictly forbidden.

> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://nginx.org/mailman/listinfo/nginx)

* * *

nginx mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> **[mailman.nginx.org archive](http://mailman.nginx.org/pipermail/)**

HEROLD Business Data GmbH  
Guntramsdorfer Straße 105  
A-2340 Mödling

FN 233171z  
Landesgericht Wiener Neustadt

Besuchen Sie uns online und mobil auf www.herold.at!

Weitere Informationen zu unseren Produkten finden Sie unter:  
[http://mobile.herold.at](http://mobile.herold.at)  
[http://daten.herold.at](http://daten.herold.at)

Werden Sie Fan von HEROLD auf Facebook!

Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen:  
www.clearsense.at

> **[Welcome to Tupalo](http://www.tupalo.com)**
>
> Local business reviews and recommendations of Restaurants, Cafes, Shops, Salons, Plumbers and more at Tupalo

www.aboutmedia.at  
www.love.at  
www.reise-hero.at  
www.urlauburlaub.at

Diese E-Mail kann vertrauliche und/oder rechtlich geschützte  
Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder  
diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den  
Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie  
die unbefugte Weitergabe dieser Mail sind nicht gestattet.

This e-mail may contain confidential and/or privileged information. If  
you are not the intended recipient (or have received this e-mail in  
error) please notify the sender immediately and delete this e-mail. Any  
unauthorized copying, disclosure or distribution of the material in this  
e-mail is strictly forbidden.

Click here to report this email as spam.

---

<div class="post-metadata">

**Author:** ![Stephan\_Wolfauer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/85e7bf/32.png) [@Stephan\_Wolfauer](https://www.ruby-forum.com/u/Stephan_Wolfauer)\
**Post date:** [October 6, 2011, 6:39pm UTC](https://www.ruby-forum.com/t/nginx-sticky-module-compile-error/208360/11 "2011-10-06T18:39:30Z")

</div>

2011/10/6 ramindeja [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> Hi,

Hi,

> We are using NGINX as a load-balancer and we would like to learn more  
> about the MD5 hash function. We need to replicate this function in our  
> Java application.
> 
> We are using the sticky module that hashes the IP.

Are you talking of this module:  
[Google Code Archive - Long-term storage for Google Code Project Hosting.](http://code.google.com/p/nginx-sticky-module/) ?

> When we tried to hash  
> the same IP:PORT using MD5 in Java , we never got the same result. What  
> inputs should we use for the MD5 function.

If you are using nginx-sticky-module, you won’t be able to recreate  
the same MD5 easily because the module uses internal nginx data to  
create the hash.  
You can look in ngx\_http\_sticky\_module.c on line 146  
([http://code.google.com/p/nginx-sticky-module/source/browse/trunk/ngx\_http\_sticky\_module.c#146](http://code.google.com/p/nginx-sticky-module/source/browse/trunk/ngx_http_sticky_module.c#146)).  
You’ll find out that the md5 hash is made from the sockaddr internal  
structure which discribe each backend server and I’m not sure you’ll  
be able to reconstruct the very same structure on your java side.

what is your need ? there is maybe another way to achieve your goal.

++ jerome

---

<div class="post-metadata">

**Author:** ![Stephan\_Wolfauer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/85e7bf/32.png) [@Stephan\_Wolfauer](https://www.ruby-forum.com/u/Stephan_Wolfauer)\
**Post date:** [October 6, 2011, 6:31pm UTC](https://www.ruby-forum.com/t/nginx-sticky-module-compile-error/208360/12 "2011-10-06T18:31:28Z")

</div>

Hi,

We are using NGINX as a load-balancer and we would like to learn more  
about the MD5 hash function. We need to replicate this function in our  
Java application.

We are using the sticky module that hashes the IP. When we tried to hash  
the same IP:PORT using MD5 in Java , we never got the same result. What  
inputs should we use for the MD5 function.

Thanks in advance,  
RaminDeja

Posted at Nginx Forum:

> **[Enquiry regarding Sticky Module's hash functions](https://forum.nginx.org/read.php?2,207455,216324#msg-216324)**
>
> Hello, we have problems compiling the nginx-sticky module (downloaded from http://code.google.com/p/nginx-sticky-module/downloads/list) in nginx version 1.0.3 and 1.0.4. Here is the output of the "make" command: gcc -c -pipe -O -W -Wall...

---

<div class="post-metadata">

**Author:** ![Stephan\_Wolfauer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/85e7bf/32.png) [@Stephan\_Wolfauer](https://www.ruby-forum.com/u/Stephan_Wolfauer)\
**Post date:** [October 6, 2011, 10:38pm UTC](https://www.ruby-forum.com/t/nginx-sticky-module-compile-error/208360/13 "2011-10-06T22:38:15Z")

</div>

Merci Jérôme, we resolved the solution by writing the following class.  
It’s not super but does the job:

import java.io.UnsupportedEncodingException;  
import java.security.MessageDigest;  
import java.security.NoSuchAlgorithmException;

public class IPEncryptor  
{

```
public static String MD5(String ip)
throws NoSuchAlgorithmException, UnsupportedEncodingException
{
    MessageDigest md;
    md = MessageDigest.getInstance("MD5");

    byte[] md5hash = new byte[32];
    byte[] ipParts = parseIP(ip);

    md.update(ipParts, 0, ipParts.length);

    md5hash = md.digest();
    return convertToHex(md5hash);
}

private static String convertToHex(byte[] data)
{
    StringBuffer buf = new StringBuffer();

    for (int i = 0; i < data.length; i++)
    {
        int halfbyte = (data[i] >>> 4) & 0x0F;
        int two_halfs = 0;
        do
        {
            if ((0 <= halfbyte) && (halfbyte <= 9))
                buf.append((char) ('0' + halfbyte));
            else
                buf.append((char) ('a' + (halfbyte - 10)));
            halfbyte = data[i] & 0x0F;
        } while(two_halfs++ < 1);
    }

    return buf.toString();
}

// Parses the input
private static byte[] parseIP(String address)
{
  String[] addressParts = address.split(":");

  String[] ipParts = addressParts[0].split("\\.");
  int portHiByte = Integer.parseInt(addressParts[1]) / 256;
  int portLoByte = Integer.parseInt(addressParts[1]) % 256;

  int i = 0;
  int j = 0;

  byte[] ip = new byte[16];
  ip[i++] = 0;
  ip[i++] = 2;
  ip[i++] = (byte)portHiByte;
  ip[i++] = (byte)portLoByte;

  for (j = 0; j < ipParts.length; j++, i++)
  {
    ip[i] = (byte)Integer.parseInt(ipParts[j]);
  }

  // pad the rest with ZEROs
  for (; i < ip.length; ++i)
  {
    ip[i] = 0;
  }

  return ip;
}

```

}

Posted at Nginx Forum:

> **[Re: Enquiry regarding Sticky Module's hash functions](https://forum.nginx.org/read.php?2,207455,216339#msg-216339)**
>
> Hello, we have problems compiling the nginx-sticky module (downloaded from http://code.google.com/p/nginx-sticky-module/downloads/list) in nginx version 1.0.3 and 1.0.4. Here is the output of the "make" command: gcc -c -pipe -O -W -Wall...
