You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by iIDC Support <su...@iidc.org> on 2004/09/09 22:04:30 UTC

RE: [users@httpd] Problem with Redirect

You can add this to your server context or your virtual_host context:

        RewriteEngine on
        RewriteCond %{SERVER_PORT} ^80$
        RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]

Thomas

-----Original Message-----
From: Kaplan, Andrew H. [mailto:AHKAPLAN@PARTNERS.ORG] 
Sent: Thursday, September 09, 2004 12:49 PM
To: Apache User List (E-mail)
Subject: [users@httpd] Problem with Redirect 


Hi there --

I am trying to automatically redirect connections from port 80 to port 443.
I set up a virtual host section to accomplish this task. Here is the syntax 
that I entered into the httpd.conf file:

 <VirtualHost 132.183.12.162>
	ServerName 132.183.12.162
	ServerAdmin ahkaplan@partners.org
	DocumentRoot /usr/local/apache/htdocs
	Redirect / https://132.183.12.162/
 </VirtualHost>


 <VirtualHost 132.183.12.162>
	ServerName 132.183.12.162
	ServerAdmin ahkaplan@partners.org
	DocumentRoot /usr/local/apache/htdocs

 	SSLEngine On
	SSLCertificateFile /usr/local/apache/conf/ssl.crt/ca-bundle.crt
	SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/server.key
	SSLCertificateChainFile /usr/local/apache/conf/ssl.key/server.key
	SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
</VirtualHost>

When I start Apache with SSL, apachectl startssl, I get the following error
message:

Thu Sep  9 15:44:57 2004] [warn] VirtualHost 132.183.12.162:80 overlaps with
VirtualHost 132.183.12.162:80, the first has precedence, perhaps you need a
NameVirtualHost directive Apache/1.3.31 mod_ssl/2.8.19 (Pass Phrase Dialog)
Some of your private key files are encrypted for security reasons. In order
to read them you have to provide us with the pass phrases.

Server linux.mgh.harvard.edu:443 (RSA)
Enter pass phrase:

Ok: Pass Phrase Dialog successful. /usr/local/apache/bin/apachectl startssl:
httpd started linux:/usr/local/apache/conf # ps -ef |grep httpd
root     10767  9807  0 15:45 pts/54   00:00:00 grep httpd

As you can see, I enter the appropriate passphrase and although it appears
the httpd daemon has started, the grep command shows it has not. If I
comment out the VirtualHost excerpt shown above, Apache starts successfully.


What do I need to correct?


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