PDA

View Full Version : How to switch on support for SSL in apache?


mlse
06-24-2009, 03:10 PM
Hi all,

Firstly, my knowedge of the Apache 2 server is somewhat limited, so I may be barking up the wrong tree here ...

The problem is that my development server (on a local machine) will not accept "https" requests - it gives me a "connection refused" error.

Presumably that means that SSL is not switched on/allowed in my Apache server?

How can I get it to allow https requests?

tomws
06-24-2009, 04:05 PM
You get it to start listening with "Listen 443" somewhere in the conf. The location depends upon OS and implementation. Wherever the existing "Listen 80" is placed, that's where you want it. You'll also need a self-signed certificate. Oh, and clearance through the firewall.

Here's an agglomeration of code for an in-house SSL site on Debian:
ports.conf
<IfModule mod_ssl.c>
# SSL name based virtual hosts are not yet supported, therefore no
# NameVirtualHost statement here
Listen 443
</IfModule>


sitename.conf
<VirtualHost *:443>
#blah blah
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
#blah blah
</VirtualHost>

If you're unfamiliar, virtual hosts and SSL as above aren't the best combination, FYI. SSL operates at a lower level so it's tied to IP address rather than hostname. That means the SSL sites needs their own IP apart from that used by other hostnames. The Apache docs and elsewhere have plenty of information on the reasons.

mlse
06-26-2009, 09:42 AM
Thanks for that,

That gives me plenty of info to find a solution, I'm sure.

I'm using Debian too by the way - I have Etch.

oesxyl
06-26-2009, 02:41 PM
Thanks for that,

That gives me plenty of info to find a solution, I'm sure.

I'm using Debian too by the way - I have Etch.

http://www.eclectica.ca/howto/ssl-cert-howto.php

from:

http://www.debian-administration.org/article/Creating_and_Using_a_self_signed__SSL_Certificates_in_debian

debian way, :)

best regards

mlse
08-03-2009, 08:16 PM
Excellent! Perfect. Thanks.