1. Knowledge base
  2. Initial Setup
  3. Install Let’s Encrypt with Apache 2.4 on…

Install Let’s Encrypt with Apache 2.4 on Windows Server 2019

Updated on 17 September 2020 4 min read Snel.com support team

Introduction

In this article, we will help you to configure a Let’s Encrypt client on Windows Server 2019 and how you can enable and configure your SSL certificate on your Apache webserver.

Prerequisites

  • VPS or Dedicated Server with Windows Server 2019 installed.
  • You must be logged in via Remote Desktop Protocol as an administrative user.
  • Installed Apache 2.4 in C:\Apache24
  • A domain name pointed towards your VPS or Dedicated server. In this tutorial, we will use s30426.hosted-by-snel.com. Replace all occurrences of s30426.hosted-by-snel.com with your actual domain name.

Log in with RDP into Windows Server 2019

Connect to your server with the login credentials which you can find in your client area.

Download Let’s Encrypt client

We will use Win-acme for issuing an SSL certificate. Visit the website of Win-acme to download the latest version. Extract the download zip to C:\win-acme

Run Win-acme Let’s Encrypt client

Start wacs with administrator permission. If Microsoft Defender SmartScreen is enabled it will ask your permission.

win smartscreen

Click on More info . A new button will appear and click on Run anyway.

run anyway

Win-acme will start

win-acme

Create a batch file

Create the following filename C:\win-acme\Scripts\RestartApache.bat

Code
net stop "Apache2.4" & sc start "Apache2.4"

Issue certificate

Enter M in the command prompt en hit enter.

win-acme m

Choose manual input in our situation, it’s option 1. 

Info

Manual-input can be a different number in your setup

win-acme 1

Enter the domain name where you want to issue a certificate. In our article it’s: s30426.hosted-by-snel.com

s30426

It will ask you for a friendly name, we leave it blank. Hit enter to continue.

friendlyname

It will ask how you want to verify that you are the owner of that domain. In our case, s30426.hosted-by-snel.com is already pointing to our server and is active in Apache. In our setup, we choose option 1 [http-01] Serve verification files on (network) path.

verify domain

Since we have chosen network path it will ask us for a path, in our case its C:\Apache24\htdocs

network path

It will ask you if you want to copy the default web.config before validation. We choose N

copywebconfig

It will what type of private key we want. We will choose option 2 RSA key as a private key.

privatekeyrsa

Since we want to use the SSL certificate on our Apache webserver we will choose option 2 PEM encoded files (Apache, nginx, etc.) and hit enter. Once PEM is selected it will ask you where to store those files. In our case it’s C:\Apache24\conf.

apacheconf

We do not want to store it another way and we select option 3 No (additional) store steps and hit enter.

nostore

Once the new certificate is saved we do want to perform an extra step and choose for option 3 Start external script or program. It will ask the script path that you want to run after renewal C:\win-acme\Scripts\RestartApache.bat. 

restartbat

Enter the following {StoreType} {StorePath} {RenewalId}. Once this is entered it will ask where you want to receive notification and fill in your email address.

default

It will ask you if you want to open in default application choose for N and accept the terms with Y.

agreeterms

Run the task under a specific user, since it requires a user with administrator permissions.

permissionadmin

Enable SSL if it’s not enabled yet

If SSL is already enabled for your Apache webserver you can continue to step 7. Open the httpd configuration file C:/Apache24/conf/httpd.conf.  In the httpd.conf file changes the following lines by removing the comment sign #:

Code
Loadmodule ssl_module modules/mod_ssl.soInclude conf/extra/httpd-default.confInclude conf/extra/httpd-ssl.conf

Do an Apache configuration file check. Start command prompt with administration permission. Run de following command:

Code
cd C:\Apache24\bin httpd.exe -t

The output should give Syntax OK if there is no error in the configuration file.

Configure SSL for the newly issued certificate.

Open the httpd-ssl configuration file located here C:/Apache24/conf/extra/httpd-ssl.conf.

Change the SSLCertificateFile:

Code
SSLCertificateFile "${SRVROOT}/conf/server.crt"

with

Code
SSLCertificateFile "${SRVROOT}/conf/s30426.hosted-by-snel.com-chain.pem"

Change the SSLCertificateKeyFile :

Code
SSLCertificateKeyFile "${SRVROOT}/conf/server.key"

with

Code
SSLCertificateKeyFile "${SRVROOT}/conf/s30426.hosted-by-snel.com-key.pem"

Change the SSLCipherSuite:

Code
SSLCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DESSSLProxyCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES

with

Code
SSLCipherSuite ECDH+AESGCM256:ECDH+CHACHA20:DH+AESGCM256:ECDH+AES256:DH+AES256:!aNULL:!MD5:!DSSSSLProxyCipherSuite ECDH+AESGCM256:ECDH+CHACHA20:DH+AESGCM256:ECDH+AES256:DH+AES256:!aNULL:!MD5:!DSS

Change SSL protocol

Code
SSLProtocol all -SSLv3SSLProxyProtocol all -SSLv3

With

Code
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1SSLProxyProtocol all -SSLv3 -TLSv1 -TLSv1.1

Change VirtualHost

Code
#   General setup for the virtual hostDocumentRoot "${SRVROOT}/htdocs"ServerName www.example.com:443ServerAdmin [email protected]ErrorLog "${SRVROOT}/logs/error.log"TransferLog "${SRVROOT}/logs/access.log"

With

Code
#   General setup for the virtual hostDocumentRoot "${SRVROOT}/htdocs"ServerName s30426.hosted-by-snel.com:443ServerAdmin <[email protected]>ErrorLog "${SRVROOT}/logs/error.log"TransferLog "${SRVROOT}/logs/access.log"

Save the changes. Re-check the Apache configuration on the command prompt. Start command prompt with administration permission. Run de following command:

Code
cd C:/Apache24/binhttpd.exe -t

If everything is OK. Restart Apache webserver via command prompt. Start command prompt with administration permission. Run de following command:

Code
cd C:/Apache24/binhttpd -k restart

Verify that SSL is working

Visit the website on your browser: https://s30426.hosted-by-snel.com

Conclusion

In this article, we described how you can install a Let’s Encrypt client a configure Apache webserver on Windows to use the issues SSL certificate.

Was this article helpful?

Spot a mistake in this article? Email us at support@snel.com

This article was last checked on 17 September 2020. · 43,446 views

Your own VPS online within 2 minutes

Windows or Linux, root access and hosted in Rotterdam.

View VPS from € 6.99

Support

Can't figure it out? We are happy to help

You always talk to a real engineer. We typically respond within 15 to 30 minutes, and 24/7/365 for outages.

Call us

+31 88 3 088 099

Create a ticket

Through the client area we immediately see which service it is about.

Email us

Send your question via the contact form, also outside office hours.