您可以在一个 Windows Azure 实例上部署多个 Web 应用程序吗? [英] Can you deploy multiple webapps on one Windows Azure instance?

查看:19
本文介绍了您可以在一个 Windows Azure 实例上部署多个 Web 应用程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在一个 Windows azure 小型计算实例中运行一堆 Web 应用程序?

It is possible have a bunch of web apps running in one windows azure small compute instance?

我正在考虑使用 Azure 作为放置一堆开发和非生产就绪项目(Web 应用程序)的地方.有些实际上是封存的,但我想在某处有一个活跃的实例.我不想为每个应用支付单独的计算时间,那只是 90% 的时间坐在那里.

I am looking at using Azure as a place to sit a bunch of projects (web apps) that are in dev and non-production ready. Some are actually moth-balled, but I'd like to have an active instance of them somewhere. I don't want to pay for separate compute hours for each app, that is just sitting there 90 % of the time.

我正在考虑为这些项目获取共享主机帐户的另一种选择.

The other option I am considering to get a shared hosting account for these projects.

推荐答案

是的,现在可以使用 2010 年末发布的最新 Azure 平台更新.

Yes, it is now possible with the latest Azure platform updates that were released late 2010.

您必须在 Azure 项目的服务定义文件中进行适当的配置更改.以下是同一域中多个站点的示例.注册站点使用 https 端点(您还必须配置您的证书),其余站点使用 http.公共站点不指定主机头,并且会捕获任何未明确指定的内容.当您有一个需要处理多个子域(如 shopify)的应用程序时,这非常有用.为了完成这项工作,您需要有一个允许通配符 cnames 的 dns(GoDaddy dns 不允许).显然,您还需要一个 cname 记录,该记录指向其他每个子域的 azure.在此示例中要注意的另一件事是应用程序的 physicalDirectory 与 Azure 项目相关.希望这会有所帮助!

You have to make the appropriate config changes in your Azure Project's service definition file. Below is an example of multiple sites on the same domain. The Register site is using an https endpoint (you must also configure your cert) and the rest are using http. The Public site does not specify a host header and will catch anything not explicity specified. This is great when you have one app that needs to handle multiple subdomains (like shopify). In order to make this work you need to have a dns that allows wildcard cnames (GoDaddy dns does not). Obviously, you also need a cname record that points to azure for each of the other subdomains. One other thing to note in this example is that the physicalDirectory for the apps are relative to the Azure Project. Hope this helps!

这里有一个可能有帮助的链接:http://msdn.microsoft.com/en-us/图书馆/gg433110.aspx

Here's a link that may help: http://msdn.microsoft.com/en-us/library/gg433110.aspx

    <?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="SampleAzureProject" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
  <WebRole name="RegisterSite_WebRole">
    <Sites>
      <Site name="RegisterSite" physicalDirectory="..RegisterSite">
        <Bindings>
          <Binding name="RegisterBinding" endpointName="Endpoint1" hostHeader="register.sample.com" />
        </Bindings>
      </Site>
      <Site name="PublicSite" physicalDirectory="..PublicSite">
        <Bindings>
          <Binding name="PublicBinding" endpointName="Endpoint2" hostHeader="" />
        </Bindings>
      </Site>
      <Site name="ManageSite" physicalDirectory="..ManageSite">
        <Bindings>
          <Binding name="ManageBinding" endpointName="Endpoint2" hostHeader="manage.sample.com" />
        </Bindings>
      </Site>
      <Site name="MarketingSite" physicalDirectory="..MarketingSite">
        <Bindings>
          <Binding name="MarketingBinding" endpointName="Endpoint2"  hostHeader="www.sample.com" />
        </Bindings>
      </Site>
    </Sites>
    <Endpoints>
      <InputEndpoint name="Endpoint1" protocol="https" port="443" certificate="SampleReg" />
      <InputEndpoint name="Endpoint2" protocol="http" port="80" />
    </Endpoints>
    <Imports>
      <Import moduleName="Diagnostics" />
    </Imports>
    <Certificates>
      <Certificate name="SampleReg" storeLocation="LocalMachine" storeName="My" />
    </Certificates>
  </WebRole>
</ServiceDefinition>

这篇关于您可以在一个 Windows Azure 实例上部署多个 Web 应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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