What is the meaning of a "local host", hosts and ports in general?

I am completely unfamiliar with this web development material. So I see things like "localhost" all the time, and ask myself: what is it?

It seems to me that in fact the "master". Something that does something. So my mac is the host for everything that runs on it. So, is "localhost" really just my mac? Can I have other hosts? like "otherhost" or "besthost"?

So, when I write in my browser: http: // localhost: 80 / mysite / index.php , this thing "localhost" tells the browser to look at my machine for this material and not online?

Maybe someone can clarify this a bit :-)

+55
localhost
Dec 22 '09 at 12:48
source share
10 answers

On a computer network, localhost (which means "this computer") is the default host name given by the loopback network interface address.

Localhost always translates to loopback 127.0.0.1 IP address in IPv4.

It is also used instead of the computer name. For example, when you start a web browser installed on a system with an HTTP server, http: // localhost will display the main page of the local website.

Source: Wikipedia - Localhost .




Part :80 is the TCP port. These ports can be considered as endpoints of communication at a specific IP address (in the case of localhost - 127.0.0.1). IANA is responsible for maintaining the official assignment of standard port numbers for specific services. Port 80 is the standard port for HTTP .

+39
Dec 22 '09 at 12:50
source share
β€” -

β€œIn computer networks, a network host, host, host, or Internet on the Internet, a node is a computer connected to the Internet β€” or more generally β€” for any type of data network. A network node may also contain information resources as application software for providing network services.” . -Wikipedia

A local host is a special name assigned to a local computer or a working computer, usually its IP address is 127.0.0.1. However, you can define it as something.

Each host has several network services, for example Apache / IIS (Http web server), mail clients, FTP clients, etc. Each service has a specific port associated with it. You can think of it as this.

Each house has one mailbox and several people. A mailbox is a host. Your own home mailbox is the local host. Every person in the house has a room. All letters for this person are sent to his room, so the room number is the port.

+14
Dec 22 '09 at 15:02
source share

It seems that everyone is focused on the main part of your questions. Ports are used to run multiple servers (for example, for different purposes, such as file sharing, web service, printing, etc.) from the same computer (one single IP address).

+5
Dec 22 '09 at 13:01
source share

The local host usually refers to the machine you are looking at. On most computers, localhost allows the IP address 127.0.0.1, which is the feedback address.

+3
Dec 22 '09 at 12:51
source share

Yes, localhost just means that you are talking to the web server about the same computer that you are currently using.

Other servers will contact either their IP address or the specified name.

+3
Dec 22 '09 at 12:53
source share

Well, others have given a good definition of "localhost".

This is a kind of defacto for the text representation of the local IP 127.0.0.1.

You can have "besthost", "otherhost", "someotherhost" if you are using a DNS server that can translate it to working IP addresses, or by changing the host file. But this is a different topic for another day or a better day .: P

+1
Dec 22 '09 at 12:56
source share

Regarding the question of a better one and such, see host ; basically every IP address is a host.

I suggest you start reading from the host and only after switching to localhost (which is the host type)

+1
Dec 22 '09 at 12:57
source share

I heard a good description (parable) that illustrates ports as different delivery points for a large building, for example. Post office for letters and small parcels, Goods for large deliveries / pallets, Doors for people.

+1
Dec 22 '09 at 14:07
source share

Some databases are designed for communication over the Internet using ports assigned by the authority of a designated Internet center (IANA), and when working on a separate PC, ports with localhost are used. Some common databases with their default ports (defualts can usually be overridden):

Port Database

1433 Microsoft SQL Server https://support.microsoft.com/en-us/kb/287932

3306 MySQL https://dev.mysql.com/doc/refman/4.1/en/connecting.html

5432 PostgreSQL

1527 Apache Derby (database)

Some web servers and databases are combined together, such as Apache / MySQL (as in LAMP or XXAMP) or MS Internet Information Server (IIS) / MS SQL Server (IIS / SQL Server), in which case you should be concerned about how a database port and a web server - a common example of this is WordPress, which uses Apache / MySQL.

+1
May 2 '15 at 18:03
source share

Port In simple terms, a β€œport” is a number used by certain software to identify its data coming from the Internet.

Each software such as Skype, Chrome, Youtube has its own port number and how they know what Internet data is for themselves.

Socket : "IP address and port" together is called "Socket". It is used by another computer to send data to a specific computer of specific software.

The IP address is used to identify the computer, and the port is used to identify software such as IE, Chrome, Skype, etc.

Each house has one mailbox and several people. The mailbox is the host. Your own home mailbox is local. Every person in the house has a room. All letters for this person are sent to his room, so the room number is a port.

0
Dec 18 '18 at 3:00
source share



All Articles