如何使用Windows Azure

You’ll no doubt be aware of the great contest SitePoint is currently holding in conjunction with Windows Azure. Push the Web Forward invites you to take on one of three challenges that involve uploading an app or website to Windows Azure. There are plenty of cash prizes, up to $5,000 for the toughest challenge. The most basic challenge involves uploading a WordPress site to Windows Azure, and we published somem gudielines for this in Chris Leeds’ article WordPress on Windows Azure in 2 Minutes or Less. Now it’s time for some help with the more advanced challenges.

毫无疑问,您会注意到SitePoint与Windows Azure一起举办的激烈竞赛。 推动Web前进邀请您来进行三个挑战之一,其中一个挑战是将应用程序或网站上传到Windows Azure。 有很多现金奖励,最艰巨的挑战最高可达5,000美元。 最基本的挑战包括将WordPress网站上传到Windows Azure,我们在Chris Leeds的文章《 Windows Azure上的WordPress在2分钟或更短时间内》为此发布了一些指南。 现在该寻求一些更高级挑战的帮助了。

介绍 (Introduction)

In this article I will show you a few different ways of how to get your site running on Windows Azure. Launched in 2010 with only a few features, Microsoft quickly expanded its cloud offering to the all round service it is now. You can launch basically any type of website or app in the Azure cloud, but you probably would like to know how. I will demonstrate this by:

在本文中,我将向您展示几种如何使您的网站在Windows Azure上运行的方法。 Microsoft于2010年推出时仅具有一些功能,因此Swift将其云产品扩展到了现在的全方位服务。 您基本上可以在Azure云中启动任何类型的网站或应用程序,但您可能想知道如何启动。 我将通过以下方式对此进行演示:

  • Showing you the Windows Azure Portal

    向您展示Windows Azure门户
  • Setting up a simple HTML site

    设置一个简单HTML网站
  • Setting up a Magento ecommerce store

    开设一个Magento电子商务商店

I will start by giving you a look round in the dashboard (or portal as they call it), from which you can launch and manage your services.

首先,我将在仪表板(或门户网站,他们称为门户)中为您提供一个外观,您可以从中启动和管理服务。

Windows Azure门户 (The Windows Azure Portal)

Windows Azure

The Windows Azure portal is where you build and manage your deployments. At the bottom you find the big “NEW” button. This is where you start all of your deployments. On the left you see the number of services your are using, with “All items” showing a list of all of them.

Windows Azure门户是您构建和管理部署的地方。 在底部,您可以找到大的“ NEW”按钮。 在这里开始所有部署。 在左侧,您会看到正在使用的服务数量,“所有项目”显示所有这些项目的列表。

Some applications are built up from different services. Like my Magento demo, which is using a storage account, a virtual machine and a cloud service. In this article I will be using these services:

某些应用程序是通过不同的服务构建的。 就像我的Magento演示一样,该演示正在使用存储帐户,虚拟机和云服务。 在本文中,我将使用以下服务:

  • Web site: You can see this as regular hosting. It’s easy to quickly set up a website with a database or install an app from the Gallery (like WordPress).

    网站:您可以将其视为常规托管。 快速建立带有数据库的网站或从图库中安装应用程序(如WordPress)很容易。

  • Virtual machine: These are the cloud servers as most of us know them. You can configure your desired OS, on which you add a LAMP stack for example.

    虚拟机:这些是我们大多数人都知道的云服务器。 您可以配置所需的OS,例如,在其上添加LAMP堆栈。

  • Storage Account: This is the network attached storage, which you can use for storing an image (like in this article), or add storage to a virtual machine.

    存储帐户:这是网络附加存储,可用于存储映像(如本文中所述)或将存储添加到虚拟机。

  • Cloud service: This provides a management console for your instances. This is also where you set up scaling, and here you can combine multiple instances. As Microsoft states is, it allows you to focus on your app instead of your infrastructure.

    云服务:这为您的实例提供了一个管理控制台。 这也是设置缩放比例的地方,在这里可以组合多个实例。 正如Microsoft所说,它使您可以专注于应用程序而不是基础架构。

Azure provides you with a very good help function. On the bottom of your screen you see a question mark. When you click it, it shows you help information relevant to the page you are looking at. And it provides a fast and easy way to the excellent resource section.

Azure为您提供了很好的帮助功能。 在屏幕底部,您会看到一个问号。 单击它时,它会显示与您正在查看的页面相关的帮助信息。 并且它提供了快速便捷的方法来访问出色的资源部分。

azurefig2

When you click on one of the items (in this case the magento-demo virtual machine), you are presented with a dedicated management console. As you can see, you have some very nice usage graphs, as well as some additional services like a monitor (web endpoint status) and autoscale configuration. And here you also have your access details on the right.

单击其中一项(在本例中为magento-demo虚拟机)时,将显示一个专用的管理控制台。 如您所见,您有一些非常不错的用法图,以及一些其他服务,例如监视器(Web端点状态)和自动缩放配置。 在这里,您还可以在右侧找到访问详细信息。

Now let’s see how easy it is to launch actual websites on Windows Azure.

现在,让我们看看在Windows Azure上启动实际网站有多么容易。

如何在Windows Azure上设置一个简单HTML网站 (How to setup a simple HTML site on Windows Azure)

azurefig3

I will now set up a simple HTML site, without a database or anything fancy. I do this by clicking “Compute” –> “Web Site” –> “Quick Create”, filling in a temporary URL and click “Create Web Site”.

我现在将建立一个简单HTML站点,没有数据库或其他任何花哨的东西。 通过单击“计算”->“网站”->“快速创建”,填写一个临时URL,然后单击“创建网站”,即可完成此操作。

azurefig4

Within less than a minute, the site is up and running with a nice landing page, and is visible in my dashboard.

在不到一分钟的时间内,该网站已启动并运行,并带有一个漂亮的登录页面,并且可以在我的仪表板中看到它。

azurefig5

From here, you will see an impressive range of features, but let’s not get too excited right away. I will cover some of these features further on this article. Let’s focus on getting the HTML site up and running.

从这里,您将看到令人印象深刻的功能范围,但不要立刻感到兴奋。 我将在本文中进一步介绍其中一些功能。 让我们专注于启动和运行HTML网站。

You can do this with FTP, or use a special tool called WebMatrix (download). WebMatrix is free, and after an easy setup (just keep hitting “Yes” and “Ok”, you don’t need to install extra services for now) you can connect to your own site.

您可以使用FTP进行此操作,也可以使用称为WebMatrix的特殊工具( 下载 )。 WebMatrix是免费的,并且经过简单的设置(只需单击“是”和“确定”,您现在不需要安装其他服务)就可以连接到您自己的站点。

azurefig6

After I login using my Azure credentials, I can open my previously launched site.

使用Azure凭据登录后,可以打开以前启动的网站。

azurefig7

Now I can easily build a simple HTML site. A good way to start is by using a Boilerplate template, which you can load by selecting “File” –> “New” –> “Site from Template Gallery”.

现在,我可以轻松地构建一个简单HTML网站。 一个好的开始是使用样板模板,您可以通过选择“文件”->“新建”->“模板库中的站点”来加载样板。

azurefig8

Now select the “Boilerplate” template, click “Next” and then “Skip” to load it locally without configuring. You now have a solid framework to work with.

现在选择“样板”模板,单击“下一步”,然后单击“跳过”以将其本地加载而不进行配置。 您现在有了一个可靠的框架可以使用。

azurefig9

As you can see in the above screenshot, it also takes care of proper loading of (in this case) jQuery code (grabbing it from the Google CDN), and it also prepares Google Analytics code. There is already an included style.css, which you can edit and expand.

如您在上面的屏幕截图中所见,它还负责正确加载(在这种情况下)jQuery代码(从Google CDN抓取),并且还准备了Google Analytics(分析)代码。 已经包含了style.css,您可以对其进行编辑和扩展。

I will now make a nice welcome message for you SitePoint visitors. After I’m done editing, I can easily upload my code to Azure, on my current site or a new one (which you can create from within WebMatrix). WebMatrix does all the work, you just wait and click “Next” a few times. And within minutes, there it is: http://jbboilerplate.azurewebsites.net/

现在,我将向您发送一个很好的欢迎消息给SitePoint访问者。 完成编辑后,我可以轻松地将代码上传到Azure,当前站点或新站点(您可以在WebMatrix中创建)。 WebMatrix完成所有工作,您只需等待几次,然后单击“下一步”。 几分钟之内,它就是: http : //jbboilerplate.azurewebsites.net/

如何在Windows Azure上设置Magento电子商务 (How to setup Magento e-commerce on Windows Azure )

Now let’s make it a bit more interesting by setting up Magento on Azure, to see how easy it is to launch a database application. And to give it some extra juice, I will set it up on a subdomain of my own site.

现在,通过在Azure上设置Magento,使它变得更加有趣,以了解启动数据库应用程序有多么容易。 为了给它带来更多的收益,我将在我自己站点的子域中进行设置。

Since Magento isn’t offered in the gallery (like WordPress is), I will have to use a different approach. Say “Hello” to VMDepot, a richer version of the Gallery. It works with images, like the ones Amazon AWS is using. And with around 700+ images available, anything you won’t find in the Gallery should be there as an image.

由于未在图库中提供Magento( 就像WordPress一样 ),因此我将不得不使用其他方法。 对的更丰富版本VMDepot说“你好”。 它可以处理图像,就像Amazon AWS正在使用的图像一样。 大约有700张以上的图像可用,因此您在图库中找不到的任何内容都应该以图像的形式存在。

azurefig10

Images are added in the “Virtual Machines” tab. Selecting “Browse VM Depot” gives me a long list of all available images. You first need to select an image to load into your Azure account, after which you can build a “Virtual Machine” on top of that.

图像将添加到“虚拟机”选项卡中。 选择“浏览虚拟机软件仓库”会给我一长串所有可用映像的列表。 首先,您需要选择一个映像加载到Azure帐户中,然后可以在其上构建“虚拟机”。

azurefig11

As you can see, all the most recent versions are covered. In this case they are offered by BitNami, a reputable provider. It comes with Apache, PHP, MySQL and of course Magento itself. If you want to browse the list outside of Azure, it’s here.

如您所见,涵盖了所有最新版本。 在这种情况下,它们由信誉良好的提供商BitNami提供。 它带有Apache,PHP,MySQL,当然还有Magento。 如果要浏览Azure以外的列表,请在此处

azurefig12

In the next screen you fill in a few basic details to configure a storage account (where the files are actually located). After that, you just have to wait while it’s being installed.

在下一个屏幕中,您填写一些基本详细信息以配置存储帐户(文件实际所在的位置)。 之后,您只需要等待其安装即可。

azurefig13

Afterwards, you need to register your image before you can proceed. An unobtrusive (perhaps too unobtrusive?) notification alerts you to this fact, and that’s also where you will find the “Register” button.

之后,您需要先注册图像,然后才能继续。 不显眼(也许太不显眼?)的通知会提醒您这一事实,这也是您可以找到“注册”按钮的地方。

azurefig14

A pop-up appears, where you can change the name of your install if you want. Then, after a little more waiting, your image gets the “Available” status. You can now build your “Virtual Machine”.

出现一个弹出窗口,您可以根据需要更改安装名称。 然后,再等待一会儿,您的图像将变为“可用”状态。 您现在可以构建“虚拟机”。

azurefig15

Remember I said Magento wasn’t in the Gallery? By downloading the image it now is, and you can access it by clicking “From Gallery”. It is now located in “My Images”, and you can install this just like WordPress, with the addition of configuring SSH access.

还记得我说过Magento不在画廊吗? 现在下载图像即可,您可以通过单击“从图库”来访问它。 它现在位于“我的图像”中,您可以像WordPress一样安装它,并配置SSH访问。

azurefig16

Don’t forget to set a HTTP endpoint in step 4, or else you can’t connect to your virtual machine. After you have completed all the steps, it runs for a few minutes while it is deploying the image.

不要忘记在步骤4中设置HTTP端点,否则您将无法连接到虚拟机。 完成所有步骤后,它会在部署映像的过程中运行几分钟。

azurefig17

There it is: Under “DNS Name” you will find your URL, for which you can configure a CNAME (or access it directly). You need to add your site CNAME URL in the admin to make it actually work, of course.

在那里:在“ DNS名称”下,您将找到您的URL,可以为其配置CNAME(或直接访问它)。 当然,您需要在管理员中添加站点CNAME URL才能使其真正起作用。

azurefig18

If you are seeing this, you know it worked. “Access my application” brings you to the actual Magento frontpage. You can find my demo here (it’s empty, but it’s working):http://azure.buildyourownwebstore.com/magento/.

如果您看到此消息,则知道它有效。 “访问我的应用程序”将带您进入实际的Magento主页。 您可以在这里找到我的演示(它是空的,但是正在运行): http : //azure.buildyourownwebstore.com/magento/

azurefig19

I hope you’ve picked up a few techniques in this article that will come in handy when you enter the Push the Web Forward contest. The deadline for entries is 20 December. Keep your eyes open for one more article from me soon on some more advanced tips and tricks when using Windows Azure.

我希望您掌握了本文中的一些技巧,这些技巧在您参加“ 推动网络前进”竞赛时会派上用场。 报名截止日期为12月20日。 使用Windows Azure时,请继续关注我的另一篇文章,了解一些更高级的技巧。

翻译自: https://www.sitepoint.com/use-windows-azure/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值