Click to See Complete Forum and Search --> : NameVirtualHost


BrickEmployee
09-18-2003, 04:01 PM
Hi there!!

I'm trying to setup my first namevirtualhost, and my httpd.conf is:

NameVirtualHost 127.0.0.1

<VirtualHost mydomain1.com>

DocumentRoot /var/www/mydomain1/
ServerName www.mydomain1.com
ServerAlias mydomain1.com

</VirtualHost>

<VirtualHost mydomain2.com>

DocumentRoot /var/www/mydomain2
ServerName www.mydomain2.com
ServerAlias mydomain2
</VirtualHost>

But when I try to browse mydomain1 or mydomain2 it apears the default apache html file

my documentroot is set to /var/www/html where that file is

Question: It's because of that??

I'm using a dynamic ip but i've got the redirect to my machine using a service of dynamic dns (zoneedit)
and everything works fine for one domain but i want to serve my 2 domains.

Can you help-me with this???

Thks,
./brickemployee

blizz
09-18-2003, 07:31 PM
Never used zoneedit but you can try these changes to change your httpd.conf file:

BindAddress *

NameVirtualHost *

and then:

<VirtualHost *>
DocumentRoot /var/www/mydomain1/
ServerName www.mydomain1.com
ServerAlias mydomain1.com
</VirtualHost>

and maybe set the 'Listen' directive to:

Listen *:80

BrickEmployee
09-18-2003, 08:37 PM
Thanks for the help!!!

But!! it does not work.

When i put
Namevirtual host *
the error is:

Starting httpd: [Fri Sep 19 01:23:33 2003] [warn] VirtualHost 127.0.0.1:0 overlaps with VirtualHost 127.0.0.1:0, the first has precedence, perhaps you need a NameVirtualHost directive
[Fri Sep 19 01:23:33 2003] [error] VirtualHost _default_:443 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results

but if i put 127.0.0.1
I have no errors, but he loads the apache "welcome" page, in each domain. /var/www/html/index.html

It's strange because it seems to me that he doesn't recognize the entries in nameirtualhost.
And the name virtualhost directive already exists.

By the way, why not use ZoneEdit???

I'm new in this things!!!

Thanks once again

freemansweb
09-18-2003, 09:19 PM
Remove all references to '127.0.0.1' or make sure they are commented out with a '#'. Use blizz's example and add 'port 80'. Then restart your server.

Zoneedit has a good product, I think blizz simply meant he'd not used them. The DNS you have with them is working, if it wasn't, you would not see your site at all.