Differences between revisions 2 and 3
Revision 2 as of 2007-12-13 13:10:33
Size: 1521
Editor: jink
Comment:
Revision 3 as of 2009-09-20 22:13:34
Size: 1521
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

# make apache listen to the right ports and bind it to the ips you want it to listen on:

Listen 10.1.1.1:80
Listen 10.1.1.1:443
Listen 10.1.1.2:80
Listen 10.1.1.2:443

# SSL can't do name based virtualhosting, only ip based, so no need for them here
# make the http ports name based virtualhosts:

NameVirtualHost 10.1.1.1:80
NameVirtualHost 10.1.1.2:80


# define a catch-all virtualhosts for non-listed servernames.
# this site could have a page saying: "No site configured at this address"

<VirtualHost 10.1.1.1:80>
  ServerName 10.1.1.1.domain.com
  DocumentRoot /path/to/catchall
</VirtualHost>

<VirtualHost 10.1.1.2:80>
  ServerName 10.1.1.2.domain.com
  DocumentRoot /path/to/catchall
</VirtualHost>


# now the real virtualhosts:

<VirtualHost 10.1.1.1:80>
  ServerName www.A.com
  DocumentRoot /path/to/www.A.com
</VirtualHost>

<VirtualHost 10.1.1.1:80>
  ServerName sub.A.com
  DocumentRoot /path/to/sub.A.com
</VirtualHost>

# next ip

<VirtualHost 10.1.1.2:80>
  ServerName www.B.com
  DocumentRoot /path/to/www.B.com
</VirtualHost>

<VirtualHost 10.1.1.2:80>
  ServerName sub.B.com
  DocumentRoot /path/to/sub.B.com
</VirtualHost>


# SSL hosts:

<VirtualHost 10.1.1.1:443>
  ServerName secure.A.com
  DocumentRoot /path/to/secure.A.com
  # SSL options, like certificates
</VirtualHost>

<VirtualHost 10.1.1.2:443>
  ServerName secure.B.com
  DocumentRoot /path/to/secure.B.com
  # SSL options, like certificates
</VirtualHost>

VirtualHostsOnMultipleIPs (last edited 2009-09-20 22:13:34 by localhost)