You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Anders Norrbring <an...@norrbring.biz> on 2004/03/19 18:37:18 UTC

[users@httpd] Rewrite, or what?

I have a small problem...  I run Apache2 with name based virtual hosts at
port 80.  I also have an administrative page at https on port 443.

Now, the problem is that the admin page is reached by https://www.server.tld

If I go to a virtual host at http://www.virtual.tld that works perfectly
well, but if I should type in https://www.virtual.tld the admin page comes
up and in the browsers URL window it looks like it's the virtual hosts admin
site, not the base URL for the SSL admin page.

How can I fix this?  Either so that a https call to a virtual host shows
nothing at all, or an error page, or it gets routed to the "right address"?

If you have a solution, please elaborate it for me, I'm new to Apache2 and
not at all familiar with the inner workings.

Anders Norrbring


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Rewrite, or what?

Posted by Anders Norrbring <an...@norrbring.biz>.
> > Nope, that won't do..  I can't have name based vhosts on SSL...  The
> result
> > in startup is;
> >
> > iris:~ # apache2 start
> > Starting httpd2 (prefork) [Fri Mar 19 22:21:14 2004] [warn] _default_
> > VirtualHost overlap on port 443, the first has precedence
> > [Fri Mar 19 22:21:14 2004] [warn] _default_ VirtualHost overlap on port
> 443,
> > the first has precedence
> >
> > So there must be something else I can do.
> 
> That is a side-effect of some pre-existing configuration.  You can't just
> add the stuff from the faq to a existing vhost sections.  You need to make
> changes.
> 
> The other alternative, as mentioned in the same faq question, is to use
> mod_rewrite.


I've been looking over and over in the virtual hosting configs and examples,
docs etc.  No luck.

So, let me express my thoughts in a new way, maybe it will clear up more
what I'm looking for.

Ideally, I should run mass virtual hosting with mod_vhost_alias for hosts on
port 80.

On SSL port 443, there should be a web page to view for the exact base URL
only.  F.x. https://www.server.tld. (Where www.server.tld is the machine's
native name.)


Lets say I have a virtual host named www.virtual.tld, it should be
accessible only via port 80, i.e. http://www.virtual.tld.
If a user should point his browser to the SSL port with the URL
https://www.virtual.tld, then that user should be presented with an error
page saying something about "nothing here" and so on.

I guess I agree with Joshua that this can only be accomplished with
mod_rewrite, but I have no idea on how to write the rules needed.  I'm
absolutely new to this kind of setup, and the few pages I've found about
mod_rewrite only makes me more confused about it, not the other way around.

Anders.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: SV: [users@httpd] Rewrite, or what?

Posted by Joshua Slive <jo...@slive.ca>.
On Fri, 19 Mar 2004, Anders Norrbring wrote:
> Nope, that won't do..  I can't have name based vhosts on SSL...  The result
> in startup is;
>
> iris:~ # apache2 start
> Starting httpd2 (prefork) [Fri Mar 19 22:21:14 2004] [warn] _default_
> VirtualHost overlap on port 443, the first has precedence
> [Fri Mar 19 22:21:14 2004] [warn] _default_ VirtualHost overlap on port 443,
> the first has precedence
>
> So there must be something else I can do.

That is a side-effect of some pre-existing configuration.  You can't just
add the stuff from the faq to a existing vhost sections.  You need to make
changes.

The other alternative, as mentioned in the same faq question, is to use
mod_rewrite.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


SV: [users@httpd] Rewrite, or what?

Posted by Anders Norrbring <an...@norrbring.biz>.
> > I have a small problem...  I run Apache2 with name based virtual hosts
> at
> > port 80.  I also have an administrative page at https on port 443.
> >
> > Now, the problem is that the admin page is reached by
> https://www.server.tld
> >
> > If I go to a virtual host at http://www.virtual.tld that works perfectly
> > well, but if I should type in https://www.virtual.tld the admin page
> comes
> > up and in the browsers URL window it looks like it's the virtual hosts
> admin
> > site, not the base URL for the SSL admin page.
> >
> > How can I fix this?  Either so that a https call to a virtual host shows
> > nothing at all, or an error page, or it gets routed to the "right
> address"?
> 
> I'm guessing this is one very-special case where you might want to use the
> NameVirtualHost directive with ssl.  See the following example
> http://httpd.apache.org/docs/misc/FAQ.html#canonical-hostnames
> but replace * with *:443.


Nope, that won't do..  I can't have name based vhosts on SSL...  The result
in startup is;

iris:~ # apache2 start
Starting httpd2 (prefork) [Fri Mar 19 22:21:14 2004] [warn] _default_
VirtualHost overlap on port 443, the first has precedence
[Fri Mar 19 22:21:14 2004] [warn] _default_ VirtualHost overlap on port 443,
the first has precedence

So there must be something else I can do.

Anders.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Rewrite, or what?

Posted by Joshua Slive <jo...@slive.ca>.


On Fri, 19 Mar 2004, Anders Norrbring wrote:

>
> I have a small problem...  I run Apache2 with name based virtual hosts at
> port 80.  I also have an administrative page at https on port 443.
>
> Now, the problem is that the admin page is reached by https://www.server.tld
>
> If I go to a virtual host at http://www.virtual.tld that works perfectly
> well, but if I should type in https://www.virtual.tld the admin page comes
> up and in the browsers URL window it looks like it's the virtual hosts admin
> site, not the base URL for the SSL admin page.
>
> How can I fix this?  Either so that a https call to a virtual host shows
> nothing at all, or an error page, or it gets routed to the "right address"?

I'm guessing this is one very-special case where you might want to use the
NameVirtualHost directive with ssl.  See the following example
http://httpd.apache.org/docs/misc/FAQ.html#canonical-hostnames
but replace * with *:443.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org