WTServer - Nginx MariaDB Redis Php development stack for Windows

A lightweight, fast and stable server stack for developing php mysql applications on windows, based on the excellent webserver Nginx. A lighter alternative to XAMPP and WAMP.

How to enable HTTPS using free SSL Certificates from LetsEncrypt

WTServer includes ACME PHP, a simple CLI client for Let's Encrypt certificate authority, witch will allow you, in a few steps, to get and renew a trusted HTTPS certificate for any domain, freely and easily.

In order to install free SSL Certificates, you need average network administration skills. This document is not intended for beginners.

1. Create a new WTServer Project

New Project

2.1. Configure your router

If the computer with WTServer is behind a router, forward the external ports 80 and 443 to that computer.

2.2. Configure Dynamic DNS

If your hosting provider assigns you a dynamic IP Address, configure a Dynamic DNS service like changeip.com on your computer or on your router.

    myDynDns.changeip.com.  --->   WTServer

2.3. Optionally, use your own domain name

You'll need to own a domain like myDom.com. You can buy one from any Domain Name Registrars

Edit the DNS settings for your domain, usually on your Registrar's website, and choose a hostname like dev.myDom.com, and

If you skip this step, and you only want to use your Dynamic DNS hostname, just replace below dev.myDom.com with myDynDns.changeip.com

3. Allow access from LAN and Internet to your local project:

Edit WTServer\conf\domains.d\myProject.conf directly or go to Project Setup and click on Edit Nginx Local Virtual Server Configuration File icon.

Edit Nginx Local Virtual Server

Modify like this:

server {
    listen          *:80;
    listen          *:443 ssl;

    server_name     myProject.test;
    server_name     dev.mydom.com;
    server_name     myDynDns.changeip.com;

    ### Commented for now:
    ## ssl_certificate      .acmephp/master/certs/dev.mydom.com/fullchain.pem;
    ## ssl_certificate_key  .acmephp/master/private/dev.mydom.com/private.pem;

    ### Access Restrictions
    allow           all;
    ## deny         all;

Apply changes: Kill Nginx, Check Nginx Configuration Syntax, Start Nginx

Test HTTP: access in your browser http://dev.mydom.com and make sure it points to your project

4. Run ACME PHP:

Open a command prompt by clicking the corresponding WTServer Manager icon.

Follow the instructions from the original ACME PHP Documentation, but use the command acmePhp instead of php acmephp.phar

Register your account key in Let's Encrypt - Only once !

acmePhp register myemail@example.org

Generate an authorization token for the domain "dev.myDom.com"

acmePhp authorize dev.myDom.com

Publish the authorization token in the project`s directory This step is implemented and available only on WTServer

acmePhp publish dev.myDom.com myProject

Ask the server to check your proof

acmePhp check dev.myDom.com

Get the certificate!

acmePhp request dev.myDom.com

To renew, re-run acmePhp request -q -n dev.myDom.com. For more information run

acmePhp help request

5. Enable SSL Certificates:

Edit WTServer\conf\domains.d\myProject.conf and uncomment ssl_certificate..:

    ssl_certificate         .acmephp/master/certs/dev.mydom.com/fullchain.pem;
    ssl_certificate_key     .acmephp/master/private/dev.mydom.com/private.pem;

Apply changes, then Test HTTPS: go to https://dev.mydom.com