yaoweibin / nginx_ajp_module

support AJP protocol proxy with Nginx
http://github.com/yaoweibin/nginx_ajp_module
246 stars 60 forks source link

Problems building nginx + nginx_ajp_module in CentOS 6.4 #14

Closed ananiasfilho closed 10 years ago

ananiasfilho commented 11 years ago

Hello, im trying build nginx with nginx_ajp_module but its runs no good.

My system: CentOS 6.4 Final (64bits) Kernel: 2.6.32-358.2.1.el6.x86_64 gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) GNU Make 3.81 SSL Packages: openssl-devel-1.0.0-27.el6_4.2.x86_64 and openssl-1.0.0-27.el6_4.2.x86_64

Download module and apply patch /usr/src/nginx/nginx-1.2.0# patch -p1 < /usr/src/nginx/nginx_ajp_module-master/ajp.patch

Configure line: ./configure --add-module=/usr/src/nginx/nginx_ajp_module-master --sbin-path=/usr/local/sbin --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --with-http_stub_status_module --with-http_ssl_module

./configure output: ... configuring additional modules adding module in /usr/src/nginx/nginx_ajp_module-master checking for nginx_ajp_module ... found

Configuration summary

All seems good after run configure command. When i try run make, its show a error.

Output message: 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 /usr/src/nginx/nginx_ajp_module-master/modules -I /usr/src/nginx/nginx_ajp_module-master -I objs -I src/http -I src/http/modules -I src/mail \ -o objs/addon/nginx_ajp_module-master/ngx_http_ajp.o \ /usr/src/nginx/nginx_ajp_module-master/ngx_http_ajp.c /usr/src/nginx/nginx_ajp_module-master/ngx_http_ajp.c: In function ‘ajp_marshal_into_msgb’: /usr/src/nginx/nginx_ajp_module-master/ngx_http_ajp.c:535: error: ‘ngx_http_connection_t’ has no member named ‘ssl’ make[1]: * [objs/addon/nginx_ajp_module-master/ngx_http_ajp.o] Error 1 make[1]: Leaving directory `/usr/src/nginx/nginx-1.2.0' make: * [build] Error 2

Any idea?

yoursoft commented 11 years ago

My method:

yum -y install gcc automake openssl-devel autoconf readline-devel yum install patch yum install pcre-devel

download nginx 1.4 src (http://nginx.org/download/nginx-1.4.2.tar.gz) decompress

patch -p1 < pathto/nginx_ajp_module-master/ajp.patch ./configure --without-http_autoindex_module --without-http_browser_module --without-http_fastcgi_module --without-http_geo_module --without-http_empty_gif_module --without-http_map_module --without-http_memcached_module --without-http_ssi_module --without-http_userid_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --without-http_split_clients_module --without-http_uwsgi_module --without-http_scgi_module --without-http_referer_module --without-http_upstream_ip_hash_module --add-module=pathto/nginx_ajp_module-master/ make make install

ananiasfilho commented 11 years ago

Hello, thanks for the reply. All seems build good and runnings ok. So, AJP with ssl is not running. I do a jsp script to check if request is secure (SSL) and its return FALSE JSP script: request.secure: <%=request.isSecure()%>

the result is: request.secure: false

is it need remove "#" from ngx_http_ajp.c?

if (NGX_HTTP_SSL)

is_ssl = r->http_connection->ssl;

endif

i try remove # and build but more errors:

/usr/src/nginx/nginx_ajp_module-master/ngx_http_ajp.c: In function ‘ajp_marshal_into_msgb’: /usr/src/nginx/nginx_ajp_module-master/ngx_http_ajp.c:536: error: ‘endif’ undeclared (first use in this function) /usr/src/nginx/nginx_ajp_module-master/ngx_http_ajp.c:536: error: (Each undeclared identifier is reported only once /usr/src/nginx/nginx_ajp_module-master/ngx_http_ajp.c:536: error: for each function it appears in.) /usr/src/nginx/nginx_ajp_module-master/ngx_http_ajp.c:545: error: expected ‘;’ before ‘{’ token cc1: warnings being treated as errors /usr/src/nginx/nginx_ajp_module-master/ngx_http_ajp.c:377: error: unused variable ‘port_str’ make[1]: *\ [objs/addon/nginx_ajp_module-master/ngx_http_ajp.o] Error 1 make[1]: Leaving directory `/usr/src/nginx/nginx-1.4.2'

Need do changes yet?

again, thanks for the help!

xaviershay commented 10 years ago

Did you ever solve the ‘ngx_http_connection_t’ has no member named ‘ssl’ issue? I'm seeing it, not using ajp module though.

yaoweibin commented 10 years ago

It should be fixed in this patch (https://github.com/yaoweibin/nginx_ajp_module/commit/a0be7edf44a54547356545abbf7cb94278df6e78), could test it?

ananiasfilho commented 10 years ago

Hello, i have re-build system today and same error

download master zip file from github

unzip file to /usr/nginx/nginx_ajp_module-master

apply patch

_patch -p1 < /usr/src/nginx/nginx_ajpmodule-master/ajp.patch configure

_./configure --add-module=/usr/src/nginx/nginx_ajp_module-master --sbin-path=/usr/local/sbin --with-http_ssl_module --conf-path=/etc/nginx/nginx.conf --without-http_geo_module --without-http_scgi_module --without-http_fastcgi_module --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --with-http_stub_statusmodule --add-module=/usr/src/nginx/chunkin-nginx-module-0.23

make

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 /usr/src/nginx/nginx_ajp_module-master/modules -I /usr/src/nginx/nginx_ajp_module-master -I objs -I src/http -I src/http/modules -I src/mail \

-o objs/addon/nginx_ajp_module-master/ngx_http_ajp.o \

/usr/src/nginx/nginx_ajp_module-master/ngx_http_ajp.c

/usr/src/nginx/nginx_ajp_module-master/ngx_http_ajp.c: In function ‘ajp_marshal_into_msgb’:

/usr/src/nginx/nginx_ajp_module-master/ngx_http_ajp.c:392: error: ‘ngx_http_connection_t’ has no member named ‘ssl’

make[1]: *\ [objs/addon/nginx_ajp_module-master/ngx_http_ajp.o] Error 1

make[1]: Leaving directory `/usr/src/nginx/nginx-1.2.0'

make: *\ [build] Error 2

Ananias Filho - kram3r

On Sat, Jan 11, 2014 at 9:19 AM, Weibin Yao(姚伟斌) notifications@github.comwrote:

It should be fixed in this patch (a0be7edhttps://github.com/yaoweibin/nginx_ajp_module/commit/a0be7edf44a54547356545abbf7cb94278df6e78), could test it?

— Reply to this email directly or view it on GitHubhttps://github.com/yaoweibin/nginx_ajp_module/issues/14#issuecomment-32093238 .

yaoweibin commented 10 years ago

Try the latest master revision.

higkoo commented 10 years ago

I also meet this issue in verstion 0.3.0: nginx_ajp_module-0.3.0/ngx_http_ajp.c:391: error: 'ngx_http_connection_t' has no member named 'ssl' make[1]: *\ [objs/addon/nginx_ajp_module-0.3.0/ngx_http_ajp.o] Error 1 with tengine-1.5.2.