Bobcares

How to enable ssl in WAMP server?

by | Aug 5, 2020

Building the websites on a development environment that keeps HTTPS / SSL in mind can save us from a lot of problems while the site become live. In the WAMP server, a tool for building websites, we need to enable SSL manually.

As a part of our Server Management Services, we help our Customers to fix SSL related errors regularly.

Let us today discuss on how to enable SSL in WAMP server.


 

How to enable SSL in WAMP server?

Let us now look into the steps to enable SSL in WAMP server.

1. Download and Install OpenSSL

The first step to enable SSL is to install OpenSSL in the server. OpenSSL is available in both 32 and 64 bit. Make sure to select the correct installer for the version of Windows that you use.

Navigate to your downloads folder and double click the installer. While Installing OpenSSL, make sure to leave all the settings to the default one.
 

2. Create SSL Private Key and Certificate

Once the OpenSSL is installed, next step is to create the private key and the certificate. Step to perform this include:

1.Open Start menu, open the command prompt and “Run as Administrator”.

2.Next, change the directory to where we installed OpenSSL.

cd c:/program files/openssl-win64/bin/

3.Then, we will create the private key. It then asks for a passphrase. We could choose anything, just make sure to remember it for the next step.

openssl genrsa -aes256 -out private.key 2048 #generating private key
openssl rsa -in private.key -out private.key #removing the pass phrase

4.Next, we will create a certificate. This will ask for several questions on this step. Make sure to enter the Common Name correctly. We will need to type “localhost” for this.

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

 

3.Copy the Created SSL Key and Certificate file

After generating the key and the certificate,  we need to copy that file. First create a folder named “key” in the c:/wamp64/bin/apache/apache2.4.41/conf/ directory. Then navigate to c:/program files/openssl-win64/bin/ to find the certificate.crt and private.key that you just created. Both of these need to be copied to the new folder c:/wamp64/bin/apache/apache2.4.41/conf/key/.
 

4.Edit the httpd.conf File

After copying the files, we need to  edit the httpd.conf File. Open c:/wamp64/bin/apache/apache2.4.41/conf/httpd.conf and un-comment (remove the #) the following 3 lines:

LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so

After that , confirm that the following line is uncommented in the “php.ini” located at “C:\wamp64\bin\php\php7.0.10\php.ini“.

extension=php_openssl.dll

 

5.Edit the httpd-ssl.conf file

Now we need to edit the httpd-ssl.conf File. Open c:/wamp64/bin/apache/apache2.4.41/conf/extra/httpd-ssl.conf and change all the parameters to the ones shown below.

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

<VirtualHost *:443>
DocumentRoot "c:/wamp64/www"
ServerName localhost:443
ServerAdmin admin@example.com
ErrorLog "${SRVROOT}/logs/error.log"
TransferLog "${SRVROOT}/logs/access.log"
SSLCertificateFile "${SRVROOT}/conf/key/certificate.crt"
SSLCertificateKeyFile "${SRVROOT}/conf/key/private.key"
CustomLog "${SRVROOT}/logs/ssl_request.log"
</VirtualHost>

Set the DocumentRoot to the location of the website files. The ServerName can be “localhost” or the name choosen to access the website in the web browser like “example.com”.
 

6.Restart WampServer

Final step is to restart the WampServer for the changes to take effect. A green WAMP icon indicates that everything should be right. If the icon is orange there is a problem with the syntax somewhere.

Running the c:/wamp64/bin/apache/apache2.4.41/bin/httpd -t in command prompt will list the syntax errors if any.

This will enable to access the website with HTTPS / SSL enabled.

Note : You will get a security warning which is because we are using the self-signed certificate. You need to add it to an exception to access the page.

[Need any further assistance in fixing SSL errors? – We’re available 24*7]
 

Conclusion

In short, a website in a WAMP server does not support SSL by default. Today, we saw how our Support Engineers enable ssl in WAMP server.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

2 Comments

  1. Dan S

    I did everything to the letter! And I still get “Your connection isn’t private” when going to my site, and it says NET:ERR_CERT_AUTHORITY_INVALID” when I KNOW it’s correct. Please help!

    Reply
    • Hiba Razak

      Hello Dan,
      Please contact our support team through live chat.

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF