简体   繁体   English

如何在 IIS 7 上发布网站

[英]How to Publish Website on IIS 7

I am able to publish website by creating virtual directory under Default Web Site in IIS 7. In this case url becomes http://localhost/ABC where ABC is my website and it is working fine. I am able to publish website by creating virtual directory under Default Web Site in IIS 7. In this case url becomes http://localhost/ABC where ABC is my website and it is working fine. But I have to publish website at same level to Default Web Site , not under it.但是我必须将同一级别的网站发布到Default Web Site ,而不是在它下面。 In this case url becomes http://ABC:81 where 81 is port number, but website is not working.在这种情况下 url 变为http://ABC:81其中 81 是端口号,但网站无法正常工作。
Can any body solve it?任何机构都可以解决它吗?

Turn off the default web site and add yours to run on port 80. You can only run one web site on one port on one hostname at a time.关闭默认的 web 站点并将您的站点添加到端口 80 上运行。您一次只能在一个主机名的一个端口上运行一个 web 站点。

EDIT: After reading your post again, are you trying to access a different hostname for the second server?编辑:再次阅读您的帖子后,您是否尝试为第二台服务器访问不同的主机名? http://ABC:81 is not valid unless ABC is a valid hostname. http://ABC:81无效,除非 ABC 是有效的主机名。 Change that to http://localhost:81 to test your other site.将其更改为http://localhost:81以测试您的其他站点。

for local PC we can use only对于本地 PC,我们只能使用

IP: 127.0.0.1 & hostname: localhost IP:127.0.0.1 & 主机名:localhost

both redirect the to local PC if you use http://ABC.com it will be check on DNS.如果您使用http://ABC.com ,则两者都将重定向到本地 PC,它将在 DNS 上进行检查。 so plz set hostname localhost and port 81. so u can browse http://localhost:81 .所以请设置主机名 localhost 和端口 81。这样你就可以浏览http://localhost:81 or u can set IP 127.0.0.1 and port 81 in binding so u can browse with http://127.0.0.1:81 also或者您可以在绑定中设置 IP 127.0.0.1 和端口 81,这样您也可以使用http://127.0.0.1:81浏览

If you want to use it for test purposes you can go to c:\windows\systen32\drivers\etc and edit host file and you can add:如果您想将其用于测试目的,您可以 go 到 c:\windows\systen32\drivers\etc 并编辑主机文件,您可以添加:

127.0.0.1 abc 127.0.0.1 ABC

Then you can access your website through http://abc .然后您可以通过http://abc访问您的网站。 Or you may use 127.0.0.1 www.abc.com in place或者您可以使用127.0.0.1 www.abc.com

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

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