logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Virtual Host
Author
svfusion



Joined: 12 Oct 2007
Posts: 5

PostPosted: Fri 12 Oct '07 15:56    Post subject: Virtual Host Reply with quote

I am trying to host two websites on the same apache server. Is this the right conf?

NameVirtualHost 68.209.199.83

<VirtualHost 192.168.0.140>
ServerName www.fusionlan.com
DocumentRoot /www/fusionlan
</VirtualHost>

<VirtualHost 192.168.0.140>
ServerName www.gibsonl33tz.com
DocumentRoot /www/gibsonl33tz
</VirtualHost>

Thanks!
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Wed 31 Oct '07 11:03    Post subject: Reply with quote

it won't work to mix external and internal IPs.

For more working examples please see
http://httpd.apache.org/docs/2.2/en/vhosts/examples.html

You should use name based vhosts.

e.g. (do not remove the * from the examples and do not replace them

Code:

 NameVirtualHost *:80

<VirtualHost *:80>
 ServerName www.fusionlan.com
ServerAlias fusionlan.com  *.fusionlan.com
DocumentRoot /www/fusionlan
</VirtualHost>

<VirtualHost *:80>
ServerName www.gibsonl33tz.com
DocumentRoot /www/gibsonl33tz
</VirtualHost>


In this example there must be a DNS server Wink
Back to top


Reply to topic   Topic: Virtual Host View previous topic :: View next topic
Post new topic   Forum Index -> Apache