Let's Encrypt
Posted by: StephanK (47.205.173.---)
Date: January 03, 2024 01:06PM

Wampserver 3.3.3

I have enabled HTTPS, and it works with the self-generated certificates. I have multiple virtual hosts.

I would love to use Let's Encrypt to generate the certificates. I have use it before on a different server so I will figure it out. I want to generate one certificate, including all subdomains.

How do I best do that? I am afraid that changes that I make will be overridden by Wamp if I ever add a virtual host etc.

And tips?



Edited 1 time(s). Last edit at 01/03/2024 01:10PM by StephanK.

Options: ReplyQuote
Re: Let's Encrypt
Posted by: Otomatic (Moderator)
Date: January 03, 2024 01:58PM

> I would love to use Let's Encrypt to generate the certificates.

I'll be eternally grateful to anyone who manages to use Let's Encrypt or another free certificate generator on a local site!

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Let's Encrypt
Posted by: StephanK (---.biz.spectrum.com)
Date: January 03, 2024 02:30PM

From your response I guess I must have used the wrong terminology. I hope you still understand what I am trying to do.

Options: ReplyQuote
Re: Let's Encrypt
Posted by: Otomatic (Moderator)
Date: January 03, 2024 02:55PM

A site certificate is systematically created for each local site, whether subdomains or not.

You can look at the command lines to do this:
- For the creation of the self-signed certificate, i.e. the "Wamp settings, Wampserver ready to support https" section, in the wamp64\scripts\switchWampParam.php file, lines 319 to 363.
Prior to this, the files wamp64\bin\apache2.4.58\conf\openssl.cnf and wamp64\bin\apache2.4.58\conf\extra\httpd-ssl.conf were replaced/modified.

- Site certificates are created in the wamp64\scripts\changeToHttps.php file, lines 55 to 89.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Let's Encrypt
Posted by: StephanK (47.205.173.---)
Date: January 03, 2024 03:19PM

Okay, let me put this in other words.

Instead of using self-signed certificates, I want to use ones signed by Let's Encrypt. I know how to generate and update them.

I just want to avoid messing with the Wamp configuration, so my changes to not get overwritten by Wamp.

Any tips?

Options: ReplyQuote
Re: Let's Encrypt
Posted by: Otomatic (Moderator)
Date: January 03, 2024 03:42PM

> I just want to avoid messing with the Wamp configuration, so my changes to not get overwritten by Wamp.

In this case, you need to do everything "by hand" and not validate "Wamp settings, Wampserver ready to support https".

You can even prevent this option from appearing by setting, in the wampmanager.conf file in the [options] section
httpsReady = "off
UseWampHttps = "off

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Let's Encrypt
Posted by: StephanK (47.205.173.---)
Date: January 03, 2024 04:06PM

Thanks.

Is there any better way you can recommend?

Options: ReplyQuote
Re: Let's Encrypt
Posted by: Otomatic (Moderator)
Date: January 03, 2024 04:37PM

Keep http VirtualHosts on port 80, so always create http VirtualHosts before creating them on https port 443.

I don't know if this is the best way, but it works.

The Apache documentation on this subject specifies that you need both VirtualHost, one on port 80 and the other on port 443.
We can read in the file wamp64/bin/apache/apache2.4.58/conf/extra/httpd-ssl.conf
# This is the Apache server configuration file providing SSL support.
# When we also provide SSL we have to listen to the
# standard HTTP port and to the HTTPS port
To avoid, as they say in my house, mixing wipes and towels, the VirtualHost port 80 are defined in the httpd-vhosts.conf file and the VirtualHost https port 443 are defined in the httpd-ssl.conf file.

Don't forget to uncomment the lines in the httpd.conf file:
Include conf/extra/httpd-ssl.conf
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
LoadModule ssl_module modules/mod_ssl.so

Then, you can put the certificates wherever you like, as the paths are defined in the https-ssl.conf file.

There's no need to copy them into the Windows certificate store, it works in https without doing so.

You'll find examples of the files in the c:\wamp64\scripts\httpsFiles\ folder.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Let's Encrypt
Posted by: StephanK (47.205.173.---)
Date: January 04, 2024 08:14PM

Thanks. I have it all running!

Where do I find this setting:

.well-known
xxx
xxx
xxx
xxx

These are your folders in c:/wamp64/www
To use them as an http link, you must declare them as VirtualHost.
However, you can use Right-Click, Wamp Settings, Warning: risky..., Allow links on projects...

Options: ReplyQuote
Re: Let's Encrypt
Posted by: diepeter (---.dip0.t-ipconnect.de)
Date: January 05, 2024 07:48AM

Hello StephanK,

I'm contacting you on this topic because it's been on my mind for a while.

So far I have used the Wampser-ssl-auto-config tool from: [github.com]

used. Your method seems more effective and elegant to me because the connection can also be updated via https:// and the certificates can be renewed. This also works with the above tool, but not with every virtual host and must then be redirected via .htaccess.

Can you please send me step-by-step instructions on how to implement the method you have chosen?

With best wishes for 2024 remains

Peter

Translated with DeepL.com (free version)

Options: ReplyQuote
Re: Let's Encrypt
Posted by: Otomatic (Moderator)
Date: January 05, 2024 10:18AM

Hi,

> Where do I find this setting:

Right-Click -> Wamp settings -> Caution! Risky! Only for expert -> Allow links on projects

Selecting this option will display, on the Wampserver home page 'http://localhost/', under the heading "Your projects", links to your folders in the wamp64/www/ folder.
For example, if you have a wamp64/www/project1/ folder, there will be a link 'http://localhost/project1/' and, if there is an index.php file in this folder, it will be executed.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Let's Encrypt
Posted by: StephanK (47.205.173.---)
Date: January 05, 2024 01:47PM

Thanks, Otomatic.


That was too simple. ;-)

(I had misunderstood what the message would handle. I thought it would handle the error of the .well-known not being a project. But I will relocate that folder.)

Options: ReplyQuote
Re: Let's Encrypt
Posted by: StephanK (47.205.173.---)
Date: January 05, 2024 02:21PM

Peter, I am still working on it. One I have it all nice, I will post it.

Options: ReplyQuote
Re: Let's Encrypt
Posted by: diepeter (---.dip0.t-ipconnect.de)
Date: January 05, 2024 06:07PM

Thanks Stephan - it just works differently for me too ;-)

Options: ReplyQuote


Sorry, only registered users may post in this forum.