Credit Goes to: Ankit Wasankar
http://www.mytechblog.in/author/ankit-wasankar
Install SSL on windows localhost WAMP HTTP + SSL = HTTPS
Here we are going to see how to install SSL certificate in Windows localhost WAMP server.
Lot many times our production servers are installed with SSL certificates and our local development machines uses noramal http, and this makes our development system different from our production one. And as a developer we always like to have an exact environment like our production system. So here’s the guide how to install self created SSL certificate on your local WAMP installation and use Https communication with your local WAMP.
Here are the things we are going to do
- Download & install WAMP (Assuming that WAMP is installed in C: directory)
- Download & install OpenSSL
- Configure WAMP to use HTTP+SSL=HTTPS
Step 1:
Download & install WAMP (Assuming that WAMP is installed in C: directory)
Step 2:
Download & install OpenSSL
Step 3:
Configure WAMP to use HTTP+SSL=HTTPS
Path to openssl.exe : C:\wamp\bin\apache\apache2.4.9\bin\openssl.exe
Path to openssl.cnf : C:\wamp\bin\apache\apache2.4.9\conf\openssl.cnf
Step 5:
CMD in Path to openssl.exe :::
openssl genrsa -aes256 -out private.key 2048
openssl rsa -in private.key -out private.key
openssl req -new -x509 -nodes -sha1 -key private.key -out certificate.crt -days 36500 -config C:\wamp\bin\apache\apache2.4.9\conf\openssl.cnf
Now copy the privateKey & certificate into folder
Step 6:
Open httpd.conf & uncomment following
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
Open php.ini (wamp\bin\php\php5.5.12\php.ini)
extension=php_openssl.dll
Step 7:
C:\wamp\bin\apache\apache x.x.x\conf\extra\httpd-ssl.conf
-------------------
DocumentRoot "C:/wamp/www"
ServerName localhost:443
ServerAdmin [email protected]
ErrorLog "C:/wamp/bin/apache/apache2.4.9/logs/ssl_error.log"
TransferLog "C:/wamp/bin/apache/apache2.4.9/logs/ssl_access.log"
SSLCertificateFile "C:/wamp/bin/apache/apache2.4.9/conf/key/certificate.crt"
SSLCertificateKeyFile "C:/wamp/bin/apache/apache2.4.9/conf/key/private.key"
-------------------
httpd -t (To check the validity of file)