[Seaside] Apache and virtual host

Norbert Hartl norbert at hartl.name
Sat Feb 23 09:14:36 UTC 2008


On Thu, 2008-02-21 at 10:23 +0100, Marco D'Ambros wrote:
> On Feb 21, 2008, at 1:30 AM, Ramon Leon wrote:
> 
> >> Hi all!
> >>
> >> The question is: how do I do the same with seaside?
> >> If I use the rewrite module of apache, with this configuration:
> >>
> >> <VirtualHost *:80>
> >> ServerName www.example.org
> >> RewriteEngine On
> >> RewriteRule ^/(.*)$
> >> http://localhost:8008/seaside/go/example/$1 [P,L] </VirtualHost>
> >>
> >> I will be redirected to the correct seaside web site, but in
> >> the browser I will see the url machine.my.org:8008/seaside/go/ 
> >> example/
> >>
> >> Many thanks and cheers
> >> Marco D'Ambros
> >
> > Here's a working config, should be easily adaptable.
> >
> > <VirtualHost *:80>
> >    ServerName linuxweb1
> >    DocumentRoot /var/www
> >    RewriteEngine On
> >    ProxyRequests Off
> >    ProxyPreserveHost On
> >    UseCanonicalName Off
> >
> >    # http compression
> >    DeflateCompressionLevel 5
> >    SetOutputFilter DEFLATE
> >    AddOutputFilterByType DEFLATE text/html text/plain text/xml
> > application/xml application/xhtml+xml text/javascript text/css
> >    BrowserMatch ^Mozilla/4 gzip-only-text/html
> >    BrowserMatch ^Mozilla/4.0[678] no-gzip
> >    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
> >
> >    #proxy to seaside if file not found
> >    RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
> >    RewriteRule ^/(.*)$ http://localhost:8080/$1 [P,L]
> > </VirtualHost>
> >
> > Ramon Leon
> > http://onsmalltalk.com
> 
> 
> Thank you very much for your answer. Unfortunately I get a 403  
> (Forbidden error) on the browser, and this is the apache log line:
> 
> client denied by server configuration: proxy:http://localhost:8018/seaside/go/Churrasco/favicon.ico 
> , referer: http://churrasco.inf.unisi.ch/
> 
> Any idea?
> 
It seems that your page might have been loaded ok. But browsers always
try to request an icon for the browser to display beside the link. 
Unfortunately if you have a page with five elements and one results in
a 403 the page might display the 403. That is sad because it appears
on the favicon.ico which you don't really need.
Does your configuration differ from ramons? If you have changed the
RewriteRule line to

RewriteRule ^/(.*)$ http://localhost:8018/seaside/go/Churrasco/$1 [P,L]

then it is clear. The browse requests 

http://churrasco.inf.unisi.ch/favicon.ico

But there is no file on the disk so apache redirects it to your
application. I guess further you have WAAuthConfiguration added to
your application. That would be the reason for the 403. Even if
you've got a session already which is authenticated the request
for the favicon.ico wouldn't contain the session parameters so
it will be asked for authentication again. An easy fix would be
to create a file favicon.ico at the document root of your apache.

hope this helps,

Norbert



More information about the seaside mailing list