Specify the ports referenced by the virtual hosts
A SSL web server must run on a different port than an unencrypted web server. The standard port for HTTPS traffic is 443, but any port number can be used. Apache will not accept incoming connections to any ports if they are not specified with a Listen <port_number>
directive in the active configuration set.
- Navigate to /etc/apache2/conf.d and open the ports.conf file in an editor.
- Locate the
<IfModule mod_ssl.c>
block. - Ensure
Listen 443
is included in the block. - Add
NameVirtualHost *:443
to the block. - Save the configuration file.