RE: [users@httpd] Help with winxp virtual ip based hosting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If you have your own DNS server, then name-based virtual hosting should be very easy.  You just need to setup your DNS names to “point” to the same IP address (where Apache is running), then setup your httpd.conf file like this:

 

# required to allow name-based virtual hosting; can replace * with your Apache host’s IP

NameVirtualHost *

 

# first virtual host (siteone)

<VirtualHost *>

      ServerName www.siteone.com

      DocumentRoot "c:/websites/siteone/htdocs"

      TransferLog "c:/websites/siteone/logs/access.log"

      ErrorLog "c:/websites/siteone/logs/error.log"

</VirtualHost>

 

# redirect, incase client leaves off “www.”

<VirtualHost *>

      ServerName siteone.com

      Redirect / http://www.siteone.com/

</VirtualHost>

 

# second virtual host (sitetwo)

<VirtualHost *>

      ServerName www.sitetwo.com

      DocumentRoot "c:/websites/sitetwo/htdocs"

      TransferLog "c:/websites/sitetwo/logs/access.log"

      ErrorLog "c:/websites/sitetwo/logs/error.log"

</VirtualHost>

 

# redirect, incase client leaves off “www.”

<VirtualHost *>

      ServerName sitetwo.com

      Redirect / http://www.sitetwo.com/

</VirtualHost>

 

I’ve been using this type of configuration for a couple years now to host multiple web sites on one Apache server, and it hasn’t failed me yet.  I hope this helps.

 

James

 


From: Joshua Kogut [mailto:jmkogut@xxxxxxxxx]
Sent: Saturday, October 15, 2005 6:02 PM
To: users@xxxxxxxxxxxxxxxx
Subject: [users@httpd] Help with winxp virtual ip based hosting

 

I have wanted to set up a small Internet-like environment on my local LAN for testing purposes. The only problem is that none of my servers are happy with name-based virtual hosting. So, I figured out how to add an IP address in 

control panel>networkconnections>[lanconnection properties]>tcpip properties>advanced

My dns server (sans) is configured to direct all trafic to one of the correct IP for the server, but I am unsure as exactly how to set up the htttpd.conf file for my server. Help please. (Also, am I going in the right direction?)

--
||  jmkogut  ||
email: jmkogut@xxxxxxxxx
|| Networking: Where all your problems are category 5. ||


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux