You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Stuart, Ed" <Ed...@austinenergy.com> on 2006/05/03 15:24:25 UTC

[users@httpd] Redirect Problem

We're running Apache 2.0.46 on Red Hat kernel 2.4.  We're trying to
shorten the URL our clients have to use to connect to an application.
We have three environments; development, test, and production. Our
approach is to create a DNS entry in the format of
environment.appname.domain and have it resolve to
environment.webserver.domain and when they arrive look at what
application they are seeking and redirect them to
environment.webserver.domain/appname.  We've got this working with the
DNS as described and the following entry in the httpd.conf file.

<VirtualHost *>
ServerName test.appname.domain
ServerAlias *
Redirect permanent / https://testweb.domain/appname </VirtualHost>

Our problem is that if clients mistakenly enter
https://test.appname.domain instead of http://test.appname.domain they
are directed to the default page of https://testweb.domain which is the
index.html file.

How can we fix this, and is there a better way to solve the original
problem?

Thanks in advance for your help;
Ed
**Please apply a generous amount of all the usual disclaimers here.**



[users@httpd] Install / setup troubles

Posted by Bill Angus <md...@psychtest.com>.
Dear Vasiliy: 

It seems that I am getting an error message in the log file that 
[warn] Init: (www.psychtest.com:443) You configured HTTP(80) on the standard HTTPS(443) port!

If I let the conf.ssl script proceed to the point where it tries configure SSL on, the server terminates. 

What I have been trying to do is to use https on port 443 and http on port 80

I have a single dedicated IP address -- DNS pointing to the address 209.121.79.58

I would like to serve incoming to the above IP address port 80 as http and incoming port 443 as https:

Thanks and have a great day!

Bill Angus, MA
http://www.psychtest.com
  ----- Original Message ----- 
  From: Vasiliy Boulytchev 
  To: users@httpd.apache.org 
  Sent: Thursday, May 04, 2006 10:24 AM
  Subject: Re: [users@httpd] Redirect Problem



  Bill,
    Yes, you can :)   Its all about how you configure your 
  VirtualHosts.  If you elaborate a bit, I would be glad to shoot a sample 
  config :)


Re: [users@httpd] Redirect Problem

Posted by Vasiliy Boulytchev <vb...@linuxspecial.com>.
Bill,
 	Yes, you can :)   Its all about how you configure your 
VirtualHosts.  If you elaborate a bit, I would be glad to shoot a sample 
config :)

-- 
Vasiliy Boulytchev
CIT Internet

On Thu, 4 May 2006, Bill Angus wrote:

> This is a bit of a newbie question --- But can one have named virtual hosts on port 80 but still run SSL on the same server by not having any named virtual hosts on port 443 ?
>
> Bill Angus, MA
> http://www.psychtest.com
>  ----- Original Message -----
>  From: Krist van Besien
>  To: users@httpd.apache.org
>  Sent: Thursday, May 04, 2006 1:40 AM
>  Subject: Re: [users@httpd] Redirect Problem
>
>
>  On 5/3/06, Stuart, Ed <Ed...@austinenergy.com> wrote:
>  >
>  >
>  > We're running Apache 2.0.46 on Red Hat kernel 2.4.  We're trying to shorten
>  > the URL our clients have to use to connect to an application.  We have three
>  > environments; development, test, and production. Our approach is to create a
>  > DNS entry in the format of environment.appname.domain and have it resolve to
>  > environment.webserver.domain and when they arrive look at what application
>  > they are seeking and redirect them to environment.webserver.domain/appname.
>  > We've got this working with the DNS as described and the following entry in
>  > the httpd.conf file.
>  >
>  > <VirtualHost *>
>  > ServerName test.appname.domain
>  > ServerAlias *
>  > Redirect permanent / https://testweb.domain/appname </VirtualHost>
>  >
>  > Our problem is that if clients mistakenly enter https://test.appname.domain
>  > instead of http://test.appname.domain they are directed to the default page
>  > of https://testweb.domain which is the index.html file.
>  >
>  > How can we fix this, and is there a better way to solve the original
>  > problem?
>
>  (repost, aparently some keypresses are interpreted by gmail as hotkey
>  and caused a prematures send)
>
>  Probably https requests are not processed by te virtual server you
>  described above. Have a look at the ssl config. Also it is not
>  possible to have namevirtual hosts under ssl, so all ssl requests will
>  go to the same virtual host (probably the first)
>
>  a command that might give you some hints as to what gets processed by
>  which part of the config is:
>  httpd -S -DSSL
>
>  You could do what you are trying above with a rewrite. This would save
>  you having to add virtual hosts for every app.
>
>  For example:
>
>  RewriteCond         %{HTTP_HOST}           ^(dev|test|prod)\.(.*)\.domain$
>  RewriteRule          (.*)
>  https://%1web.domain/%2/$1 [R,L]
>
>  (Disclaimer: This is of the top of my head, I haven't tested it.)
>
>  Krist
>
>
>
>
>
>
>  --
>  krist.vanbesien@gmail.com
>  Solothurn, Switzerland
>
>  ---------------------------------------------------------------------
>  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
>
>

---------------------------------------------------------------------
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] Redirect Problem

Posted by Bill Angus <md...@psychtest.com>.
This is a bit of a newbie question --- But can one have named virtual hosts on port 80 but still run SSL on the same server by not having any named virtual hosts on port 443 ?

Bill Angus, MA
http://www.psychtest.com
  ----- Original Message ----- 
  From: Krist van Besien 
  To: users@httpd.apache.org 
  Sent: Thursday, May 04, 2006 1:40 AM
  Subject: Re: [users@httpd] Redirect Problem


  On 5/3/06, Stuart, Ed <Ed...@austinenergy.com> wrote:
  >
  >
  > We're running Apache 2.0.46 on Red Hat kernel 2.4.  We're trying to shorten
  > the URL our clients have to use to connect to an application.  We have three
  > environments; development, test, and production. Our approach is to create a
  > DNS entry in the format of environment.appname.domain and have it resolve to
  > environment.webserver.domain and when they arrive look at what application
  > they are seeking and redirect them to environment.webserver.domain/appname.
  > We've got this working with the DNS as described and the following entry in
  > the httpd.conf file.
  >
  > <VirtualHost *>
  > ServerName test.appname.domain
  > ServerAlias *
  > Redirect permanent / https://testweb.domain/appname </VirtualHost>
  >
  > Our problem is that if clients mistakenly enter https://test.appname.domain
  > instead of http://test.appname.domain they are directed to the default page
  > of https://testweb.domain which is the index.html file.
  >
  > How can we fix this, and is there a better way to solve the original
  > problem?

  (repost, aparently some keypresses are interpreted by gmail as hotkey
  and caused a prematures send)

  Probably https requests are not processed by te virtual server you
  described above. Have a look at the ssl config. Also it is not
  possible to have namevirtual hosts under ssl, so all ssl requests will
  go to the same virtual host (probably the first)

  a command that might give you some hints as to what gets processed by
  which part of the config is:
  httpd -S -DSSL

  You could do what you are trying above with a rewrite. This would save
  you having to add virtual hosts for every app.

  For example:

  RewriteCond         %{HTTP_HOST}           ^(dev|test|prod)\.(.*)\.domain$
  RewriteRule          (.*)                             
  https://%1web.domain/%2/$1 [R,L]

  (Disclaimer: This is of the top of my head, I haven't tested it.)

  Krist






  --
  krist.vanbesien@gmail.com
  Solothurn, Switzerland

  ---------------------------------------------------------------------
  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] Redirect Problem

Posted by Krist van Besien <kr...@gmail.com>.
On 5/3/06, Stuart, Ed <Ed...@austinenergy.com> wrote:
>
>
> We're running Apache 2.0.46 on Red Hat kernel 2.4.  We're trying to shorten
> the URL our clients have to use to connect to an application.  We have three
> environments; development, test, and production. Our approach is to create a
> DNS entry in the format of environment.appname.domain and have it resolve to
> environment.webserver.domain and when they arrive look at what application
> they are seeking and redirect them to environment.webserver.domain/appname.
> We've got this working with the DNS as described and the following entry in
> the httpd.conf file.
>
> <VirtualHost *>
> ServerName test.appname.domain
> ServerAlias *
> Redirect permanent / https://testweb.domain/appname </VirtualHost>
>
> Our problem is that if clients mistakenly enter https://test.appname.domain
> instead of http://test.appname.domain they are directed to the default page
> of https://testweb.domain which is the index.html file.
>
> How can we fix this, and is there a better way to solve the original
> problem?

(repost, aparently some keypresses are interpreted by gmail as hotkey
and caused a prematures send)

Probably https requests are not processed by te virtual server you
described above. Have a look at the ssl config. Also it is not
possible to have namevirtual hosts under ssl, so all ssl requests will
go to the same virtual host (probably the first)

a command that might give you some hints as to what gets processed by
which part of the config is:
httpd -S -DSSL

You could do what you are trying above with a rewrite. This would save
you having to add virtual hosts for every app.

For example:

RewriteCond         %{HTTP_HOST}           ^(dev|test|prod)\.(.*)\.domain$
RewriteRule          (.*)                             
https://%1web.domain/%2/$1 [R,L]

(Disclaimer: This is of the top of my head, I haven't tested it.)

Krist






--
krist.vanbesien@gmail.com
Solothurn, Switzerland

---------------------------------------------------------------------
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] Redirect Problem

Posted by Krist van Besien <kr...@gmail.com>.
On 5/3/06, Stuart, Ed <Ed...@austinenergy.com> wrote:
>
>
> We're running Apache 2.0.46 on Red Hat kernel 2.4.  We're trying to shorten
> the URL our clients have to use to connect to an application.  We have three
> environments; development, test, and production. Our approach is to create a
> DNS entry in the format of environment.appname.domain and have it resolve to
> environment.webserver.domain and when they arrive look at what application
> they are seeking and redirect them to environment.webserver.domain/appname.
> We've got this working with the DNS as described and the following entry in
> the httpd.conf file.
>
> <VirtualHost *>
> ServerName test.appname.domain
> ServerAlias *
> Redirect permanent / https://testweb.domain/appname </VirtualHost>
>
> Our problem is that if clients mistakenly enter https://test.appname.domain
> instead of http://test.appname.domain they are directed to the default page
> of https://testweb.domain which is the index.html file.
>
> How can we fix this, and is there a better way to solve the original
> problem?

Probably https requests are not processed by te virtual server you
described above. Have a look at the ssl config.

a command that might give you some hints as to what gets processed by
which part of the config is:
httpd -S -DSSL

You could do what you are trying above with a rewrite. This would save
you having to add virtual hosts for every app.

For example:

RewriteCond         %{HTTP_HOST}           ^test\.(.*)\.domain$
RewriteRule          (.*)
--
krist.vanbesien@gmail.com
Solothurn, Switzerland

---------------------------------------------------------------------
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