Subject: what's the best way force a server to be HTTPS only?

From: "SoilentG" <[email-masked]>
Date: Thu, 14 Feb 2002 01:35:46 -0800

I have an IP based virtual server that is defined like this:

in Vhosts.conf:

<VirtualHost 12.34.56.78:80>
ServerName myvirtual.domain
...
...
...
<Directory /home/user/public_html/cgi-bin>
AllowOverride None
Options +ExecCGI -Indexes
</Directory>
</VirtualHost>

and in ssl.default-vhost.conf

<VirtualHost 12.34.56.78:443>
ServerName myvirtual.domain
...
...
..
SSLEngine on
SSLCipherSuite
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile conf/ssl/virt/server.crt
SSLCertificateKeyFile conf/ssl/virt/server.key
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
CustomLog logs/ssl_request_log \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
RewriteEngine On
RewriteOptions inherit
</VirtualHost>

and it works fine, port 80, standard... port 443 SSL.

But I've decided that I want to force it to be SSL only.

So I have some questions:

1) Am I silly to have dual vhost def's one in Vhost.conf
and the other in mod-ssl.conf?
2) What's the best way to force it to be SSL only...
a)close port 80?
b)remove def from Vhost.conf?
c)all of the above?
d)other way that I can't think of?

Thanks,

Jeff

______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [email-masked]
Automated List Manager                            [email-masked]

---

From: NickM <[email-masked]>
Date: Thu, 14 Feb 2002 10:40:58 +0100 (CET)

Try something like:

<VirtualHost _default_:*>
  Redirect / https://myvirtual.domain/
</VirtualHost>

---

From: "SoilentG" <[email-masked]>
Date: Thu, 14 Feb 2002 01:50:19 -0800

Thanks and just to be clear...(sorry I'm pretty new)

this part goes in Vhosts.conf?

Jeff

> -----Original Message-----
> From: [email-masked]
> [mailto:[email-masked]]On Behalf Of NickM
> Sent: Thursday, February 14, 2002 1:41 AM
> To: [email-masked]
> Subject: Re: what's the best way force a server to be HTTPS only?
> 
> 
> Try something like:

---

From: NickM <[email-masked]>
Date: Thu, 14 Feb 2002 11:45:36 +0100 (CET)

Yse it will replace your standard port 80 one, therefore setting anything not 
defined to redirect to the standard https site.

I did make one slight minor mistake there, take the trailing slash off as it 
will be there already from the path transferred.  So instead have:

<VirtualHost _default_:*>
   Redirect / https://myvirtual.domain
</VirtualHost>

Nick

---

From: "SoilentG" <[email-masked]>
Date: Thu, 14 Feb 2002 03:19:33 -0800

THANKS!

> Sent: Thursday, February 14, 2002 2:46 AM
> Subject: RE: what's the best way force a server to be HTTPS only?
> 
>