issue with vhosts file when swapping Apache versions
Posted by: kozno999 (---.res.spectrum.com)
Date: March 06, 2024 05:34PM

Hello

I have Wampserver 3.3.3 along with Apache 2.4.46 and 2.4.58.1

httpd-ssl.conf in both Apaches is vanilla except for change to point to my own document root directory and SSL cert and key directory.

httpd-vhosts.conf has a default VirtualHost *:80 at the top and then a whole bunch of VirtualHost *:443 following, all also using my own document root directory.

According to Wampserver "tools" Apache is listening to port 80. The tools wont allow me to add port 443

The issue I have is that when I swap from one Apache to the other I get the dialog that the two vhost files are different even when they aren't, and if I just hit Enter which is supposed to be "no changes" the vhosts file in the "new" apache gets altered or overwritten, with all the port *.443 replaced with *:80

Of course it is easy to just change it back the way it should be and restart Apache, but it is irritating.

What have I got configured wrong?

Thanks.

Options: ReplyQuote
Re: issue with vhosts file when swapping Apache versions
Posted by: Otomatic (Moderator)
Date: March 07, 2024 08:56AM

Hi,

VirtualHost port 80 must be in file: wamp64\bin\apache\apache2.4.58.1\conf\extra\httpd-vhosts.conf

VirtualHost port 443 must be in file: wamp64\bin\apache\apache2.4.58.1\conf\extra\httpd-ssl.conf

And both files must exist, even if they are the same VirtualHost. At the beginning of the httpd-ssl.conf file, it says:
# 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
See how https support is handled by Wampserver itself:
Right-click -> Help -> Wampserver HTTPS mode help

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

Options: ReplyQuote
Re: issue with vhosts file when swapping Apache versions
Posted by: kozno999 (---.res.spectrum.com)
Date: March 08, 2024 04:21AM

Hello thank you

I removed all the :443 and other SSL lines from my httpd-vhosts file and now all my vhosts work fine on post 80.

I also followed the Help -> Wampserver HTTPS mode help instructions and turned on the Wamp Settings -> Wampserver ready to support https checkmark, which it looks like to me replaced the standard Apache httpd-ssl.conf with a much shorter version with some special settings. Including pointing to wamp64/bin/Certs for where to find certs apparently. Although there are no certs in any directory but Cacerts.

At this point the help says all I have to do is switch a vhost to https mode with Left-click -> Your VirtualHosts -> HTTPS mode for VirtualHost. If I do that I get a warning in a PHP(?) warming box that "The port used (443) for the virtualhost xx.yyy is not from a Define Apache variable" and if go ahead and hit enter to continue my https vhost does not work with ERR_SSL_PROTOCOL_ERROR.

So what exactly is supposed to happen when I "switch a vhost to https mode"? And should I be adding server certs and keys somewhere (and what name)? And/or do I manually need to add a :443 vhost definition in httpd-ssl to mirror every single vhost in httpd-vhosts? And if I do put certs somewhere in /bin/Certs how is that going to work when I swap Apaches, because in my experience the two versions need separate certs generated from the version of OpenSSL that comes with them.

And finally, is this whole process documented somewhere so I don't have to bother you more, because I can't seem to find it with Google search. Would be really great if I could get it to work like it seems like it should, just telling WAMP to make an existing port 80 vhost into https with just one click.

Thank you.

Options: ReplyQuote
Re: issue with vhosts file when swapping Apache versions
Posted by: Otomatic (Moderator)
Date: March 08, 2024 09:29AM

Hi,

The procedure for switching to HTTPS mode is the automation of : How to activate https SSL in Wampserver

The process for switching to HTTPS mode comes from reading the Apache documentation (see my signature) and various explanations in the ApacheLounge forums.

With this procedure, changing Apache version poses no problem, as you can copy configurations - httpd-vhosts.conf, openssl.cnf, httpd-ssl.conf, loaded modules, includes - from one Apache version to another. Of course, as long as you change Apache version via the Wampmanager menus.

I can't say any more about this, I'm not an Apache specialist, just a curious user.

I can just add that the templates for the various files or VirtualHost https are in the folder: wamp64\scripts\httpsFiles\

And, as I wrote :

Procedure compiled from comparisons and tests of various documentations and explanations including those of Artemus24 on its website [www.jcz.fr].
For all intents and purposes, here's my own procedure for using https ssl locally.
This is an English translation from my French procedure, and there might be some misunderstandings.
It may not be the best method and there may be redundancies and/or extra stuff, but :
This procedure works and has been tried for Apache 2.4.37 to 2.4.57 in 64 bits

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



Edited 1 time(s). Last edit at 03/08/2024 09:37AM by Otomatic.

Options: ReplyQuote
Re: issue with vhosts file when swapping Apache versions
Posted by: kozno999 (---.res.spectrum.com)
Date: March 08, 2024 02:31PM

Thank you.

Options: ReplyQuote


Sorry, only registered users may post in this forum.