|
Posted by Gordon Burditt on 12/28/05 07:22
>Thanks for your help. I guess I'm a little confused about localhost. It
localhost refers to the local machine. The *whole* machine, not
just one directory on it.
>seems that if I open a file in the browser at
>http:/localhost/myFile.html, it actually refers to the file
>/var/www/html/myFile.html.
On the local machine.
If I ftp to localhost and log in as 'gordon', I end up in my home
directory on the local machine. If I ftp to localhost and log in
as 'ralph', I end up in Ralph's home directory on the local machine.
If I http to localhost and request /, I get the web server's document
root directory (or an index file in it). If I ping localhost, I
get *no directory whatever*, I just get ping replies back. If I
log in on MySQL to localhost, I get the database I asked for, and
who cares what directory it's kept in (sometimes databases are
jumbled together in one large file, but if MySQL can figure it out,
that's fine with me) if I get the right one? If I connect an IRC
client to localhost, I end up talking to the IRC server on my local
machine (assuming one exists), and the directory is not relevant.
>So it seems there are two meanings to
>localhost? In one context it refers to the local machine via ip
>address 127.0.0.1, and in the context of the browser, (with Apache
>running?), localhost refers to a specifc directory path on the local
>machine. This is why I'm confused. Can you shed any light on this?
localhost refers to the local machine. The *whole* local machine.
Any directory is implied or specified by parts of the request other
than the hostname.
Gordon L. Burditt
Navigation:
[Reply to this message]
|