I'm running apache2 on Devuan Beowulf (~= Debian Buster), with the default configuration. In that configuration, I have:
in sites-available/default-ssl.conf
:
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
# etc etc.
in sites-available/default-000.conf
:
<VirtualHost *:80>
# etc etc.
and in sites-available/default-000.conf
:
Listen 80
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
How do I make it so that apache listens on port 80 for HTTP traffic and on ports 443 and, say, 1234, for HTTPS connections?
There are several tasks here:
default-ssl.conf
site is enabled (or whatever site conf you want to use for your HTTPS site)Here's how to do it (as root):
a2enmod ssl
(yes, there is such a utility)Listen 1234
right belowListen 443
inports.conf
a2ensite default-ssl
<VirtualHost _default_:443>
to<VirtualHost _default_:443 _default_:1234>
indefault-ssl.conf
.There's (at least) one problem with the above solution, though - somehow, magically, you can speak HTTP to the server on port 443.
Note: Don't insert
NameVirtualHost
lines; if you do, you'll get warnings saying: