To enable HTTPS/SSL on your local WAMP server, follow these steps:
Prerequisites
- WAMP Server installed (latest version)
- Administrative access to your computer
Step-by-Step Guide
1. Enable SSL Module in Apache
- Left-click the WAMP icon in the system tray
- Go to Apache > Apache Modules
- Check
ssl_module
to enable it - Wait for WAMP to restart automatically
2. Configure Apache for SSL
- Open
httpd.conf
(via WAMP menu: Apache > httpd.conf) - Uncomment or add this line:
Include conf/extra/httpd-ssl.conf
- Save the file
3. Create SSL Certificate
- Open command prompt as administrator
- Navigate to Apache’s bin directory (typically
C:\wamp64\bin\apache\apache2.x.x\bin
) - Run these commands:CopyDownloadopenssl genrsa -out server.key 2048 openssl req -new -key server.key -out server.csr openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
4. Configure SSL Virtual Host
- Open
httpd-ssl.conf
(inC:\wamp64\bin\apache\apache2.x.x\conf\extra
) - Update these directives:
<VirtualHost _default_:443>
DocumentRoot "C:/wamp64/www" ServerName localhost:443 SSLEngine on SSLCertificateFile "C:/wamp64/bin/apache/apache2.x.x/bin/server.crt" SSLCertificateKeyFile "C:/wamp64/bin/apache/apache2.x.x/bin/server.key"
</VirtualHost> - Save the file
5. Update Windows Hosts File
- Open
C:\Windows\System32\drivers\etc\hosts
as administrator - Ensure this line exists:
127.0.0.1 localhost
6. Restart WAMP Services
- Left-click WAMP icon
- Click “Restart All Services”
7. Test HTTPS
- Open browser and visit
https://localhost
- You’ll see a security warning (this is normal for self-signed certificates)
- Proceed to the site (in Chrome: click “Advanced” then “Proceed to localhost”)
Troubleshooting
- If port 443 is in use, check
httpd-ssl.conf
for the correct port - Ensure all paths in configuration files are correct
- Check Apache error logs if HTTPS doesn’t work
Remember that this creates a self-signed certificate that browsers won’t trust by default. For development purposes, this is fine, but for production you’d need a certificate from a trusted Certificate Authority.