The simplest way to enable HTTPS for Apache on localhost:
First save these server.crt & server.key files into your
apache/conf
directory.Then open
httpd.conf
file and add following lines1
2
3
4
5
6
7
8
9
10
11
12
13
14
15Listen 80
Listen 443
NameVirtualHost *:80
NameVirtualHost *:443
<VirtualHost *:443>
# Your DocumentRoot
DocumentRoot "d:/wamp/www"
ServerName localhost
SSLEngine on
# Your files
SSLCertificateFile "d:/wamp/bin/apache/Apache2.4.4/conf/server.crt"
SSLCertificateKeyFile "d:/wamp/bin/apache/Apache2.4.4/conf/server.key"
</VirtualHost>Test your configuration
1
2
3
4# navigate to Apache bin directory
cd /Apache24/bin
# Test httpd.conf validity
httpd -t