Re: "server_port" header is always "0" - SOLVED
Re: "server_port" header is always "0" - SOLVED
- Subject: Re: "server_port" header is always "0" - SOLVED
- From: James Brook <email@hidden>
- Date: Wed, 16 Jan 2008 18:34:39 +0100
This did turn out to be a problem with the Apache 2.2 adaptor (both
the Apple and the Wonder one). In case anyone needs it, I have
attached a patch for the Apple 2.2 adaptor that seems to fix the
problem. I am not sure how one goes about submitting a patch to Apple.
--- /Users/jbrook/Desktop/mod_WebObjects.c.original 2008-01-16 18:17:22.000000000 +0100
+++ Apache2.2/mod_WebObjects.c 2008-01-16 18:23:02.000000000 +0100
@@ -309,6 +309,7 @@
apr_table_t *proc_env = r->subprocess_env;
char *port;
+ char *server_portstr;
const char *rem_logname;
/*
@@ -373,10 +374,10 @@
req_addHeader(req, "SERVER_SOFTWARE", ap_get_server_version(), 0);
req_addHeader(req, "SERVER_NAME", s->server_hostname, 0);
- port = (char *)WOMALLOC(32);
- if (port) {
- apr_snprintf(port, sizeof(port), "%u", s->port);
- req_addHeader(req, "SERVER_PORT", port, STR_FREEVALUE);
+ server_portstr = (char *)WOMALLOC(32);
+ if (server_portstr) {
+ apr_snprintf(server_portstr, sizeof(server_portstr), "%d", ap_get_server_port(r));
+ req_addHeader(req, "SERVER_PORT", server_portstr, STR_FREEVALUE);
}
req_addHeader(req, "REMOTE_HOST",
To get it to compile as a fat binary (some Macs run Apache under a 64
bit architecture), I added the following to make.config:
LDFLAGS = -arch x86_64 -arch ppc64 -arch ppc -arch i386
The same code change works for the Wonder adaptor. I will submit a
patch for that to the developers as soon as I have time and have
worked out how to compile it for x86_64.
--
James
On 15 Jan 2008, at 10:24, James Brook wrote:
Unfortunately not. I am pretty sure that the adaptor normally sets
this header based on an Apache environment variable (or in the past
the x-webobjects-server-port header was set). Everyone on the team
using Apache 2.2 and the WO 5.4 adaptor gets a value of zero. Those
who haven't upgraded get the correct port.
I really need the port to find out whether or not requests are SSL
so that I can redirect appropriately. The plan is for a hardware SSL
accelerator/offloader to pass offloaded SSL requests on to port 81.
I will try the Wonder adaptor and experiment with Apache variables.
--
James
On 15 Jan 2008, at 03:01, Chuck Hill wrote:
Check the other headers, it might be there under a new name.
Chuck
On Jan 14, 2008, at 10:33 AM, James Brook wrote:
No matter what I do, my application always reports that the value
of the "server_port" header is "0". I am running WebObjects 5.3 on
Leopard, with the latest version of Wonder and using Apache 2.2
and the adaptor that ships with WO 5.4. Has anyone run into this?
I suspect an adaptor problem. When I debug createRequest I see
that the "0" value is already set for the header there. Are people
using the 5.4 adaptor with Apache 2.2 and WO 5.3? Should I switch
to the Wonder 2.2 adaptor or Apache 1.3?
I would appreciate any help.
--
James
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden