Apache virtual host problem Half solved
Ashley Benton
meggalen at gmail.com
Tue Feb 5 17:53:08 UTC 2008
Thank you for the explanation, that does help me to understand.
To stop the warning it is easy in your virtual host you have NameVirtualHost
for me on the first line of every VirtualHost then <VirtualHost> You just
leave NameVirtualHost for the first Virtual Host and delete it for every
other host. The warning will stop.
I found the answer to stop the warning on this site (I can't find which
pages, I apparently bookmarked the wrong) but you should be able to find it
somewhere.
http://wiki.apache.org/httpd/CommonMisconfigurations
That did work, now I can see it from this computer too
Thank you very much
Meg
On Feb 5, 2008 10:46 AM, Derek Broughton <news at pointerstop.ca> wrote:
> Ashley Benton wrote:
>
> > I was able to set the computer which the files are on to see that it has
> > more than one virtual host by adding a line at the end of
> > /etc/apache2/apache2.conf
> > "Include the virtual host configuration and listing every virtual host I
> > wanted."
>
> > I deleted the first line NameVirtualHost for the 2 new VirtualHost and
> > don't have the error message that NameVirtualHost has no host, so
> > everything seems fine.
>
> I think that's only a warning - I get "[warn] NameVirtualHost *:0 has no
> VirtualHosts" every time I start, I've been unable to get rid of it (and
> neither has anybody else I've seen via google), and all my vhosts work.
>
> > My problem now is to open this page with another computer on the
> > network.http://192.168.0.105/www.theswebsite.com
>
> That's not how virtual hosts work.
>
> Here's what I have:
>
> NameVirtualHost *
> <VirtualHost *>
> ServerName nagisa
> ServerAlias nagisa.pointerstop.ca
> ...
> </VirtualHost>
> <VirtualHost *>
> ServerName plonevdc
> ServerAlias plonevdc.pointerstop.ca
> ...
> </VirtualHost>
>
> My /etc/hosts has:
>
> 127.0.0.1 localhost
> 127.0.2.1 nagisa.pointerstop.ca nagisa
> 127.0.2.2 plonevdc.pointerstop.ca plonevdc
>
> For any other host on the local subnet, /etc/hosts has to include (using
> your IP):
>
> 192.168.0.105 nagisa.pointerstop.ca nagisa
> 192.168.0.105 plonevdc.pointerstop.ca plonevdc
>
> [One of these days, I'll get around to figuring out how to put cnames into
> the DNS on my router so that I don't need that...]
>
> Now, you access plonevdc via http://plonevdc/path or
> http://plonevdc.pointerstop.ca/path from any machine on my lan. Apache
> looks at the http headers and sees what was _requested_ and directs to the
> appropriate vhost. It doesn't care what IP was actually used (unless you
> manually specify an IP in either NameVirtualHost or <VirtualHost>. That's
> why it's best not to use NameVirtualHost 192.168.0.105 - this means that
> all network requests have to come _from_ the external network, and you
> can't get there via http://localhost/ - or any name that translates to
> 127.x.x.x).
>
> If you manually specify the IP in the http request, it _never_ goes to the
> virtual host, because the IP is not given as a ServerAlias in any virtual
> host spec.
> --
> derek
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20080205/8f6796ca/attachment.html>
More information about the ubuntu-users
mailing list