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.

  1. Navigate to /etc/apache2/conf.d and open the ports.conf file in an editor.
  2. Locate the <IfModule mod_ssl.c> block.
  3. Ensure Listen 443 is included in the block.
  4. Add NameVirtualHost *:443 to the block.
  5. Save the configuration file.