FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 02-05-2008, 07:20 AM
"Ashley Benton"
 
Default Apache virtual host problem Half solved

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.
My problem now is to open this page with another computer on the network.http://192.168.0.105/www.theswebsite.com give me the following result: the requested URL /www can't be find... and it does the same thing if I use the public IP.

Do I have to rewrite a rule somewhere to redirect the URL?
Thank you
Meg

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-05-2008, 02:46 PM
Derek Broughton
 
Default Apache virtual host problem Half solved

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@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-05-2008, 04:53 PM
"Ashley Benton"
 
Default Apache virtual host problem Half solved

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@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@lists.ubuntu.com

Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-05-2008, 07:25 PM
Derek Broughton
 
Default Apache virtual host problem Half solved

Ashley Benton wrote:

> 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.

HAHAHAHAHA!!!! I love it - the teacher taught. Exactly what this is all
about. Thanks. The warning is no big deal, but it's just annoyed the heck
out of me (and others) for _years_.

fyi, you're not actually deleting it "for every other host".
NameVirtualHost goes outside the virtualhost definitions, so you just don't
need to repeat it.

> That did work, now I can see it from this computer too
> Thank you very much

You scratch my back, I'll scratch yours :-)
--
derek


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-05-2008, 08:21 PM
"Ashley Benton"
 
Default Apache virtual host problem Half solved

It did the same when I added the line in /etc/apache2/httpd.conf, apparently Apache is just telling us that it now has the same thing written at different location.
I had no idea if it was working since I couldn't make it work so I spent a few weeks searching before to ask for help. At least that had been useful.

Now my problems are solved and you can get rid of the error message.
Thanks again
Meg

On Feb 5, 2008 3:25 PM, Derek Broughton <news@pointerstop.ca> wrote:

Ashley Benton wrote:

> 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.

HAHAHAHAHA!!!! * I love it - the teacher taught. *Exactly what this is all
about. *Thanks. *The warning is no big deal, but it's just annoyed the heck
out of me (and others) for _years_.


fyi, you're not actually deleting it "for every other host".
NameVirtualHost goes outside the virtualhost definitions, so you just don't
need to repeat it.

> That did work, now I can see it from this computer too

> Thank you very much

You scratch my back, I'll scratch yours :-)
--
derek


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com

Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 09:28 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org