WAMPServer Upgrade to 3.3.1, Port 443 not binding?
Posted by: darthpathos42 (---.beanfield.net)
Date: February 23, 2023 06:04PM

Hi all,

I've upgraded WAMP Server this morning to 3.3.1 and now I'm getting errors that Port 443 is no longer binding and that the name of the default server must be localhost. I think I have configured everything properly (but obviously not). NOTE: Everything worked, including port 443, before I upgraded, so I'm not sure what would have changed.

I'm on Windows 2019, this server is only running Apache 2.4.27 (database is on a separate server). Running WAMP 64 bit and my WAMP Icon is RED.

httpd-vhosts (I've removed/anonymised the info):
# Virtual Hosts
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

<VirtualHost *:443>
DocumentRoot "${INSTALL_DIR}/www/application"
ServerName application.orgname.ca
ServerAlias [website.ca]
SSLEngine on
SSLCertificateFile "C:/wamp64/bin/apache/apache2.4.27/conf/certificate.crt"
SSLCertificateKeyFile "C:/wamp64/bin/apache/apache2.4.27/conf/certificate.key"
SSLCertificateChainFile "C:/wamp64/bin/apache/apache2.4.27/conf/DigiCertCA.crt"
Redirect /secure [website.ca]
RewriteEngine On
RewriteRule (.*) []%{SERVER_NAME}/$1 [R,L]
<Directory "${INSTALL_DIR}/www/application">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride all
Order allow,deny
Require all granted
Allow from all
</Directory>
</VirtualHost>

Here's the LISTEN portion of httpd.conf:
Listen 0.0.0.0:80
Listen [::0]:80
Listen 0.0.0.0:443
Listen [::0]:443

And my httpd-ssl.conf has

Listen 443

I've tried deleting the Listening Port 443 through the WAMP Menu but I get an error (which just says it can't be completed).

Syntax Check for Apache is OK, and no errors come up in the WAMP Menu.

Windows Event Viewer is giving me:
>>> (OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : AH00072: make_sock: could not bind to address [::]:443
.


What else am I missing?
Chris



Edited 2 time(s). Last edit at 02/23/2023 06:06PM by darthpathos42.

Options: ReplyQuote
Re: WAMPServer Upgrade to 3.3.1, Port 443 not binding?
Posted by: Otomatic (Moderator)
Date: February 23, 2023 08:59PM

Hi,

Apache does not support having multiple Listen on the same IP:port.

Remove:
Listen 0.0.0.0:443
Listen [::0]:443
from httpd.conf and put them only in httpd-ssl.conf.

and move the VirtualHost port 443 from httpd-vhosts.conf to httpd-ssl.conf.

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



Edited 1 time(s). Last edit at 02/24/2023 08:59AM by Otomatic.

Options: ReplyQuote
Re: WAMPServer Upgrade to 3.3.1, Port 443 not binding?
Posted by: Otomatic (Moderator)
Date: February 24, 2023 10:13AM

Hi,

Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride all
Order allow,deny
Require all granted
Allow from all
Why use Apache 2.2 directives (Order..., Allow...) with Apache 2.4?
There is no point except to create problems.
The Require directives are sufficient and allow all the possibilities you want.

On the other hand:

For https, the Apache listening port must not only be port 443, but also port 80.
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.xx/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.

So you need to add a VirtualHost port 80 (ServerName application.orgname.ca) in httpd-vhost.conf.
And, if you want to force https mode, in this VirtualHost port 80, before <Directory...>, you insert:
  <IfModule ssl_module>
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^ 'https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]'
  </IfModule>
Without quotes ' on line 03. If you don't put the quotes, it becomes a link on the forum!

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



Edited 1 time(s). Last edit at 02/24/2023 10:19AM by Otomatic.

Options: ReplyQuote


Sorry, only registered users may post in this forum.