Click to See Complete Forum and Search --> : HELP VirtualHost 111.22.33.44


yogee
08-12-2001, 02:20 PM
Im a bit confused on the ip thing. The box has a private local static ip. Does the ip need to be my public ip? If so what happens when it changes? Does NameVirtualHost 12.34.56.78 ip have to be the same as <VirtualHost 111.22.33.44>?
I went to http://members.dyndns.org/ and setup 2 names and sent them to my public ip and now when i go to those names i get the default server page for both.

NameVirtualHost 12.34.56.78

<VirtualHost 111.22.33.44>
ServerName www.ggggggg.dyndns.org (http://www.ggggggg.dyndns.org)
DocumentRoot /home/www.ggggg.com/www
</VirtualHost>

<VirtualHost 111.22.33.44>
ServerName www.hhhhhhhhhh.dyndns.org (http://www.hhhhhhhhhh.dyndns.org)
DocumentRoot /home/www.hhhhhhhhh.com/www
</VirtualHost>

I changed all the address's to my public ip and the domains still resolve to the apache default page. I get this error when restarting apache too. Starting httpd: [Sun Aug 12 02:36:36 2001] [alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]

[ 12 August 2001: Message edited by: yogee ]

Damaged
08-13-2001, 04:09 AM
And you've restarted the process (i.e.HUPed httpd or apache)?

Oh, and those DNS entries you made may take awhile to propogate. Give it a day at least.

[ 13 August 2001: Message edited by: Damaged ]

Craig McPherson
08-29-2001, 01:30 AM
Do this:


NameVirtualHost *:80

<Virtualhost *:80>
ServerName server1.com
ServerAlias *.server1.com
DocumentRoot /var/www/server1
</VirtualHost>

<Virtualhost *:80>
ServerName server2.com
ServerAlias *.server2.com
DocumentRoot /var/www/server2
</VirtualHost>

Lather, rinse, repeat.

Let me know if you have any problems with that. In addition to "*", there's also a "_default_" tag you can use for VirtualHosts, but the way Apache matches VirtualHosts can get incredibly complex and arcane. Just do it like that and it'll work.