Apache and virtual host

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Apache and virtual host

Marco D'Ambros
Hi all!

I have a problem in configuring seaside and apache.
I have a domain name, lets say www.example.org, which points to a  
machine (lets say machine.my.org) in which I have my apache server  
running.

With an html web site, stored on the hard disk, what I would do is to  
configure apache like this:

<VirtualHost *:80>
ServerName www.example.org
DocumentRoot /var/www/example
</VirtualHost>

and like this, if I go to www.example.org I will see the web site  
located in my server under /var/www/example, while on the browser I  
will see the url www.example.org and NOT machine.my.org

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
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Apache and virtual host

Ramon Leon-5
> 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

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Apache and virtual host

Marco D'Ambros
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?

thanks again
Cheers
Marco


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Apache and virtual host

Diogenes Moreira
Hi marco:

403 Error is a Authorization Error. You are trying access to protected resourses or apache's user don't have permission to read those resources.
The ramon server configuration is ok. If you copied this configuration, the problem must be an other stuff.

If you can, Please send me you apache configuration, I'll take a look and the I'm been sending some advice.

Please, don't send that file to the list...I hate when some one do this,

Regard.

On Thu, Feb 21, 2008 at 7:23 AM, Marco D'Ambros <[hidden email]> 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?

thanks again
Cheers
Marco


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Apache and virtual host

NorbertHartl
In reply to this post by Marco D'Ambros

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

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Apache and virtual host

Rajeev Lochan
Hi,
I had similar problem. I had not succeeded in Serving Static files. I followed some instructions on this blog
http://open-sourcerer.blogspot.com/

you need to replicate your FileLibrary (s) into hard-disk of Server by creating /seaside/files/SULibrary/ 
/seaside/files/WAStandardFilesLibrary   etc in your DocumentRoot (/var/www/example)

When static files/logos/icons/CSS/Js are uploaded to Linux Server from a Windows system, the folders and files do not have a Read-permission for Browsers to serve them. If you change them, I guess your problem would be solved.

Safari browser is also helpful in testing. Check out Activity Window in it, it shows up all the files that have been loaded and you can see 403 error, if a file is not found on disk.


HTH,
Rajeev

On Sat, Feb 23, 2008 at 2:44 PM, Norbert Hartl <[hidden email]> wrote:

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

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



--
Rajeev Lochan

Co-founder, AR-CAD.com

http://www.ar-cad.com
+91 9243468076 (Bangalore)
080 65355873
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside