httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Pasher <just...@newmediagateway.com>
Subject Re: [users@httpd] SSl question
Date Wed, 01 Oct 2008 16:27:06 GMT
manning allan wrote:
>
> Forgive me for being stupid, but I cannot find in the documentation, 
> nor can I find the list archives.
>
> I know I am rather new to this, and I do not want to be spoon fed, but 
> a little direction would be helpful.
>
> I have successfully added virtual hosts to my Windows box, and have 
> them functioning. I just need one of the hosts to require SSL (HTTPS).
>
> I have found the documentation on how to set up virtual hosts 
> (obviously as it is working) and on how to set up SSL on the whole box.
>
> If this seems to trivial to try to help me, please at least direct me 
> to a forum or other such site where I can learn more.
>

Use something like this for your VirtualHost to make it use SSL (replace 
IP and domain accordingly).

<VirtualHost 1.2.3.4:443>

    # Apache Configuration >-------------------------------------------

    ServerName      www.example.com

    DocumentRoot    /var/www/www.example.com/htdocs

    SSLEngine on
    SSLCertificateFile      /etc/ssl/certs/www.example.com.crt
    SSLCertificateKeyFile   /etc/ssl/private/www.example.com.key

</VirtualHost>

If you want to force requests for http://www.example.com to go to 
https://www.example.com, then you can use a rewrite rule or redirect in 
the VirtualHost container for the NON-https host.

<VirtualHost 1.2.3.4:80>
...
    RewriteEngine   On
    RewriteRule ^/(.*)$ https://www.example.com/$1 [R=permanent]
</VirtualHost>


-- 
Justin Pasher

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


Mime
View raw message