Re: SSl question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux