XAMPP - Let's Encrypt SSL Installation

Prerequisites

  • XAMPP installed on your Windows Server.

  • A registered domain pointing to your server's IP address (via DNS A record).

  • Port 80 (HTTP) and 443 (HTTPS) open in firewall.

Step-by-Step Guide

Download win-acme

Generate the SSL Certificate

  • Open Command Prompt as Administrator.

  • Navigate to the win-acme folder:

  1. “M” - Create new certificate

  2. “1” - Manually input host names

  3. “Enter your domain name here”

  4. “Enter” - Just click enter to confirm again

  5. “5” - Save file on local or network path

  6. “C:\xampp\htdocs” - Your site root folder (C:\xampp\htdocs\<domain name>)

  7. “y” - Default config settings

  8. “2” - Choosing CSR

  9. “3”- Write .pem files

  10. “C:\apache-certs” - The reason we created the folder.

  11. “3” - No extra steps

  12. “1” - No extra steps

  13. “Enter e-mail” - Enter your email adres

  14. “Y” - Opens some docs

  15. “Y” - Ofcourse we agree

Configuring Apache

Updating C:\xampp\apache\conf\extra\httpd-ssl.conf

<VirtualHost *:443>
    ServerName urc.ac.in
    DocumentRoot "C:/xampp/htdocs/<domain name>"

    SSLEngine on
    SSLCertificateFile "C:/ProgramData/win-acme/.../cert.pem"
    SSLCertificateKeyFile "C:/ProgramData/win-acme/.../privkey.pem"
    SSLCertificateChainFile "C:/ProgramData/win-acme/.../fullchain.pem"

    <Directory "C:/xampp/htdocs/<domain name>">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Step 4: Enable SSL in Apache

Configure C:\xampp\apache\conf\extra\httpd-vhosts.conf

<VirtualHost *:443>
    ServerName urc.ac.in
    DocumentRoot "C:/xampp/htdocs/<domain name>"

    SSLEngine on
    SSLCertificateFile "C:/ProgramData/win-acme/.../cert.pem"
    SSLCertificateKeyFile "C:/ProgramData/win-acme/.../privkey.pem"
    SSLCertificateChainFile "C:/ProgramData/win-acme/.../fullchain.pem"

    <Directory "C:/xampp/htdocs/<domain name>">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Enable Virtual Hosts in Apache

Load the Required Apache Module

Open this file:

C:\xampp\apache\conf\httpd.conf

Find this line (or similar):

#LoadModule socache_shmcb_module modules/mod_socache_shmcb.so

Uncomment it by removing the #:

LoadModule socache_shmcb_module modules/mod_socache_shmcb.so

Make Sure These Modules Are Enabled Too

Force Redirect HTTP → HTTPS

Add this to your .htaccess file in:

C:\xampp\htdocs\<domain>\.htaccess
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Opening the Port in Windows Firewall Security.

Search for Windows Firewall Security for Windows and Open it.

Click on Inbound Rule, and follow the below steps:

  • Click on New Rule from the right panel

  • Select Port, Hit Next

  • Click on TCP and Give Specific Port number as 443,80

  • Allow all connection

  • Check on Domain, private and Public

  • Give the respective name and Click Finish

  • And then, repeat the same steps for Outbound Rules and Finish

Troubleshooting Commands

Check Errors: C:\xampp\apache\logs\error.log

netstat -an | findstr :443

You should now see something like:
TCP    0.0.0.0:443   0.0.0.0:0   LISTENING


REFERENCES

Last updated

Was this helpful?