Confused - obj.conf

I am attempting to configure Web Server 6.1 to support an application that uses HTTP 1.0 and expects a content-length header in the response. The response is generated from a php script (index.php). The php script does not generate the header itself.

Here is my modified obj.conf:

<Object name="default">

AuthTrans fn="match-browser" browser="*MSIE*" ssl-unclean-shutdown="true"

AuthTrans fn="match-browser" browser="*" http-downgrade="1.0"

NameTrans fn="ntrans-j2ee" name="j2ee"

NameTrans fn=pfx2dir from=/mc-icons dir="/opt/SUNWwbsvr/ns-icons" name="es-internal"

NameTrans fn=document-root root="$docroot"

PathCheck fn=unix-uri-clean

PathCheck fn="check-acl" acl="default"

PathCheck fn=find-pathinfo

PathCheck fn=find-index index-names="index.php"

ObjectType fn=type-by-extension

ObjectType fn=force-type type=text/plain

Service fn="match-browser" browser="*" http-downgrade="1.0" UseOutputStreamSize="8192"

Service fn="php5_execute" type="magnus-internal/x-httpd-php"

Service method=(GET|HEAD) type=magnus-internal/imagemap fn=imagemap

Service method=(GET|HEAD) type=magnus-internal/directory fn=index-common

Service method=(GET|HEAD|POST) type=*~magnus-internal/* fn=send-file

Service method=TRACE fn=service-trace

Error fn="error-j2ee"

#AddLog fn=flex-log name="access"

AddLog fn=flex-log name="extended"

</Object>

<Object name="j2ee">

Service fn="service-j2ee" method="*"

</Object>

<Object name="cgi">

ObjectType fn=force-type type=magnus-internal/cgi

Service fn=send-cgi user="$user" group="$group" chroot="$chroot" dir="$dir" nice="$nice"

</Object>

<Object name="es-internal">

PathCheck fn="check-acl" acl="es-internal"

</Object>

<Object name="send-compressed">

PathCheck fn="find-compressed"

</Object>

<Object name="compress-on-demand">

Output fn="insert-filter" filter="http-compression"

</Object>

What is confusing is:

1. Why do I need the http-downgrade=1.0 twice - once in AuthTrans and once in Service?

2. How come this works at all since the server should stop at the first Service entry, i.e. the match-match browser one and not call the PHP.

3. Why does this only work for GET and not for POST ?

Any help would be greatly appreciated.

[2494 byte] By [Badvok66] at [2007-11-26 11:12:35]
# 1

Can you let us know 1. why you think that you need both an AuthTrans and a Service directive, 2. why you say it "works" for GET but not POST, and 3. what "works" means in this case?

The server stops executing Service directives when a Service directive indicates that it processed the request. (Specifically, the server stops executing Service directives when a Service SAF returns REQ_PROCEED.) By default, match-browser will indicate that it didn't process the request, so the server will continue on to the next Service directive.

elving at 2007-7-7 3:27:09 > top of Java-index,Web & Directory Servers,Web Servers...
# 2

Thanks for the reply elving.

1. Without the AuthTrans entry I get an error from the server on the line that sets UseOutputStreamSize saying that the variable can not be set.

2 & 3: By 'Works' I mean the response has a content-length in the header rather than using chunked encoding.

Badvok66 at 2007-7-7 3:27:09 > top of Java-index,Web & Directory Servers,Web Servers...
# 3

You don't see the UseOutputStreamSize syntax error when you have the AuthTrans directive because only the first match-browser directive to match the browser will actually be executed. I think you should remove your Service fn="match-browser" directive altogether. Instead, you could use the following:<Object name="default">

AuthTrans fn="match-browser" browser="*" http-downgrade="1.0"

...

Service fn="php5_execute" type="magnus-internal/x-httpd-php" UseOutputStreamSize="8192"

...

</Object>Neither UseOutputStreamSize nor http-downgrade are specific to GET. Both work with POST. If you don't get a Content-length: header on POST responses, it may be because the content is more than 8192 bytes in length. Try changing UseOutputStreamSize="8192" to UseOutputStreamSize="65536".

elving at 2007-7-7 3:27:09 > top of Java-index,Web & Directory Servers,Web Servers...
# 4

Thanks again for your reply elving.

That is what is so confusing, unless I have both I do not get a content-length header in any response.

The reply is only 52 bytes, it is a simple acknowlegement.

Lastly, I can not specify any of the parameters on the php5_execute line because the server attempts to pass these to php5_execute function, which does not recognise them, rather than using them itself.

Badvok66 at 2007-7-7 3:27:09 > top of Java-index,Web & Directory Servers,Web Servers...