Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Linux » Setup VirtualHost with SSL on WAMP Server
  • GitLab 1
    How to Setup GitLab Runner on WSL Linux
  • How to Remove Language Pack
    How to forcefully remove Language Pack on Windows 10 and 11 Windows
  • Install SQL Server Management Studio 21 on Windows Server
    Install SQL Server Management Studio 21 on Windows Server Oracle/MSSQL/MySQL
  • screenshot 2020 02 13 at 22.47.41
    Active Directory Flexible Single-Master Operations Roles [FSMO] Windows Server
  • How to Install Windows Admin Center on Windows 10 11​
    Install Windows Admin Center on Windows 10 and Windows 11 Windows
  • Fatal Refusing to Merge
    How to Fix Fatal Git Error Refusing to Merge Unrelated Histories Version Control System
  • HYBRID BENEFITS FEATURE
    Azure Hybrid Use Cases and Benefits AWS/Azure/OpenShift
  • How to create blue screen using the Not my Fault tool from Sysinternals
    How to create blue screen using the Not my Fault tool from Sysinternals Windows

Setup VirtualHost with SSL on WAMP Server

Posted on 09/05/202327/11/2024 Christian By Christian 2 Comments on Setup VirtualHost with SSL on WAMP Server
SSL on WAMPServer

In this article, you will learn how to setup VirtualHost with SSL on WAMP Server for your application. Secure Sockets Layer (SSL) is a security protocol that creates an encrypted link between a web server and a web browser. Literally speaking, an SSL Certificate is an X.509 certificate. The X.509 is the standard that defines the structure of the certificate. It defines the data fields that should be included in the SSL certificate. Please see how to enable Enhanced Networking Adapter (ENA) on Windows, how to View Scheduled Events on AW using AWS Web Console, and how to rebind Tomcat Keystore with a new Certificate.

X.509 uses a formal language called Abstract Syntax Notation One (ASN.1) to express the certificate’s data structure. SSL certificate authenticates a website’s identity and enables an encrypted connection.

The first step will be to determine the certificate type that is required for configuring WAMP. Apache servers split the SSL certificate parts into two separate files: .crt and .key files. The .crt file contains the public key file (SSL certificate file), and the .key file contains the associated private key. You should use your server to generate the associated private key file as part of the CSR generation.

Windows servers use .pfx files that contain the public key file (SSL certificate file) and the associated private key file. So, if transferring your SSL certificates from a Windows server to Apache, you need to export the certificate in an Apache-compatible format, which splits the public (.crt) and private (.key) files.

SSL Encoding Format and Extensions

Before diving into this topic, let’s discuss the various certificate format and extensions. As mentioned above, an SSL certificate is essentially an X.509 certificate but has several file extension types and encoding formats. Because of this, certain devices and applications may require certain formats

SSL-Certifcate-Formats-and-Extentions
Image source: Pivo – describing the X.509 Certificate’s encoding formats and file extensions

SSL Certificate Format

The certificate files have different extensions based on the format and encoding they use. The different formats of X.509 certificates are PEM, DER, PKCS#7, and PKCS#12. PEM and PKCS#7 formats use Base64 ASCII encoding while DER and PKCS#12 use binary encoding.

The certificate files have different extensions based on the format and encoding they use. Please see how to fix the error “Ansible: Server unreachable, ssl: auth method ssl requires a password“.

PEM PKCS#7DER PKCS#12
Privacy Enhanced Mail (PEM) contains one or more X.509 digital certificate files that use base64 (ASCII) encoding and can be opened in any text editor. The certificate file types can be .pem , .crt , .cer , or .key. Each certificate in the PEM file is contained between the —- BEGIN CERTIFICATE—- and —-END CERTIFICATE—- statements. The private key is contained between the —- BEGIN RSA PRIVATE KEY—– and —–END RSA PRIVATE KEY—– statements. The CSR is contained between the —–BEGIN CERTIFICATE REQUEST—– and —–END CERTIFICATE REQUEST—– statements.The PKCS#7 certificate uses Base64 ASCII encoding with file extension .p7b or .p7c. Only certificates can be stored in this format, not private keys. The P7B certificates are contained between the “—–BEGIN PKCS7—–” and “—–END PKCS7—–” statementsThe DER certificates are in binary form, contained in .der or .cer files. These certificates are mainly used in Java-based web servers.The PKCS#12 are in binary form, contained in .pfx or .p12 files. can store the server certificate, the intermediate certificate and the private key in a single .pfx file with password protection. These certificates are mainly used on the Windows platform.

Please see how to query, stop and delete a service in Windows, how to stop Windows from applying updates, and nd how to generate a self-signed SSL certificate: How to enable LDAP over SSL with a self-signed certificate.

Configure SSL on WAMP Server

Note: To Enable HTTPS on WampServer on Windows, I will assume that you have downloaded and installed WampServer already. Ensure that the application that would need SSL Certificate has been installed and running.

Please see how to “Install and configure TeamPass Password Manager“. Now we have to install an SSL Certificate for our application to authenticate the site identity and enables an encrypted connection.

Installation of an SSL certificate depends on many things such as where you generated the CSR, the type of certificate files you got from the CA, the types of certificate files your web server supports, etc.

Please see How to create Virtual Hosts in a WAMPserver, how to uninstall WAMPServer from Windows, how to Install and Configure WordPress on Your Windows Computer Using WAMP SERVER, and how to use the DigiCert certificate utility for Windows to create a CSR.

Generate a Certificate Signing Request (CSR)

You are free to generate your CSR and Private Key using whatever program you desire such as OpenSSL, IIS, cPanel, and Plesk. You could use SSLTrust, SSL, etc to order an SSL Certificate just to mention but a few. It is best to generate your CSR and key pair on the web server where you will install the certificate.

But if the web server where you generate the CSR is different from the web server where you are going to install the certificate, then you need to export the private key from where you generated the CSR because the private key is generated at the same time when the CSR is generated.

Please see how to install Let’s Encrypt Certificates with IIS on a Windows Server, and how to install Let’s Encrypt Wildcard SSL Certificate in cPanel using Certify The Web

Download the SSL Certificate files and move them to WAMPServer

When your SSL Certificate has been issued. You will be emailed the Certificate Directly from the Certificate Authority. Select the format as “separate primary and intermediate .crt files (zipped)”. Please download it to the WampServer.

For example, Apache and other similar web servers support certificates in PEM format, whereas Microsoft Windows supports certificates in PKCS#7 format.

Note: If the certificate files and format you got from the CA are not supported on your web server or hosting provider then you have to convert the certificates to your web server-supported format using OpenSSL

Create New Folder (Optional)

Create a folder named “key”. You are free to use any name that you can recall. In my case, I will create a new folder called “key” in the following directory below.

C:/wamp64/bin/apache/apache2.4.51/conf/ directory.
Create a new folder

The certificate.crt and private.key needs to be moved to the new folder “C:\wamp\bin\apache\apache2.4.51\conf\key” that we have just created. Copy and paste your combined certificate file and your private key in that folder.

Note: If you have installed Wampserver on a different drive, please do well to replace the path (drive) with the drive you installed WAMP in if you did not install it in the default location.

Note: This step is optional as mentioned above. You can paste the generated certificate and private keys also in the Apache Configuration folder itself. 
Foldr-created

This command points Localhost to http://yourdomain.com locally and displays the default WAMP Dashboard Page.

Configure Main Apache and SSL Configuration files

This step involves modifying the SSL and Apache configuration file. Please see how to update WampServer to Latest Version, and how to fix the “Error: The processing of Group Policy failed because of lack of network connectivity to a DC. This may be a transient condition.

Enable the SSL module in the Main Apache Configuration File

Modify the httpd.conf

Open the httpd.conf file located in “C:\wamp64\bin\apache\apache-(version)\conf\httpd.conf. This will depend on where WAMP Server is installed, and uncomment the following lines. This will load the SSL module and include the SSL configuration file.

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

To do this, Install Notepad++, so when there are errors, it will point you directly t the line number in question. But I will be showing you how to do this with Notepad, and then Notepad ++ later.

httpd.conf_

Enter the Listen “IP Addresses and Port”

When the file is open, search through the files and uncomment the lines above. The following syntax above will define port 443 as a valid port for Apache configuration to listen on. 

Note: Do not forget to specify the listening port. Here enter the server IP address followed by the port. an example of this would be 192.168.xxx.xxx:443
Listening port

Please ensure to run Notepad++ in Administrator Mode, and do not forget to save it afterwards.

Uncomment-and-save-your-work-Apache-Configiration-File

Alternatively, you could open the WAMP menu from the system tray and select Apache > Apache modules > ssl_module. This will enable the SSL module in Apache.

Please see these related articles: How to export a certificate in PFX format in Windows, SSL Encrypted Communications explained. Also learn the components needed to create a certificate signing request,

Configure the VirtualHost in the Main Apache Configuration File

Note: To avoid the following error “Port:443 used for the virtualHost is not an Apache defined Variable or Listen port etc. There is a need to define the Apache Configuration File for the VirtualHost in this file and not in the VirtualHost file.

The following syntax above will define port 443 as a valid port for Apache configuration to listen on. The configuration file should look like the one below.

#
<VirtualHost *:443>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
    SSLEngine on
    SSLCertificateFile "C:/wamp64/bin/apache/apache2.4.54.2/conf/key/techda.crt"
    SSLCertificateKeyFile "C:/wamp64/bin/apache/apache2.4.54.2/conf/key/techda.key"
</VirtualHost>
#
 
<VirtualHost *:443>
    ServerName techpasstest.com
    DocumentRoot "${INSTALL_DIR}/www/app"
    <Directory  "${INSTALL_DIR}/www/app/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>
#   SSLEngine on
    SSLCertificateFile "C:/wamp64/bin/apache/apache2.4.54.2/conf/key/techda.crt"
    SSLCertificateKeyFile "C:/wamp64/bin/apache/apache2.4.54.2/conf/key/techda.crt"
</VirtualHost>
#

Note: This code specifies that the virtual host listens on port 443 (the default SSL port), sets the document root for the site, and specifies the SSL certificate and key files that were generated earlier.

Note that you will need to replace techpasstest.com with the actual domain name or hostname that you want to use for your SSL-enabled site, and update the paths to the SSL certificate and key files to match your own setup. Please see how to Install Apache HTTP Server on Ubuntu 20.04 LTS.

If you want the URL accessible from out the local server, do well to specify “require = all granted“.

Note: If you set the Require to local, you will not the able to access the application with the URL outside of the server!

Launch the httpd-ssl.conf

The httpd-ssl.conf file is specifically used for configuring SSL settings for Apache. The main Apache configuration file typically includes it httpd.conf and contains SSL-related directives such as SSLCertificateFile and SSLCertificateKeyFile.

To do this, open httpd-ssl.conf with your desired Text Editor. In my case, Notepad++.

C:/wamp64/bin/apache/apache2.4.41/conf/extra/httpd-ssl.conf 
httpd-ssl.conf

The httpd-ssl.conf file is indeed used specifically for SSL configuration in Apache, including directives such as SSLCertificateFile and SSLCertificateKeyFile. Edit the httpd-ssl.conf file to configure SSL settings for Apache

DocumentRoot "${SRVROOT}/www/htdocs"
ServerName localhost.com:443
ServerAdmin [email protected]

<Please uncomment and specifiy the following certificate path into the "SSLCertificateKeyFile", and the "SSLCertificateFile">
SSLEngine on
SSLCertificateKeyFile "${SRVROOT}/conf/key/private.key"
SSLCertificateFile "${SRVROOT}/conf/key/certificate.crt"
configure httpd-ssl.conf

Note: DocumentRoot needs to be set to the location of your website files. Please specify the server name etc. You do not want to use localhost” in production. In this way, you will be able to access your application via the URL in your web browser “techapp.com”.

  SSLSessionCache "shmcb:${SRVROOT}/logs/ssl_scache(512000)"
  CustomLog "${SRVROOT}/logs/ssl_request.log" \
       "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

Note 1: In order for Apache service to start when the SSLSessionCache "shmcb:${SRVROOT}/logs/ssl_scache(512000)” is uncommented out, please ensure the following module is enabled “LoadModule ssl_module modules/mod_ssl.so“.
Note 2: Some documentations expect you to modify the php.ini file.

In this current version of Apache, this is not required.

Please see Apache errors associated with WAMP installation for TeamPass, and how to “Fix the Port used for the Virtualhost is not an Apache Listen Port“.

Configure the Apache VirtualHost

The httpd-vhosts.conf file, you would define the virtual host configuration, including the SSL-specific settings such as the SSLCertificateFile and SSLCertificateKeyFile, as well as any other directives needed for your specific website.

Add the necessary configuration directives to the httpd-vhosts.conf file. To do this, open the httpd-vhosts.conffile and make the following changes.

C:\wamp64\bin\apache\apache-(version)\conf\extra\httpd-vhosts.conf 

It is sufficient to have the VirtualHost Derivatives in the Main Apache Configuration File only. Do not forget to specify the Redirect localhost to https://localhost and save the configuration file. 

Note: Whenever changes are made to the VirtualHost file, please always restart DNS via WAMP.

#
<VirtualHost *:80>
  ServerName localhost
  Redirect localhost https://localhost
  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
    SSLEngine on
    SSLCertificateFile "C:/wamp64/bin/apache/apache2.4.54.2/conf/key/techda.crt"
    SSLCertificateKeyFile "C:/wamp64/bin/apache/apache2.4.54.2/conf/key/techda.key"
</VirtualHost>
#  

Having just this derivative the virtualHost will ensure the following error “Port:443 used for the virtualHost is not an Apache defined Variable or Listen port etc. is avoided. Please do not forget to define the VirtualHost of your Application in the Main Apache Configuration File as discussed above.

If you have already configured SSL directives in the httpd-ssl.conf file, you would not need to repeat them in the virtual host configuration in httpd-vhosts.conf.

However, if you have additional SSL-specific settings that are specific to the virtual host, such as a different SSL certificate or additional SSL protocols or ciphers, you would add them to the virtual host configuration in httpd-vhosts.conf.

Please see “MBAM extended support ends April 2026: Find alternative solution, and how to fix “You are currently signed in as: Use a different account-this account is managed by your organisation”.

Restart Apache WebServer

Restart all Services via the WAMP Control Panel to restart your server and implement all changes. That’s it, you should have successfully installed an SSL Certificate on WAMP. Head over to https://techpasstest.com and check your secure connection.

Note: If you see a green WAMP icon everything should be right. If the icon is orange there is a problem with your syntax somewhere. You can run c:/wamp64/bin/apache/apache2.4.41/bin/httpd -t in the command prompt and if there are any syntax errors they will be listed.

Apache Syntax Check

I hope you found this blog post helpful on how to setup VirtualHost with SSL on WAMP Server for your application”. If you have any questions, please let me know in the comment session.

5/5 - (1 vote)

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
Linux, Security | Vulnerability Scans and Assessment, Windows Tags:HTTPS, Microsoft Windows, SSL, ssl certificate, Windows 10, Windows 11

Post navigation

Previous Post: Windows Defender detects Endpoint Security HipHandlers.dll
Next Post: How to create Alarm rules in VMware vSphere

Related Posts

  • How to create edit save exit file
    Mastering Vim in Linux: How to Create, Edit, Save, and Quit Files Linux
  • Spell Check Not Working in Microsoft Word
    How to Fix Spell Check Not Working in Microsoft Word Microsoft Exchange/Office/365
  • WPScan Banner
    How to scan WordPress Websites With WPScan For Security Vulnerabilities Security | Vulnerability Scans and Assessment
  • msinfo32 thumbnail
    How to use MSINFO32 to view System Information Windows
  • Uninstall SQL Server 2025
    Uninstall Microsoft SQL Server 2025 from Windows Oracle/MSSQL/MySQL
  • Capture 2
    MDT Invalid credentials: The network was not found Windows

More Related Articles

How to create edit save exit file Mastering Vim in Linux: How to Create, Edit, Save, and Quit Files Linux
Spell Check Not Working in Microsoft Word How to Fix Spell Check Not Working in Microsoft Word Microsoft Exchange/Office/365
WPScan Banner How to scan WordPress Websites With WPScan For Security Vulnerabilities Security | Vulnerability Scans and Assessment
msinfo32 thumbnail How to use MSINFO32 to view System Information Windows
Uninstall SQL Server 2025 Uninstall Microsoft SQL Server 2025 from Windows Oracle/MSSQL/MySQL
Capture 2 MDT Invalid credentials: The network was not found Windows

Comments (2) on “Setup VirtualHost with SSL on WAMP Server”

  1. Avatar photo jean jacques says:
    17/04/2025 at 2:35 PM

    Merci bcp pour l’article. j’ai une préoccupation car je n’ai pas le cadenas

    Log in to Reply
    1. chris Christian says:
      24/04/2025 at 5:28 PM

      Does this issue still persist?

      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a
 
  • GitLab 1
    How to Setup GitLab Runner on WSL Linux
  • How to Remove Language Pack
    How to forcefully remove Language Pack on Windows 10 and 11 Windows
  • Install SQL Server Management Studio 21 on Windows Server
    Install SQL Server Management Studio 21 on Windows Server Oracle/MSSQL/MySQL
  • screenshot 2020 02 13 at 22.47.41
    Active Directory Flexible Single-Master Operations Roles [FSMO] Windows Server
  • How to Install Windows Admin Center on Windows 10 11​
    Install Windows Admin Center on Windows 10 and Windows 11 Windows
  • Fatal Refusing to Merge
    How to Fix Fatal Git Error Refusing to Merge Unrelated Histories Version Control System
  • HYBRID BENEFITS FEATURE
    Azure Hybrid Use Cases and Benefits AWS/Azure/OpenShift
  • How to create blue screen using the Not my Fault tool from Sysinternals
    How to create blue screen using the Not my Fault tool from Sysinternals Windows

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,841 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.