/ Zope / Apsis / Pound Mailing List / Archive / 2003 / 2003-11 / Empty documents with directory indexing by thttpd behind Pound

[ << ] [ >> ]

[ bad URL / "Claus Rosenberger" ... ] [ Weird Embed Object Problem / "Joel ... ]

Empty documents with directory indexing by thttpd behind Pound
"Danny Cautaert" <danny(at)limehouse.org>
2003-11-25 19:31:54 [ FULL ]
Hello,

I have a very strange problem with thttpd and Pound.
I am using Pound 1.5 in a FreeBSD 4.7 jail. Pound is chrooted to
/var/pound within the jail and hands over requests to Zope 2.6.2 or
thttpd/2.24 running in the same jail depending on the URL. 

Everything worked fine for both until I started publishing directories without
index.html under thttpd (so thttpd makes a page with the contents of the
directory on the fly). This works fine when addressing thttpd directly but via
Pound I get most of the time an empty page.  Once in while (completely random)
an index gets thru but most of the time the page is empty.

Here is an example of what w3m thinks about the received page:

Information about current page

Title
Current URL       http://zeemeeuw.org/
Document Type     text/html
Last Modified     Sun, 23 Nov 2003 18:00:48 GMT
Number of lines   0
Transferred bytes 0
 
Header information

HTTP/1.0 200 OK
Server: thttpd/2.24 26oct2003
Content-Type: text/html
Date: Tue, 25 Nov 2003 18:18:59 GMT
Last-Modified: Sun, 23 Nov 2003 18:00:48 GMT
Accept-Ranges: bytes
Connection: close

Does anyone have an idea what could be the reason for this behaviour?

TIA,

Danny.

Re: Empty documents with directory indexing by thttpd behind Pound
Robert Segall <roseg(at)apsis.ch>
2003-11-25 22:41:08 [ FULL ]
We'll need much more information to investigate this. All of the following 
would be useful:

- what does the Pound log show for the request
- what does the thttpd log show for the request
- what transpires between the two (use something like tcpwatch between them to 
see the actual request/response).

Let us have this info and we'll look into it.[...]

Re: Empty documents with directory indexing by thttpd behind Pound
Robert Segall <roseg(at)apsis.ch>
2003-11-27 08:36:57 [ FULL ]
On Wednesday 26 November 2003 22:04, Danny Cautaert wrote:[...]

OK - but try using LogLevel 3 for more info.
[...]

Looks good, but surely is not the same request (they are for different 
objects). Please check again.
[...]

If your thttpd runs on 8088, have tcpwatch proxy 9088 to 8088 and Pound talk 
to back-end 9088. This will give you a clear picture of the transactions.

Additional question: are you completely sure that any and all the requests you 
think should go to thttpd do indeed go there? Could it be that the requests 
get distributed between you Zope server and thttpd? Such a scenario would 
explain the random appearance of the pages.

Finally - please keep this on the list.[...]

Re: Empty documents with directory indexing by thttpd behind Pound
(null)
2003-11-27 14:10:41 [ FULL ]
On Thu, Nov 27, 2003 at 08:36:57AM +0100, Robert Segall wrote:[...]

Nov 27 13:45:29 limehouse pound: zeemeeuw.org 213.224.116.231 - -
[27/Nov/2003:13:45:29 +0100] "GET / HTTP/1.0" 200 - "" "w3m/0.3"
[...]

65.214.160.132 - - [27/Nov/2003:13:45:29 +0100] "GET /zeemeeuw.org/
HTTP/1.0" 200 50000 "" "w3m/0.3"
[...]

Which boils down to the same thing I did. What I don't understand from
the tcpwatch help is the httpmode and in particular the -p flag.
Aparently it only expects a listen_port and no dest_port, so i used the
tcpmode with the -L flag instead, which as you saw, didn't work. Having slept a
night over it, I now understand why it doesnt work. It is not allowed to
do raw socket calls in a jail. And my only access to the freebsd box is
thru this jail (its a shared colo). So if you really need this info, I
need to setup a freebsd system locally, which may take some time.
[...]

Yes, I have been thinking of that before, and already verified that. For
completeness, here is my complete pound.cfg

ListenHTTP 65.214.160.132,80
User nobody
Group nogroup
LogLevel 3
Client 15
RootJail /var/pound

UrlGroup ".*"
HeadRequire Host "limehouse.org"                                               
                                                BackEnd 65.214.160.132,8088,1
EndGroup                                                                       
                                                
UrlGroup ".*"
HeadRequire Host "www.limehouse.org"                                           
                                                BackEnd 65.214.160.132,8088,1
EndGroup                                                                       
                                                
UrlGroup ".*"                                                                  
                                                HeadRequire Host "zeemeeuw.org"
BackEnd 65.214.160.132,8088,1                                                  
                                                EndGroup
                                                                               
                                                UrlGroup ".*"
HeadRequire Host "www.zeemeeuw.org"                                            
                                                BackEnd 65.214.160.132,8088,1
EndGroup                                                                       
                                                
UrlGroup ".*"                                                                  
                                                HeadRequire Host
"pub.limehouse.org"
BackEnd 65.214.160.132,8088,1                                                  
                                                EndGroup

UrlGroup ".*"
BackEnd 65.214.160.132,8080,1
EndGroup

Re: Empty documents with directory indexing by thttpd behind Pound
Felix Buenemann <atmosfear(at)users.sourceforge.net>
2003-11-27 16:10:25 [ FULL ]
On Thursday 27 November 2003 08:36, Robert Segall wrote:[...]
Shouldn't it be GET / instead of GET /zeemeeuw.org/ ?
It seems that pound has added the requested hostname to the url.[...]

Re: Empty documents with directory indexing by thttpd behind Pound
"Danny Cautaert" <danny(at)limehouse.org>
2003-11-27 16:18:13 [ FULL ]
On Thu, Nov 27, 2003 at 04:10:25PM +0100, Felix Buenemann wrote:[...]

Its the vhost feature of thttpd thats doing this. I also tried running
thttpd without the vhost feature and it gives the same problem.

Re: Empty documents with directory indexing by thttpd behind Pound
Robert Segall <roseg(at)apsis.ch>
2003-11-27 19:06:32 [ FULL ]
On Thursday 27 November 2003 14:10, null wrote:[...]

No need. A simple tcpwatch -L 9088:8088 will do fine, and no raw sockets are 
involved.
[...]

I think you'll find this more readable:

ListenHTTP 65.214.160.132,80
User nobody
Group nogroup
LogLevel 3
Client 15
RootJail /var/pound

UrlGroup ".*"
HeadRequire Host ".*(zeemeeuw|limehouse).org.*"
BackEnd 65.214.160.132,8088,1
EndGroup

UrlGroup ".*"
BackEnd 65.214.160.132,8080,1
EndGroup
[...]

Re: Empty documents with directory indexing by thttpd behind Pound
"Danny Cautaert" <danny(at)limehouse.org>
2003-11-27 19:36:54 [ FULL ]
On Thu, Nov 27, 2003 at 07:06:32PM +0100, Robert Segall wrote:[...]

If you insist, I do it again using those ports:

# sockstat -4 | egrep '(pound|thttpd)'
nobody   pound    18815    6 tcp4   65.214.160.132:80     *:*
nobody   pound    18814    6 tcp4   65.214.160.132:80     *:*
nobody   thttpd   29677    5 tcp4   65.214.160.132:8088   *:*
nobody   pound    13878    6 tcp4   65.214.160.132:443    *:*
nobody   pound    13877    6 tcp4   65.214.160.132:443    *:*
# grep Backend pound.cfg
# grep BackEnd pound.cfg
BackEnd 65.214.160.132,9088,1
BackEnd 65.214.160.132,8080,1
# ~/tcpwatch/tcpwatch.py -s -L 9088:8088
Forwarding :9088 -> :8088
[00:00.000 - client 65.214.160.132:4384 forwarded to :8088]
Traceback (most recent call last):
  File "/usr/local/lib/python2.2/asyncore.py", line 100, in poll
    obj.handle_read_event()
  File "/usr/local/lib/python2.2/asyncore.py", line 391, in handle_read_event
    self.handle_accept()
  File "/home/danny/tcpwatch/tcpwatch.py", line 251, in handle_accept
    ep2.connect(self._dest)
  File "/usr/local/lib/python2.2/asyncore.py", line 324, in connect
    raise socket.error, err
error: 61
==>GET / HTTP/1.0
==>User-Agent: w3m/0.3
==>Accept: text/*, image/*, application/*
==>Accept-Encoding: gzip, compress, bzip, bzip2, deflate
==>Accept-Language: en; q=1.0
==>Host: zeemeeuw.org
==>X-Forwarded-For: 213.224.116.231
==>
[00:00.061 - server connected]
[00:00.062 - server closed]
[...]

Indeed, nice tip, thanks.

Danny.

Re: Empty documents with directory indexing by thttpd behind Pound
Robert Segall <roseg(at)apsis.ch>
2003-11-28 10:58:35 [ FULL ]
On Thursday 27 November 2003 19:36, Danny Cautaert wrote:[...]

I don't insist - I was trying to help you (BTW our installations work fine).
[...]

You seem to have a problem with connecting to thttpd - could it be you have 
some firewall rules that disallow/redirect the access?
[...]
[...]

MailBoxer