You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Robert Landrum <rl...@capitoladvantage.com> on 2002/02/19 19:41:44 UTC

[OT] Apache Config Problem

I'm trying to do something really simple and trying to avoid writing 
an Modperl handler to do it.

We have a website behind a bigip running on port 8080.  When someone 
requests a URL that doesn't end with a slash, it's redirected to 
http://host:8080/path/ .  I tried turning off UseCononicalName, but 
it didn't have any effect.

Any suggestions?

Thanks,

Rob

--
When I used a Mac, they laughed because I had no command prompt. When 
I used Linux, they laughed because I had no GUI.  

Re: [OT] Apache Config Problem

Posted by Brian Reichert <re...@numachi.com>.
On Tue, Feb 19, 2002 at 01:41:44PM -0500, Robert Landrum wrote:
> I'm trying to do something really simple and trying to avoid writing 
> an Modperl handler to do it.
> 
> We have a website behind a bigip running on port 8080.  When someone 
> requests a URL that doesn't end with a slash, it's redirected to 
> http://host:8080/path/ .  I tried turning off UseCononicalName, but 
> it didn't have any effect.

Er, why not use mod_rewrite?  Maybe overkill, but this is what it's for...

> Any suggestions?

  <http://httpd.apache.org/docs-2.0/misc/rewriteguide.html>
 
> Thanks,
> 
> Rob

-- 
Brian 'you Bastard' Reichert		<re...@numachi.com>
37 Crystal Ave. #303			Daytime number: (603) 434-6842
Derry NH 03038-1713 USA			Intel architecture: the left-hand path

Re: [OT] Apache Config Problem

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
Robert Landrum wrote:
> 
> I'm trying to do something really simple and trying to avoid writing
> an Modperl handler to do it.
> 
> We have a website behind a bigip running on port 8080.  When someone
> requests a URL that doesn't end with a slash, it's redirected to
> http://host:8080/path/ .  I tried turning off UseCononicalName, but
> it didn't have any effect.
> 
> Any suggestions?

I have a setup like this:

  <VirtualHost my.transparent.server:10001>
    ServerName foo.example.com
    Port 80
  ...
  <VirtualHost my.transparent.server:20001>
    ServerName foo.example.com
    Port 443

behind bigIP... so, traffic to foo.example.com on 443 at the bigIP
level is sent to my.transparent.server at 20001.  mod_dir and others
use the Port directive to "fix" redirects, which isn't exactly
self-evident...

--Geoff

Re: [OT] Apache Config Problem

Posted by Robert Landrum <rl...@capitoladvantage.com>.
At 2:22 PM -0500 2/19/02, Stephen Reppucci wrote:
>So, if you virtual host was something like:
>
>Listen 192.168.0.100:8080
><VirtualHost 192.168.0.100:8080>
>  ServerName  www.foo.com
>  ServerAlias foo.com
>  Port 80
>  ...
></VirtualHost>
>
>Then (assuming your bigip sends requests for foo.com to
>192.168.0.100:8080) generated urls will be to
>'http://www.foo.com:80/' (I think the ':80' is dropped as the
>default port...)
>
>

A very important addition to this is to make sure UseCononicalName is
turned on. ;-)

30 minutes of reading about mod_rewrite, 4 minutes to recompile 
apache, 2 minutes of coding it, 20 minutes of testing, and a 10 
second fix was all it took.  Doh!

Thanks everyone,

Rob

--
When I used a Mac, they laughed because I had no command prompt. When 
I used Linux, they laughed because I had no GUI.  

Re: [OT] Apache Config Problem

Posted by Stephen Reppucci <sg...@logsoft.com>.
Yes, just add a 'Port 80' line to your VirtualHost section.

While many folks assume that this directive is for telling apache
which port to listen on (it's not -- the Listen directive does
that...), it's actually a setting that instructs Apache to use the
named port in any generated urls.  (At least, that's my
understanding of it, and it appears to work like that for me...)

UseCanonical tells apache to always use the canonical ("ServerName")
setting in generated urls -- that allows you to have a ServerAlias
for something like 'foo.com', and have generated urls redirect to to
'www.foo.com'.

So, if you virtual host was something like:

Listen 192.168.0.100:8080
<VirtualHost 192.168.0.100:8080>
  ServerName  www.foo.com
  ServerAlias foo.com
  Port 80
  ...
</VirtualHost>

Then (assuming your bigip sends requests for foo.com to
192.168.0.100:8080) generated urls will be to
'http://www.foo.com:80/' (I think the ':80' is dropped as the
default port...)

HTH,
<Steve>

On Tue, 19 Feb 2002, Robert Landrum wrote:

> I'm trying to do something really simple and trying to avoid writing
> an Modperl handler to do it.
>
> We have a website behind a bigip running on port 8080.  When someone
> requests a URL that doesn't end with a slash, it's redirected to
> http://host:8080/path/ .  I tried turning off UseCononicalName, but
> it didn't have any effect.
>
> Any suggestions?
>
> Thanks,
>
> Rob
>
> --
> When I used a Mac, they laughed because I had no command prompt. When
> I used Linux, they laughed because I had no GUI.
>

-- 
Steve Reppucci                                       sgr@logsoft.com |
Logical Choice Software                          http://logsoft.com/ |
=-=-=-=-=-=-=-=-=-=-  My God!  What have I done?  -=-=-=-=-=-=-=-=-=-=