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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |