You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@roller.apache.org by ries van Twisk <rv...@dds.nl> on 2007/12/03 04:14:07 UTC

tomcat6/roller behind a apache2 proxy

Hey All,

I have roller running at http://www.domain.nl:8080/roller
However I like to have it running on http://www.otherdomain.nl/

Problem is that I already have apache2 running on port 80, so I needed  
to setup
a proxy for apache (no change to get an other IP for now), I  
configured it like this:

<VirtualHost *>
    ServerAdmin webmaster@domain.com
    ServerName www. otherdomain.nl
    ServerAlias otherdomain.nl
    ErrorLog /var/log/apache2/domain-error.log
    CustomLog /var/log/apache2/domain.log common
    ProxyPass / http://127.0.0.1:8080/roller/
    ProxyPassReverse / http://127.0.0.1:8080/roller/
    <Location />
      Order deny,allow
      Allow from all
    </Location>
</VirtualHost>

This seems to work, and roller shows up on www.otherdomain.nl,

however all my CSS and images are gone, because
the generated source stills shows domain.nl/roller, not otherdomain.nl.

I am not sure currently where to look.

a) Can I tell/force roller to generate all URL's with the domain http://www.otherdomain.nl/?
If so, roller  roller-custom.properties doesn't seems to be the pace  
for it.
b) it might be a tomcat setting, if so... what setting.. I  
unfortunately don't know enough
of tomcat yet to know where to look for (searches in google for example)
c) Or may be it's an apache2 mis configuration... not sure about that.

Does anybody have tomcat6 running behind apache2 with roller,
and if so how would a configuration look like?

thanks in advance,
Ries van Twisk







Re: tomcat6/roller behind a apache2 proxy

Posted by ries van Twisk <rv...@dds.nl>.
Thanks for the answer,

just out of curiosity, would this also work in my server.xml?

<Host name="www.otherdomain.nl"    appBase="webapps/roller">
  <Alias>otherdomain.nl</Alias>
</Host>

> Setup your roller as the ROOT webapp of the tomcat.
> That is to say, set like this:
>   ProxyPass / http://127.0.0.1:8080/
>   ProxyPassReverse / http://127.0.0.1:8080/
>
>
> 2007/12/3, ries van Twisk <rv...@dds.nl>:
>>
>> Hey All,
>>
>> I have roller running at http://www.domain.nl:8080/roller
>> However I like to have it running on http://www.otherdomain.nl/
>>
>> Problem is that I already have apache2 running on port 80, so I  
>> needed
>> to setup
>> a proxy for apache (no change to get an other IP for now), I
>> configured it like this:
>>
>> <VirtualHost *>
>>    ServerAdmin webmaster@domain.com
>>    ServerName www. otherdomain.nl
>>    ServerAlias otherdomain.nl
>>    ErrorLog /var/log/apache2/domain-error.log
>>    CustomLog /var/log/apache2/domain.log common
>>    ProxyPass / http://127.0.0.1:8080/roller/
>>    ProxyPassReverse / http://127.0.0.1:8080/roller/
>>    <Location />
>>      Order deny,allow
>>      Allow from all
>>    </Location>
>> </VirtualHost>
>>
>> This seems to work, and roller shows up on www.otherdomain.nl,
>>
>> however all my CSS and images are gone, because
>> the generated source stills shows domain.nl/roller, not  
>> otherdomain.nl.
>>
>> I am not sure currently where to look.
>>
>> a) Can I tell/force roller to generate all URL's with the domain
>> http://www.otherdomain.nl/?
>> If so, roller  roller-custom.properties doesn't seems to be the pace
>> for it.
>> b) it might be a tomcat setting, if so... what setting.. I
>> unfortunately don't know enough
>> of tomcat yet to know where to look for (searches in google for  
>> example)
>> c) Or may be it's an apache2 mis configuration... not sure about  
>> that.
>>
>> Does anybody have tomcat6 running behind apache2 with roller,
>> and if so how would a configuration look like?
>>
>> thanks in advance,
>> Ries van Twisk
>>
>>





Re: tomcat6/roller behind a apache2 proxy

Posted by Sutra Zhou <zh...@gmail.com>.
Setup your roller as the ROOT webapp of the tomcat.
That is to say, set like this:
   ProxyPass / http://127.0.0.1:8080/
   ProxyPassReverse / http://127.0.0.1:8080/


2007/12/3, ries van Twisk <rv...@dds.nl>:
>
> Hey All,
>
> I have roller running at http://www.domain.nl:8080/roller
> However I like to have it running on http://www.otherdomain.nl/
>
> Problem is that I already have apache2 running on port 80, so I needed
> to setup
> a proxy for apache (no change to get an other IP for now), I
> configured it like this:
>
> <VirtualHost *>
>     ServerAdmin webmaster@domain.com
>     ServerName www. otherdomain.nl
>     ServerAlias otherdomain.nl
>     ErrorLog /var/log/apache2/domain-error.log
>     CustomLog /var/log/apache2/domain.log common
>     ProxyPass / http://127.0.0.1:8080/roller/
>     ProxyPassReverse / http://127.0.0.1:8080/roller/
>     <Location />
>       Order deny,allow
>       Allow from all
>     </Location>
> </VirtualHost>
>
> This seems to work, and roller shows up on www.otherdomain.nl,
>
> however all my CSS and images are gone, because
> the generated source stills shows domain.nl/roller, not otherdomain.nl.
>
> I am not sure currently where to look.
>
> a) Can I tell/force roller to generate all URL's with the domain
> http://www.otherdomain.nl/?
> If so, roller  roller-custom.properties doesn't seems to be the pace
> for it.
> b) it might be a tomcat setting, if so... what setting.. I
> unfortunately don't know enough
> of tomcat yet to know where to look for (searches in google for example)
> c) Or may be it's an apache2 mis configuration... not sure about that.
>
> Does anybody have tomcat6 running behind apache2 with roller,
> and if so how would a configuration look like?
>
> thanks in advance,
> Ries van Twisk
>
>
>
>
>
>
>

Re: tomcat6/roller behind a apache2 proxy

Posted by Ronald Iwema <ro...@gmail.com>.
It's not really an Apache matter, but it can be solved by Apache, with
mod_proxy_html.

The cause of the problem is that a lot of webapps, including roller will
query to application server they run on what their context path is. This is
very common, only because you use a reverse proxy, the application server is
not really the one serving to the client, therefor you get those wrong
paths.

The best solution has already been said, make sure the application on the
applicationserver is running on the same context as where the requests com
in at your reverse proxy.

The other solution is mod_proxy_html, which has just been mentioned. But
beware, this module will parse every page it gets, and replaces all the
occurrences of one hostname:port/context with something else you configured.
But only if it occurs in certain attributes (like src in img and href in a).
This does not perform well on high traffic websites. I only use it for small
low-traffic webapps for which it is not worth running a dedicated
application server.

Kind Regards,
Ronald Iwema


On 12/3/07, Rocco Scappatura <Ro...@sttspa.it> wrote:
>
>
>
>
> > Hey Gabe,
> >
> > that seemed to work just fine and my blog shows up fine with CSS and
> > images.
> >
> > However my feeds still look like :
> > http://www.otherdomain.nl:8080/frontpage/feed/comments/rss
> >
> > So I am basically still wondering if it's not possible to tell roller
> > to generate all URL's with http://www.otherdomain.n/ by forcing that.
> > THen I can simply do my proxy from apache2 and don't have to wonder
> > about
> > the problems so much.
>
> Hello,
>
> I had the same problem until yesterday. It is an apache matter. Tou could
> use mod_proxy_html. I solved al my problems.
>
> Here, is explained wonderfully your problem and the solution:
>
> http://www.apachetutor.org/admin/reverseproxies
>
> you can download apache module at:
>
> http://www.webthing.com/
>
> I discovered a little problem at first link (the tutorial) I have to add a
> further translation. Basilcally, it should be
>
> ProxyHTMLURLMap  http://www.domain.nl:8080/roller/ /
>
> Try it. I should have no problem.
>
> rocsca
>
> > Please note.. I am a newbie in the java/tomcat world... so if I say
> > anything stupid, please let me know :)
> >
> > thanks in advance again,
> > Ries
> >
> >
> > On Dec 2, 2007, at 11:00 PM, Gabe Wong wrote:
> >
> >> ries van Twisk wrote:
> >>> Hey All,
> >>>
> >>> I have roller running at http://www.domain.nl:8080/roller
> >>> However I like to have it running on http://www.otherdomain.nl/
> >>>
> >>> Problem is that I already have apache2 running on port 80, so I
> >>> needed to setup
> >>> a proxy for apache (no change to get an other IP for now), I
> >>> configured it like this:
> >>>
> >>> <VirtualHost *>
> >>>   ServerAdmin webmaster@domain.com
> >>>   ServerName www. otherdomain.nl
> >>>   ServerAlias otherdomain.nl
> >>>   ErrorLog /var/log/apache2/domain-error.log
> >>>   CustomLog /var/log/apache2/domain.log common
> >>>   ProxyPass / http://127.0.0.1:8080/roller/
> >>>   ProxyPassReverse / http://127.0.0.1:8080/roller/
> >>>   <Location />
> >>>     Order deny,allow
> >>>     Allow from all
> >>>   </Location>
> >>> </VirtualHost>
> >>
> >> shutdown Tomcat
> >> rename roller webapp to ROOT
> >> startup Tomcat
> >> Remove "roller/" from your Apache Proxy
> >> Restart Apache
> >>
> >> --
> >> Regards
> >>
> >> Gabe Wong
> >> NGASI AppServer Manager
> >> Application server installation and configuration AUTOMATION
> >> http://www.ngasi.com
> >>
> >
> >
> >
> >
> >
> >
> >
> >
>
>
>

Re: tomcat6/roller behind a apache2 proxy

Posted by Rocco Scappatura <Ro...@sttspa.it>.


> Hey Gabe,
>
> that seemed to work just fine and my blog shows up fine with CSS and
> images.
>
> However my feeds still look like :
> http://www.otherdomain.nl:8080/frontpage/feed/comments/rss
>
> So I am basically still wondering if it's not possible to tell roller
> to generate all URL's with http://www.otherdomain.n/ by forcing that.
> THen I can simply do my proxy from apache2 and don't have to wonder
> about
> the problems so much.

Hello,

I had the same problem until yesterday. It is an apache matter. Tou could
use mod_proxy_html. I solved al my problems.

Here, is explained wonderfully your problem and the solution:

 http://www.apachetutor.org/admin/reverseproxies

you can download apache module at:

 http://www.webthing.com/

I discovered a little problem at first link (the tutorial) I have to add a
further translation. Basilcally, it should be

 ProxyHTMLURLMap  http://www.domain.nl:8080/roller/ /

Try it. I should have no problem.

rocsca

> Please note.. I am a newbie in the java/tomcat world... so if I say
> anything stupid, please let me know :)
>
> thanks in advance again,
> Ries
>
>
> On Dec 2, 2007, at 11:00 PM, Gabe Wong wrote:
>
>> ries van Twisk wrote:
>>> Hey All,
>>>
>>> I have roller running at http://www.domain.nl:8080/roller
>>> However I like to have it running on http://www.otherdomain.nl/
>>>
>>> Problem is that I already have apache2 running on port 80, so I
>>> needed to setup
>>> a proxy for apache (no change to get an other IP for now), I
>>> configured it like this:
>>>
>>> <VirtualHost *>
>>>   ServerAdmin webmaster@domain.com
>>>   ServerName www. otherdomain.nl
>>>   ServerAlias otherdomain.nl
>>>   ErrorLog /var/log/apache2/domain-error.log
>>>   CustomLog /var/log/apache2/domain.log common
>>>   ProxyPass / http://127.0.0.1:8080/roller/
>>>   ProxyPassReverse / http://127.0.0.1:8080/roller/
>>>   <Location />
>>>     Order deny,allow
>>>     Allow from all
>>>   </Location>
>>> </VirtualHost>
>>
>> shutdown Tomcat
>> rename roller webapp to ROOT
>> startup Tomcat
>> Remove "roller/" from your Apache Proxy
>> Restart Apache
>>
>> --
>> Regards
>>
>> Gabe Wong
>> NGASI AppServer Manager
>> Application server installation and configuration AUTOMATION
>> http://www.ngasi.com
>>
>
>
>
>
>
>
>
>



Re: tomcat6/roller behind a apache2 proxy

Posted by Gabe Wong <ga...@ngasi.com>.
ries van Twisk wrote:
> Hey Gabe,
>
> that seemed to work just fine and my blog shows up fine with CSS and 
> images.
>
> However my feeds still look like : 
> http://www.otherdomain.nl:8080/frontpage/feed/comments/rss
>
> So I am basically still wondering if it's not possible to tell roller
> to generate all URL's with http://www.otherdomain.n/ by forcing that.
> THen I can simply do my proxy from apache2 and don't have to wonder about
> the problems so much.
>
> Please note.. I am a newbie in the java/tomcat world... so if I say
> anything stupid, please let me know :)
>
> thanks in advance again,
> Ries

shutdown Tomcat.
in the server.xml file, set proxyPort="80" in the Connector section.
startup Tomcat

-- 
Regards

Gabe Wong
NGASI AppServer Manager
Application server installation and configuration AUTOMATION
http://www.ngasi.com


Re: tomcat6/roller behind a apache2 proxy

Posted by ries van Twisk <rv...@dds.nl>.
Hey Gabe,

that seemed to work just fine and my blog shows up fine with CSS and  
images.

However my feeds still look like : http://www.otherdomain.nl:8080/frontpage/feed/comments/rss

So I am basically still wondering if it's not possible to tell roller
to generate all URL's with http://www.otherdomain.n/ by forcing that.
THen I can simply do my proxy from apache2 and don't have to wonder  
about
the problems so much.

Please note.. I am a newbie in the java/tomcat world... so if I say
anything stupid, please let me know :)

thanks in advance again,
Ries


On Dec 2, 2007, at 11:00 PM, Gabe Wong wrote:

> ries van Twisk wrote:
>> Hey All,
>>
>> I have roller running at http://www.domain.nl:8080/roller
>> However I like to have it running on http://www.otherdomain.nl/
>>
>> Problem is that I already have apache2 running on port 80, so I  
>> needed to setup
>> a proxy for apache (no change to get an other IP for now), I  
>> configured it like this:
>>
>> <VirtualHost *>
>>   ServerAdmin webmaster@domain.com
>>   ServerName www. otherdomain.nl
>>   ServerAlias otherdomain.nl
>>   ErrorLog /var/log/apache2/domain-error.log
>>   CustomLog /var/log/apache2/domain.log common
>>   ProxyPass / http://127.0.0.1:8080/roller/
>>   ProxyPassReverse / http://127.0.0.1:8080/roller/
>>   <Location />
>>     Order deny,allow
>>     Allow from all
>>   </Location>
>> </VirtualHost>
>
> shutdown Tomcat
> rename roller webapp to ROOT
> startup Tomcat
> Remove "roller/" from your Apache Proxy
> Restart Apache
>
> -- 
> Regards
>
> Gabe Wong
> NGASI AppServer Manager
> Application server installation and configuration AUTOMATION
> http://www.ngasi.com
>








Re: tomcat6/roller behind a apache2 proxy

Posted by Gabe Wong <ga...@ngasi.com>.
ries van Twisk wrote:
> Hey All,
>
> I have roller running at http://www.domain.nl:8080/roller
> However I like to have it running on http://www.otherdomain.nl/
>
> Problem is that I already have apache2 running on port 80, so I needed 
> to setup
> a proxy for apache (no change to get an other IP for now), I 
> configured it like this:
>
> <VirtualHost *>
>    ServerAdmin webmaster@domain.com
>    ServerName www. otherdomain.nl
>    ServerAlias otherdomain.nl
>    ErrorLog /var/log/apache2/domain-error.log
>    CustomLog /var/log/apache2/domain.log common
>    ProxyPass / http://127.0.0.1:8080/roller/
>    ProxyPassReverse / http://127.0.0.1:8080/roller/
>    <Location />
>      Order deny,allow
>      Allow from all
>    </Location>
> </VirtualHost>

shutdown Tomcat
rename roller webapp to ROOT
startup Tomcat
Remove "roller/" from your Apache Proxy
Restart Apache

-- 
Regards

Gabe Wong
NGASI AppServer Manager
Application server installation and configuration AUTOMATION
http://www.ngasi.com