Today opened a new server, the code diversion of the past, even the database connection is not on, I looked at the original configuration from 127.0.0.1 to localhost on it. Consider the following two differences.
A lot of people will be exposed to this ip address 127.0.0.1. You might ask what is the address 127.0.0.1? In fact, 127.0.0.1 is a loopback address, referring to the local machine, usually used for testing. We used to run ping 127.0.0.1 local ip / tcp is not normal, as can ping can be used normally.
For most it is the practice of using localhost, in essence, is a pointer to the local IP address 127.0.0.1. There is a configuration file with 127.0.0.1 localhost bound together in the operating system. It can be understood as meaning the local host.
What is the difference between localhost and 127.0.0.1?
Some would say that I believe is the local ip, it has been said, with more than localhost 127.0.0.1, and can reduce the time to resolve.
It seems that people do not know there is a problem, in fact, the two are different.
localhost also called local, correct explanation is: the local server
127.0.0.1 in the correct interpretation of windows and other systems are: the local address (local server)
They parse through the machine's host file, windows will automatically resolves to 127.0.0.1 localhost
localhot (local) is not transmitted through the network card! This is important, it is not the network firewall and LAN-related restrictions.
127.0.0.1 is transmitted through the card, depending on the card, and are subject to network firewalls and network card related restrictions.
General Setup When the local service is the best use localhost, localhost will not resolve to ip, it will not take up network card, network resources.
Sometimes you can use localhost, but you can use 127.0.0.1 is not the case in this. Guess localhost access, the system with a native of the current user permission to access and use the ip when the machine is again equal access to the machine via the network, the network may be related to the user's permissions.