Newbie - Virtualhosts

This is a discussion on Newbie - Virtualhosts within the Apache Web Server forums, part of the Web Server and Related Forums category; My setup Latest ver of apache for Windows (2000), firewall forwarding TCP:80 to 192.168.0.50 (my apache ...


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 10-30-2003
daz
 
Posts: n/a
Default Newbie - Virtualhosts

My setup

Latest ver of apache for Windows (2000), firewall forwarding TCP:80 to
192.168.0.50 (my apache server)

When I goto www.domain1.com I get my test page, but if I goto
domain2.net I also get domain1's test page and vice-versa with other
test files. Another test I did was to stick in phpinfo.php into
domain2's data directory (not in domain1's) and went to
www.domain2.net/phpinfo.php and it came up, why is this?

Port 80

NameVirtualHost 192.168.0.50

<VirtualHost *>
DocumentRoot /usr/local/www/data/domain1
ServerName domain1.com
</VirtualHost>

<VirtualHost *>
DocumentRoot /usr/local/www/data/domain2
ServerName domain2.net
</VirtualHost>



It's driving me mad, please help!
Many thanks
Daz
  #2 (permalink)  
Old 10-30-2003
Davide Bianchi
 
Posts: n/a
Default Re: Newbie - Virtualhosts

daz <dazno1@aol.com> wrote:
> NameVirtualHost 192.168.0.50


Use * instead of the IP address

> <VirtualHost *>
> DocumentRoot /usr/local/www/data/domain1
> ServerName domain1.com
> </VirtualHost>


> <VirtualHost *>
> DocumentRoot /usr/local/www/data/domain2
> ServerName domain2.net
> </VirtualHost>


You should add a <Directory -therootdirhere-> in each VirtualHost.

Davide
  #3 (permalink)  
Old 10-30-2003
daz
 
Posts: n/a
Default Re: Newbie - Virtualhosts

Thanks for the info Davide your a star!

I've bought 2 apache books for help and search the newsgroups, is it
possible you can give me an example of how to use the <Directory>
command? I only installed Apache yesterday and an finding it more
better than clunky iis!



Daz
  #4 (permalink)  
Old 10-30-2003
Davide Bianchi
 
Posts: n/a
Default Re: Newbie - Virtualhosts

daz <dazno1@aol.com> wrote:
> possible you can give me an example of how to use the <Directory>
> command?


Check your httpd.conf, there should be already a preconfigured
<Directory > section in there. This is just an example, tweek and
twist at your will:

<Directory /here/put/your/docrootdirectory/path>
Options -Indexes
OptionOverride All
Order allow,deny
Allow from all
</Directory>

Davide
  #5 (permalink)  
Old 10-30-2003
daz
 
Posts: n/a
Default Re: Newbie - Virtualhosts

Thanks for the info Davide


I've managed to get it working from an internal workstation from the
firewall but outside requests don't work, feels like i'm loosing the
battle here..!

I'm allowing in TCP & UDP packets to my internal address but it
doesn't work :(

It seems apache is taking the first virtual host from the list of the
3 to use as the default?


Daz
  #6 (permalink)  
Old 10-31-2003
Davide Bianchi
 
Posts: n/a
Default Re: Newbie - Virtualhosts

daz <dazno1@aol.com> wrote:
> It seems apache is taking the first virtual host from the list of the
> 3 to use as the default?


If he can't understand which VHost you want (because the request is
mangled) he will use the first VHost. If this happen only from outside
and not from your internal network, it's possible that the problem is
in the firewall/router performing NAT and mangling the request.

Davide
 
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 11:56 PM.


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