localhost - what is it?

What is "localhost"? Please, an easy-to-understand explanation of what it is, why I'd need it, and how to delete it after screwing it up anyway.

(I accessed an online backup site by entering "http://localhost: **/" into the "Connect to Server" window. Did I just backup to my own hard drive? If I did, where is that data? I'm so confused. (p_q)

Dual 2 Ghz PowerPC G5, Mac OS X (10.5.1), RAM 3GB; HD 860GB; Safari 3.0.4;

Posted on Mar 30, 2008 8:06 AM

Reply
6 replies

Mar 31, 2008 4:13 AM in response to Kappy

Kappy wrote:
Google is your friend: LocalHost - Wikipedia.

Yes, localhost is your computer. It's a shorthand for the computer's host IP address which by default is 127.0.0.1 (has nothing to do with the IP address from your ISP or generated by your network router.)

Yes, localhost is your computer. It's a shorthand for the computer's host IP address

Too technical for me. Still don't understand. If I copy fles to "localhost", and localhost is actually a loop back to my computer, where are those copied files residing?

I don't get it.

Mar 31, 2008 5:54 PM in response to Ermanno Polli

Ermanno Polli wrote:
The "localhost" is mainly for testing your internet application/server. Everything addressed to localhost goes thru the full TCP/IP protocols but actually it doesn't leave your computer.
If you copy files in localhost, the files act as if they were copied to another computer, via internet.
Ciao, Ermanno


So, please confirm:
The "files" on the localhost are essentially aliases of the original. When I open a folder on localhost, I'm looking at the contents of the original folder on my hard disk. There are no duplicated files or folders. When I delete a folder from localhost, it removes the "alias" from localhost, and the original files on my hard disk are maintained.

----

Also asked previously:

I accessed a remote backup service by entering

"http://localhost:some-numbers-here-provided-by-backup-service/"

into the "Connect to Server" window.

It connected to a volume with the URL "http://localhost:SAME-numbers-here"


Why does it still have "localhost" in the URL, if this is actually a connection to a real remote server?


(If I use the application provided by the remote backup service, it connects to their server, and a volume with the name of the service appears on my desktop.)

Mar 31, 2008 5:16 AM in response to yattaman

yattaman wrote:
Kappy wrote:
Google is your friend: LocalHost - Wikipedia.

Yes, localhost is your computer. It's a shorthand for the computer's host IP address which by default is 127.0.0.1 (has nothing to do with the IP address from your ISP or generated by your network router.)

Yes, localhost is your computer. It's a shorthand for the computer's host IP address

Too technical for me. Still don't understand. If I copy fles to "localhost", and localhost is actually a loop back to my computer, where are those copied files residing?


In your mac. 😉

I don't get it.


The "localhost" is mainly for testing your internet application/server. Everything addressed to localhost goes thru the full TCP/IP protocols but actually it doesn't leave your computer.
If you copy files in localhost, the files act as if they were copied to another computer, via internet.

Ciao,
Ermanno

Apr 1, 2008 12:26 AM in response to yattaman

yattaman wrote:
Ermanno Polli wrote:
The "localhost" is mainly for testing your internet application/server. Everything addressed to localhost goes thru the full TCP/IP protocols but actually it doesn't leave your computer.
If you copy files in localhost, the files act as if they were copied to another computer, via internet.
Ciao, Ermanno


So, please confirm:
The "files" on the localhost are essentially aliases of the original. When I open a folder on localhost, I'm looking at the contents of the original folder on my hard disk. There are no duplicated files or folders. When I delete a folder from localhost, it removes the "alias" from localhost, and the original files on my hard disk are maintained.


They are not aliases they are the real files. If you delete it you delete the file.

BTW. I tried to connet to my"localhost": afp://localhost/. A warning pops up saying "This file server is running on your machine. Please access the volumes and files locally".
Perfectly right. localhost is the machine where you are.

----

Also asked previously:

I accessed a remote backup service by entering

"http://localhost:some-numbers-here-provided-by-backup-service/"

into the "Connect to Server" window.

It connected to a volume with the URL "http://localhost:SAME-numbers-here"


Why does it still have "localhost" in the URL, if this is actually a connection to a real remote server?


There is an advanced use of localhost, but this involves some unix commands. Namely ssh.
It's called a "ssh tunnel".
It's a special way to connect to computers behind a firewall. In short, you create a "tunnel" through the firewall using a "middle way" computer outside the firewall but connected to machines behind it: a "bastion host".
This tunnel begins at your machine and ends inside the firewalled environment. So you connect to localhost but actually you connect to the machine on the other side.
It could be this is your case.

(If I use the application provided by the remote backup service, it connects to their server, and a volume with the name of the service appears on my desktop.)


Yep. It seems like a ssh tunnel. But you have to set up your side of the tunnel. Maybe the service manager gave you a shell script to run, before connecting.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

localhost - what is it?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.