简体   繁体   English

IIS服务器名称更改

[英]IIS Server Name Change

I have a certificate for that is valid for *.MyCompany. 我有一个适用于* .MyCompany的证书。 com . com That is fine for my dev and test servers because the first part of the URLs for those computers ends like that. 这对于我的开发和测试服务器很好,因为这些计算机的URL的第一部分就是这样结束的。

I want to test this on my computer and the certificate is incorrect because my computer defaults to the url MyComputer.MyCompany. 我想在我的计算机上对此进行测试,并且证书不正确,因为我的计算机默认为URL MyComputer.MyCompany。 net .

Is there a way to fake out IIS in to thinking that my computer is .MyCompany. 有没有一种方法可以伪装IIS来认为我的计算机是.MyCompany。 com or am I out of luck when it comes to testing this? com还是在测试此功能时我不走运?

Thanks, Vaccano 谢谢,瓦卡诺

you could edit your hosts file and add an entry to point http://you.yourcompany.com to your local ip or 127.0.0.1 您可以编辑主机文件并添加条目以将http://you.yourcompany.com指向您的本地IP或127.0.0.1

Edit c:\\Windows\\System32\\drivers\\etc\\hosts with a text editor. 使用文本编辑器编辑c:\\ Windows \\ System32 \\ drivers \\ etc \\ hosts。

save it and you should be able to hit your own IIS using the new fake name. 保存它,您应该可以使用新的假名称访问自己的IIS。

You should be able to edit the host header values for the IIS website to accept *.Mycompany.com. 您应该能够编辑IIS网站的主机头值,以接受* .Mycompany.com。 To get the DNS to resolve and work correctly, you may need to add an entry to your windows hosts file -- mycomputer.mycompany.com 127.0.0.1. 为了使DNS能够解析并正常工作,您可能需要在Windows主机文件中添加一个条目-mycomputer.mycompany.com 127.0.0.1。 that will let you test locally. 这样您就可以在本地进行测试。

Another option would be to use a self-signed cert for local development. 另一种选择是使用自签名证书进行本地开发。

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

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