You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Mike VanHorn <mi...@wright.edu> on 2006/08/18 18:17:15 UTC

[users@httpd] Redirecting to secure server

I think is probably easy, and I'm just not getting it.

Apache 2.2.2 without SSL running on port 80 and a VirtualHost using SSL on
port 443. I have a directory on the unsecure side, /path/to/directory/. I
need to redirect unsecure requests for that to the secure, that is redirect

http://www.mydoman.com/path/to/directory/

to 

https://www.mydomain.com/path/to/directory/

So, I put the following into httpd.conf:

Redirect /path/to/directory/ https://www.mydomain.com/path/to/directory/

Apache then start okay, but the browser gives an error that the redirect is
incorrect. I think it's taking the redirect command on the unsecure side,
issuing it, and then when the browser requests the https:// URL, the
redirect again has an affect.

There must be a "correct" way to do this, and I'm just not getting it, so
any help would be greatly appreciated.

Thanks!

---
Mike VanHorn
Senior Computer Systems Administrator 
College of Engineering and Computer Science
Wright State University
265 Russ Engineering Center
937-775-5157
michael.vanhorn@wright.edu
http://www.cs.wright.edu/~mvanhorn/




---------------------------------------------------------------------
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] Redirecting to secure server

Posted by Nick Kew <ni...@webthing.com>.
On Friday 18 August 2006 17:17, Mike VanHorn wrote:

> There must be a "correct" way to do this, and I'm just not getting it, so
> any help would be greatly appreciated.

Put the redirect somewhere it's out of scope for the SSL virtualhost.
Inside the non-ssl <VirtualHost>, for instance.

-- 
Nick Kew

---------------------------------------------------------------------
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] ErrorDocument directive + local URL path + PHP = failure?

Posted by Joshua Slive <jo...@slive.ca>.
On 8/18/06, Simone, John <si...@centenarycollege.edu> wrote:
> Joshua:
>
> Thanks for your reply.  Do you think an upgrade might resolve the issue?

Maybe.  I can't think of any recent changes in apache httpd that would
relate to this, but perhaps there is something in php.

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


RE: [users@httpd] ErrorDocument directive + local URL path + PHP = failure?

Posted by "Simone, John" <si...@centenarycollege.edu>.
Joshua:

Thanks for your reply.  Do you think an upgrade might resolve the issue?

John Simone
Web Site Administrator
Centenary College
o: +1 (908) 852-1400 x.2231
m: +1 (973) 255-0106



-----Original Message-----
From: jslive@gmail.com on behalf of Joshua Slive
Sent: Fri 8/18/2006 1:02 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] ErrorDocument directive + local URL path + PHP = failure?
 
On 8/18/06, Simone, John <si...@centenarycollege.edu> wrote:

> [Fri Aug 18 11:19:41 2006] [notice] child pid 26825 exit signal
> Segmentation fault (11)

This means something "very bad" is happening.  It probably indicates a
bug in the source code of php or apache.  To find out exactly where,
see:
http://httpd.apache.org/dev/debugging.html#crashes

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

---------------------------------------------------------------------
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] ErrorDocument directive + local URL path + PHP = failure?

Posted by Joshua Slive <jo...@slive.ca>.
On 8/18/06, Simone, John <si...@centenarycollege.edu> wrote:

> [Fri Aug 18 11:19:41 2006] [notice] child pid 26825 exit signal
> Segmentation fault (11)

This means something "very bad" is happening.  It probably indicates a
bug in the source code of php or apache.  To find out exactly where,
see:
http://httpd.apache.org/dev/debugging.html#crashes

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


[users@httpd] ErrorDocument directive + local URL path + PHP = failure?

Posted by "Simone, John" <si...@centenarycollege.edu>.
I can get the ErrorDocument directive to work with a fully qualified
URL, but not with a local URL path.  From reading newsgroup posts I 
it was the result of a lack of proper ServerName, but I tried 
Different combinations of ServerName being populated as:

*:80
hostname.domain.com:80
www.domain.com:80

...with the UseCanonicalName set to "On" and "Off" and so far have not
had any luck.  I'm running RHEL3, with apache 2.0.55 and php 4.4.1.

Oddly enough if I set the local URL to an HTML file: 

ErrorDocument 404 /server_error.html

It will work.  If I set to a PHP file:

ErrorDocument 404 /server_error.php

I get a blank screen.  I have display_errors set to "= On" in my
php.ini file. So any PHP errors in my code should display.  I even
tried overwriting the content of my server_error.php file with plain
HTML (no PHP code that could create an error).  Still no luck.

If I set the ErrorDocument to point to a fully qualified URL, such as: 

ErrorDocument 404 http://www.domain.com/server_error.php

Regardless of whether it's a PHP page with PHP code or not, it works.
However, since I'm using a fully qualified URL (an "external URL") it 
does not create the REDIRECT_ variables I need to capture error
information when generating automated emails to the server
administrator.

I set my httpd.conf error LogLevel to "debug" but all I get is: 

[Fri Aug 18 11:19:41 2006] [error] [client 10.3.0.3] File does not
exist: /var/www/vhosts/www/html/asdf
[Fri Aug 18 11:19:41 2006] [notice] child pid 26825 exit signal
Segmentation fault (11) 

Any assistance you may be able to provide would be deeply appreciated.
I'm running out of ideas.

John Simone
Software Engineer
Centenary College
o: +1 (908) 852-1400 x.2231
m: +1 (973) 255-0106

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