将网站部署到云服务的最佳做法 [英] Best practice for Deployment of Web site into a cloud service

查看:296
本文介绍了将网站部署到云服务的最佳做法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Cloud Service上部署多个网站的最佳做法是什么?

What's the best practice to deploy multiple Web site on Cloud Service ?

我有三个网站,可以将这三个网站部署到一个云服务? (一个Cloud Service中有三个实例)

I have three web sites, is it possible to deploy those three web sites into one Cloud Service ? (Three instances in one Cloud Service)

或者我必须创建三个云服务并分别部署每个网站吗?

Or Do I have to create three Cloud services and deploy each web site separetly ?

谢谢

我的ServiceDefinition档案:

My ServiceDefinition file:

  <WebRole name="WebRoleName" vmsize="ExtraSmall">
    <Sites>
      <Site name="Web" physicalDirectory="../WebSite1">
        <Bindings>
          <Binding name="Endpoint1" endpointName="Endpoint1" />
        </Bindings>
      </Site>
      <Site name="Web2" physicalDirectory="..\..\..\WebSite2">
        <Bindings>
          <Binding name="Endpoint2" endpointName="Endpoint2" />
        </Bindings>
      </Site>
    </Sites>
    <Endpoints>
      <InputEndpoint name="Endpoint1" protocol="http" port="80" />
      <InputEndpoint name="Endpoint2" protocol="http" port="81" />
    </Endpoints>
    <Imports>
      <Import moduleName="Diagnostics" />
      <Import moduleName="RemoteAccess" />
      <Import moduleName="RemoteForwarder" />
    </Imports>
  </WebRole>
</ServiceDefinition>

通过使用该代码,WebSite1可用,WebSite2不可用,即使添加:81
我使用远程桌面验证IIS上的部署,我看到WebSite1已正确部署,但WebSite2没有。
WebSite2和WebSite2.Test是在虚拟网站目录下部署的两个文件夹。
通过手动复制虚拟网站目录下面的WebSite2文件夹的内容,我能够通过 http://id.cloudapp.net:81

By using that code, WebSite1 is available and WebSite2 is not, even by adding :81 I used the Remote Desktop to validate the deployment on IIS, and I saw that WebSite1 was correctly deployed but WebSite2 was not. WebSite2 and WebSite2.Test were two folders deployed below the Virtual Website Directory. By Copying manually the content, of the WebSite2 folder, below the Virtual WebSite Directory, i was able to access to my website via http://ID.cloudapp.net:81

错误是什么?为什么还要为WebSite2部署测试项目?

What's the error ? Why the Test project is also deployed for WebSite2 ? (I made a check on the depedency and that's not selected)

谢谢

推荐答案

你可以做任何一种方式。它真的取决于你需要做什么。如果您想在同一个网址下托管您的所有网站,例如:

You could do either way. It really depends on what you need to do. If you want to host all your websites on port 80 under the same url for example:

http://www.mywebsite.com/site1
http://www.mywebsite.com/site2
http://www.mywebsite.com/site3

那么你可以试试这个:

http://kellyhpdx.wordpress.com / 2012/04/11 / deploying-multiple-web-applications-to-a-single-azure-instance-and-applicat-web-config-transforms-correctly /

或者,如果您不一定需要此实现,并且您可以在不同端口下托管您的网站,那么您可以在单独的角色下创建一个实例。

Alternatively if you don't necessarily need this implementation and you can host your websites under different ports, then you could create one instance under a separate role.

您甚至可以每个webrole有一个云项目,例如,如果你想有一个测试管理网站来控制你的项目,这不应该包括在生产中,你可以有2个云项目:1与所有生产实例和1与您在需要时部署的测试管理网站。

You could even have 1 cloud project per webrole, for instance if you wanted to have a test admin website to control your project, which shouldn't be included in production, you could have 2 cloud projects: 1 with all the production instances and 1 with your test admin website that you deploy as and when needed.

这篇关于将网站部署到云服务的最佳做法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆