IP Virtual Hosting and SSL

Giganews Newsgroups
Subject: IP Virtual Hosting and SSL
Posted by:  Shu-Wai Chow (sch…@macnexus.org)
Date: Fri, 07 Mar 2008

Hi, I have two IP addresses that I would like to use for two different
sites, a production and a dev site, on one apache instance.  Both sites
need to support http and https.

This is how I have my httpd.conf configured:

Listen 1.1.1.1:80
Listen 1.1.1.1:443
Listen 2.2.2.2:80
Listen 2.2.2.2:443

NameVirtualHost 1.1.1.1:80
NameVirtualHost 1.1.1.1:443
NameVirtualHost 2.2.2.2:80
NameVirtualHost 2.2.2.2:443

<Directory "/var/www/html">
  AllowOverride All
</Directory>

<VirtualHost 1.1.1.1:80>
  ServerName www.mysite.com
  DocumentRoot /var/www/html
</VirtualHost>

<VirtualHost 1.1.1.1:443>
       ServerName www.mysite.com
       DocumentRoot /var/www/html
</VirtualHost>

<Directory "/var/www-dev/html">
  AllowOverride All
</Directory>

<VirtualHost 2.2.2.2:80>
       ServerName dev.mysite.com
       DocumentRoot /var/www-dev/html
</VirtualHost>

<VirtualHost  2.2.2.2:443>
  ServerName dev.mysite.com
       DocumentRoot /var/www-dev/html
</VirtualHost>

(For Sections 1 and 2 of the httpd.conf file, it remains largely
untouched from the default.  One notable exception are the Listen
directives as listed above.)

When I start Apache, I get the following error:

>(98)Address already in use: make_sock: could not bind to address
>0.0.0.0:443
>no listening sockets available, shutting down
>Unable to open logs

Does anyone see anything blatantly wrong with the setup?  I thought the
Listen directives prevented binding to 0.0.0.0.  Any help would be
appreciated.  Thanks!

Replies