简体   繁体   English

如何将Web服务器配置为使用其他名称而不是“ localhost”运行

[英]How to configure web server to run with another name instead of 'localhost'

I have this url in my local web server : 我的本地Web服务器中有以下网址:

"http://localhost:9698/AppName/Default.aspx"

But i want to configure the name of localhost:9698 , something like MyServer : 但我想配置localhost:9698的名称,例如MyServer

"http://MyServer/AppName/Default.aspx"

I had try to work with Binding... in IIS but it doesn't worked. 我曾尝试在IIS中使用Binding ...,但是没有用。 What should i do? 我该怎么办?

The above is how you can do development work locally (eg your desktop computer) - either using the VS Dev server or via IIS Express. 以上是使用VS Dev服务器或通过IIS Express在本地(例如台式计算机)进行开发工作的方式。

Assuming you want to simply test on a development machine eg Win 7/8: 假设您只想在开发机器上进行测试,例如Win 7/8:

Warning: do this at your own risk - undo or comment out your changes after you've done debugging/testing. 警告:这样做的后果自负-完成调试/测试后,请撤消或注释掉所做的更改。 Also, some AV programs explicitly block editing this important file (HOSTS). 另外,某些AV程序会明确阻止编辑此重要文件(HOSTS)。 If that is the case, you'll have to consult with your AV provider.... 如果是这种情况,则必须咨询您的视音频提供商。

  • You can then do the binding you are referring to with, or without using host headers as necessary 然后,可以根据需要进行绑定,也可以不使用host headers而进行绑定

If the above is mysterious to you, or doesn't make sense, you'll need to get into networking concepts - re: "localhost", 127.0.01, ip addressing, etc....and depending on the full context of your question, DNS. 如果以上内容对您来说是神秘的或没有意义,则需要进入网络概念-例如:“ localhost”,127.0.01,ip地址等...,具体取决于以下内容:您的问题,DNS。

Also if it gets to that point, its probably better to move your question over to Serverfault 同样,如果到了这一点,将您的问题转移到Serverfault可能更好

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM