Forum Moderators: phranque
Here is my order of includes...
Listen zzz.zzz.zz.zz:80
Listen yyy.yyy.yyy.yyy:80
NameVirtualHost zzz.zzz.zz.zz:80
NameVirtualHost yyy.yyy.yyy.yyy:80
<vhost1 zzz.zzz.zz.zz:80>
servername name.com
<vhost2 yyy.yyy.yyy.yyy:80>
servername name.com
<vhost3 yyy.yyy.yyy.yyy:80>
servername name.com
<vhost4 yyy.yyy.yyy.yyy:80>
servername name.com
My thinking is run as many one ip as shared
and assign certain ips to other domains that needs SSL
I need to run around 20 on a shared ip and 2 others on dedicated...
Can someone point me in the right direction for this setup?
any suggestions on what i'm doing wrong?
Thanks,
~RD
[edited by: RDWest2005 at 9:50 pm (utc) on Feb. 16, 2008]
#
# Make Apache listen on the proper ip addresses and ports
Listen zzz.zzz.zz.zz:80
Listen yyy.yyy.yyy.yyy:80
#
# Define which ip address and port combinations will need name based virtual hosting enabled. When enabled and Apache receives a request, it tries to match the http Host header with the ServerName and ServerAlias directives from each VirtualHost, when failed, it will match it to the first VirtualHost in the "group". When it is disabled, the Apache will not do any matching, it will serve the request using the (hopefully) only one VirtualHost in the "group". With the "group" I mean one or more VirtualHosts which are bound to the same ip address and port combinations.
NameVirtualHost zzz.zzz.zz.zz:80
NameVirtualHost yyy.yyy.yyy.yyy:80
#
# Default name based virtual host (group 1): example1.com
<VirtualHost zzz.zzz.zz.zz:80>
ServerName example1.com
</VirtualHost>
#
# Default name based virtual host (group 2): example2.com
<VirtualHost yyy.yyy.yyy.yyy:80>
ServerName example2.com
</VirtualHost>
#
# Name based virtual host (group 2): example3.com
<VirtualHost yyy.yyy.yyy.yyy:80>
ServerName example3.com
</VirtualHost>
#
# Name based virtual host (group 2): example4.com
<VirtualHost yyy.yyy.yyy.yyy:80>
ServerName example4.com
</VirtualHost>
This will do the following:
If you intended to "bind" only one virtualhost (website) to the zzz.zzz.zz.zz ip address, then the NameVirtualHost zzz.zzz.zz.zz:80 is not needed. If you want to use more than two ip addresses (while keeping some reserved for certain websites, or ssl enabled websites), then you can add more (shared) name based virtualhosts as in the case of example[2-4].com, while the dedicated ones could look like the first virtualhost. For more information see the Apache Virtual Host documentation [httpd.apache.org]