0% found this document useful (0 votes)
56 views5 pages

Wamp SSL

Uploaded by

belgvr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views5 pages

Wamp SSL

Uploaded by

belgvr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

How to setup and enable https with SSL

on wamp server virtual host


PHP

 January 30, 2021  3 minutes Shailesh Ladumor

Recently, I've started working on one project where we need to set up a virtual host with HTTPS because I
need to run that project with expose and Shopify in my local development machine. I've wamp 3.2.3 on my
local machine.

I spent a lot of time setting it. so, I thought I should write one article for a step by step guide. So, I will show
you in this article how to set up HTTPS for a local machine.

Step 1 - Install Wamp


Install wamp server if not installed in your local machine. you can download the latest version of the wamp
server from here. wamp server is available in 32 bit and 64 bit. make sure you select the correct version of
the wamp server based on your operating system (window)'s version.

Step 2 - Install OpenSSL


OpenSSL is an open-source command-line tool that is used to generate the SSL certificate and private key.
OpenSSL is available in both versions 32 and 64 bit. download the latest version of OpenSSL from here.

I hope you successfully installed OpenSSL on your machine. let's take the next step

Step 3 - Create a Private key


Open your terminal as an Administrator otherwise you will get a permission denied error. Also, you can
provide permission to the OpenSSL directory and run the terminal in normal mode.

Now, let go to where we installed OpenSSL

cd C:\Program Files\OpenSSL-Win64\bin

Let's create a private key which is 2048 bits encryption. fire one by one the following two commands to
create it.

openssl genrsa -aes256 -out private.key 2048

openssl rsa -in private.key -out private.key

Your private.key is successfully generated here C:\Program Files\OpenSSL-Win64\bin

Step 4 - Create an SSL Certificate


Let's create a certificate using the following command,

openssl req -new -x509 -nodes -sha1 -key private.key -out certificate.crt -days 36500

You need to enter a detail that looks like

You can verify here


Step 5 - Move both Private Key and a Certificate
Open a directory D:\wamp64\bin\apache\apache2.4.46\conf (Based on where your wamp is installed) and
create a key directory.

Now, move both files to the key directory.

Step 6 - Configure Your httpd.conf File


Open your D:\wamp64\bin\apache\apache2.4.46\conf\httpd.conf (the drive should be where your wamp is
installed) and un-comment the following 3 lines one by one.

LoadModule ssl_module modules/mod_ssl.so

Include conf/extra/httpd-ssl.conf

LoadModule socache_shmcb_module modules/mod_socache_shmcb.so

Step 7 Configure Your httpd-ssl.conf File


Open your D:\wamp64\bin\apache\apache2.4.46\conf\extra\httpd-ssl.conf (the drive should be where your
wamp is installed) and change the following lines.

DocumentRoot "${INSTALL_DIR}/www"

ServerName localhost:443

ServerAdmin [email protected]

SSLCertificateKeyFile "${SRVROOT}/conf/key/private.key"

SSLCertificateFile "${SRVROOT}/conf/key/certificate.crt"

Make sure, these following all lines are set or not. if not, add it as well.

SSLSessionCache "shmcb:${SRVROOT}/logs/ssl_scache(512000)"

CustomLog "${SRVROOT}/logs/ssl_request.log" \

"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

Step 8 Configure a Virtual Host


Hope you have created a virtual host. if not, create a virtual host using the virtual host manager which is
provided by wamp.

Open an D:\wamp64\bin\apache\apache2.4.46\conf\extra\httpd-vhosts.conf and update your virtual host

Change the port :80 to :443


add the following lines into the VirtualHost.

SSLEngine on

SSLCertificateFile "${SRVROOT}/conf/key/certificate.crt"

SSLCertificateKeyFile "${SRVROOT}/conf/key/private.key"

Now, the code of VirtualHost looks like,

Now, we are done. Let's restart a wamp server.

If you see a green WAMP icon everything should be right. If the icon is orange there is a problem with your
syntax somewhere.

Open terminal and go to the D:\wamp64\bin\apache\apache2.4.46\bin and run httpd -t in the command
prompt and if there are any syntax errors they will be listed.

if fine then open https://ladumor.test on the browser

 Previous

How to Setup Global Git Ignore in window


Lots of developers have a question: How do I create a global gitignore file? so, In this article, I show how
to set up a global git ignore.
Reviewing pull requests, I often see contributors sneakily adding editor…

Next 

How to develop package into Laravel ?


In our daily life, we are going through lots of packages, and some of us don't know how to build our own
package into Laravel.
We are going to perform the core steps to create your own package in laravel. In…

Products

InfyChat

InfyProjects
Subscribe to our Newsletter Subscribe
InfyHMS

Made with  in India InfyJobs

InfyCRM

Open Source

Company Contact

About Us C-303, Atlanta Shopping Mall, Nr. Sudama Chowk, Mota

Contact Us Varachha, Surat - 394101, Gujarat, India.


Portfolio Phone: +91 70963 36561
E-mail: [email protected]
Blog

Career Follow Us
HIRING
      

All rights reserved ©2015 - 2021 InfyOm Technologies

You might also like