Virtual Hosts

This is a discussion on Virtual Hosts within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi, I'm trying to figure out how to point a request like this: http://foo.com to point at ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-08-2006
dcoleyoung@gmail.com
 
Posts: n/a
Default Virtual Hosts

Hi,

I'm trying to figure out how to point a request like this:

http://foo.com

to point at the document root for the virtually hosted site. Right now
this request goes back to my original DocumentRoot. How can I get this
request to go to the DocumentRoot listed in the virtual host?

Here is my virtual host for the site

<VirtualHost 192.168.1.106>
ServerAdmin foo@foo.com
DocumentRoot /var/www/foo
ServerName www.foo.com
ErrorLog /var/log/httpd/error_log
</VirtualHost>

I tried adding another virtual host ( ServerName *foo.com) to pick up
the missing "www" but it didn't work. Do I need an alias or another
virtual host maybe? I don't plan on using subdomains for the site.

Thanks

Dan

  #2 (permalink)  
Old 02-09-2006
Steve
 
Posts: n/a
Default Re: Virtual Hosts

On Wed, 08 Feb 2006 11:02:59 -0800, dcoleyoung wrote:

> Hi,
>
> I'm trying to figure out how to point a request like this:
>
> http://foo.com
>
> to point at the document root for the virtually hosted site. Right now
> this request goes back to my original DocumentRoot. How can I get this
> request to go to the DocumentRoot listed in the virtual host?
>
> Here is my virtual host for the site
>
> <VirtualHost 192.168.1.106>
> ServerAdmin foo@foo.com
> DocumentRoot /var/www/foo
> ServerName www.foo.com

ServerAlias foo.com
> ErrorLog /var/log/httpd/error_log
> </VirtualHost>
>
> I tried adding another virtual host ( ServerName *foo.com) to pick up
> the missing "www" but it didn't work. Do I need an alias or another
> virtual host maybe? I don't plan on using subdomains for the site.
>
> Thanks
>
> Dan

.... and make sure that foo.com resolves to 192.168.1.106 on the local
server.
  #3 (permalink)  
Old 02-09-2006
Daniel
 
Posts: n/a
Default Re: Virtual Hosts

Thank you. Worked like a charm. May good karma fall upon you.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:12 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0