Add SSL to XAMPP installation
If you need to add a Free SSL to your XAMPP install (windows), this is a small tutorial on how to do this:
This guide explains how to install a free SSL certificate in XAMPP on Windows without creating an incomplete certificate chain.
Before you begin
Make sure:
- ports 80 and 443 are forwarded to the Windows computer running XAMPP;
- Windows Firewall allows inbound TCP traffic on ports 80 and 443;
- your domain points to the correct public IP address;
- Apache is running and your website is accessible over HTTP.
UDP rules are not required for a standard Apache HTTPS configuration.
1. Request the certificate
Request a certificate from ZeroSSL, Let’s Encrypt or another trusted certificate authority.
Complete the requested domain verification, such as adding a DNS TXT record. Download and extract the certificate files when verification has finished.
You will normally receive:
certificate.crtca_bundle.crtprivate.keyKeep private.key secure. Never publish or share this file.
2. Create a complete certificate chain
Apache must send both your website certificate and the intermediate CA certificates. Using only certificate.crt can cause an “incomplete certificate chain” warning.
Open Command Prompt and go to the directory containing the downloaded files:
cd /d "%USERPROFILE%\Downloads"Combine the certificate and CA bundle in the correct order:
copy /B certificate.crt+ca_bundle.crt server.crtThe resulting server.crt contains:
- your website certificate;
- the required intermediate CA certificate or certificates.
3. Install the files in XAMPP
First, back up any existing certificate and key files.
Copy the complete certificate chain:
copy server.crt C:\xampp\apache\conf\ssl.crt\server.crtCopy the private key:
copy private.key C:\xampp\apache\conf\ssl.key\server.keyIf XAMPP is installed elsewhere, adjust the paths accordingly.
4. Configure Apache
Open:
C:\xampp\apache\conf\extra\httpd-ssl.confFind the SSL virtual host and configure it for your domain:
<VirtualHost *:443> ServerName example.com ServerAlias www.example.comSSLEngine on
SSLCertificateFile "C:/xampp/apache/conf/ssl.crt/server.crt" SSLCertificateKeyFile "C:/xampp/apache/conf/ssl.key/server.key"
DocumentRoot "C:/xampp/htdocs"</VirtualHost>
Replace example.com with your domain.
Use forward slashes in Apache’s Windows paths. The configuration filename is httpd-ssl.conf, not httpd-ssl.cfg.
Also verify that the following line is enabled in:
C:\xampp\apache\conf\httpd.confInclude conf/extra/httpd-ssl.confRemove the leading # if the line is commented out.
5. Test the configuration
Before restarting Apache, run:
C:\xampp\apache\bin\httpd.exe -tApache should respond with:
Syntax OKIf an error is displayed, correct it before restarting Apache.
6. Restart Apache
Stop and start Apache using the XAMPP Control Panel. Then visit:
https://example.comVerify the installation with the Qualys SSL Labs Server Test.
Under Certificates provided, the report should normally show at least two certificates. If it shows only one and reports “Chain issues: Incomplete”, verify that server.crt contains both certificate.crt and ca_bundle.crt.
7. Renew the certificate
Free certificates usually have a limited validity period. Renew the certificate before it expires.
After renewal:
- create a new
server.crtfrom the newcertificate.crtandca_bundle.crt; - replace the existing certificate and private-key files;
- test the Apache configuration;
- restart Apache;
- run another SSL Labs test.
Never reuse an old ca_bundle.crt without checking whether the certificate authority supplied a newer one.
Doctor Joomla is a project of Cloudfaction, a Dutch agency building and maintaining Joomla sites since 1999. The articles are made with the help of AI, so tell us if something does not match your screen. Mail info@cloudfaction.nl if you want someone to look at yours.