Apache Virtual Server

Dennis Kaptain dkaptain at yahoo.com.mx
Thu Apr 30 14:05:07 UTC 2009




> On Tue, 2009-04-28 at 09:58 -0700, Dennis Kaptain wrote:
> > Just a little more information from /var/log/httpd/access_log
> >  
> > When I request http://localhost I get an entry that says
> > 127.0.0.1 - - [28/Apr/2009:11:52:08 -0500] "GET / HTTP/1.1" 200 3488 "-" 
> "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10) Gecko/2009042708 
> Fedora/3.0.10-1.fc10 Firefox/3.0.10"
> >  
> > When I request http://confianza I get an entry that says
> > 127.0.0.1 - - [28/Apr/2009:11:53:06 -0500] "GET / HTTP/1.1" 200 3488 "-" 
> "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10) Gecko/2009042708 
> Fedora/3.0.10-1.fc10 Firefox/3.0.10"
> >  
> > When I request http://confianzazend I get an entry that says
> > 127.0.0.1 - - [28/Apr/2009:11:53:54 -0500] "GET / HTTP/1.1" 200 3492 "-" 
> "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10) Gecko/2009042708 
> Fedora/3.0.10-1.fc10 Firefox/3.0.10"
> >  
> > All three entries are identical get requests for /
> 
> That's normal.  They're each requests for the default root document.
> 
> > Yet the php command \n"; ?>
> > in /var/www/html/index.php
> > prints out 'localhost', 'confianza', or 'confianzazend' depending on
> > what url I call.
> 
> Nothing unusual in that, either.  That's the hostname in the request
> from the client.  You could put in a bogus one, and get the same
> response.  e.g. add bogus to 192.168.0.4 in the hosts file, then request
> a page from http://bogus.  You'll get that sort of thing from your PHP
> file, even though you've not set up any "bogus" virtual host.
> 
> I'd be inclined to set up different logging files in each virtual host,
> so you could see exactly which host is reacting to what.  Open up a few
> consoles, and do "tail -f /var/log/httpd/confianza" in one, and similar
> commands in the other, so you can watch each one live, as you make
> different requests.
> 
> Alternatively, you can do custom logs which also includes hostnames in
> the log data.
> 
> -- 
> [tim at localhost ~]$ uname -r
> 2.6.27.21-78.2.41.fc9.i686

Tim,
You bring up a very interesting point about my /etc/hosts file.
My thinking was that since this is a laptop, it may or may not have the wireless
interface wlan0 up and running so the class C address may not exist so in order to
always resolve confianza I added the name as an alias to localhost on 127.0.0.1

As a side note, the syntax I posted for /etc/hosts doesn't work right. I had to keep everything on one
line like
127.0.0.1        localhost.localdomain localhost confianza confianzaZend
otherwise sendmail takes *forever* to start up while booting the computer.

Someone mentioned that the problem may have to do with how IP addresses are resolved
and suggested I install a DNS. I really didn't want to go that route. I think it's overkill for something
like this. I'm still thinking that this is somehow the problem. As you see, I did get the virtual hosts working
by using 127.0.0.1:80 in place of *:80 in my NameVirtualHost directive and VirtualHost directive blocks.

DK



      ¡Obtén la mejor experiencia en la web! Descarga gratis el nuevo Internet Explorer 8. http://downloads.yahoo.com/ieak8/?l=mx




More information about the users mailing list