问题原文
原帖链接 · Chris Muench · CC BY-SA 4.0
Some users report that Apache 2 on Windows is running slow over the network. I know that I was able to speed up MySQL by using 127.0.0.1 for the MySQL connection address. I also found that in a ServerName that is localhost:80.
If I change ServerName to
127.0.0.1:80 will this cause any side effects with networking from machines on the network?
What are the pros and cons of making this change?
已采纳解答
原帖链接 · sa289 · CC BY-SA 4.0
If that's the default VirtualHost, either by being the first VirtualHost defined on that IP address/port combination or because the VirtualHost tag contains _default_ (see VirtualHost Examples - Using default vhosts - Apache HTTP Server), then it shouldn't matter if you change it from localhost:80 to 127.0.0.1:80.
As it stands now, remote machines shouldn't be able to access it anyway using the name localhost (i.e., users wouldn't go to http://localhost unless they were on the machine itself) since that would resolve to their machine and not the machine you're running Apache on.
Since they're not using localhost to access it, changing it shouldn't matter as the default VirtualHost in Apache will field incoming requests regardless of what you put for ServerName or ServerAlias.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
