Microsoft Azure是(Microsoft Azure)云计算领域(cloud computing)的下一件大事。Azure 基本上是 Microsoft 提供的一种云(Microsoft)计算服务(cloud computing service),可用于通过Microsoft拥有的数据中心网络构建、部署和管理应用程序。它基本上是大约 68 种产品的集合,包括虚拟机、SQL 数据库(SQL Database)、应用服务(App Service)等。Azure 是部署 Web 应用程序和虚拟机时需要的一整套解决方案。
在 Microsoft Azure 上运行 WordPress
最近,我参加了由WordPress Chandigar h 和Microsoft User Group – Chandigarh在(Microsoft User Group – Chandigarh)印度(India)昌迪加尔(Chandigarh)举办的活动。活动的标题是 –如何在 Microsoft Azure 上运行超快的 WordPress(How to run blazingly fast WordPress on Microsoft Azure)。我们讨论了使用Microsoft Azure部署网站和WordPress的各种可能性。当天的主持人 Jasjit Chopra 先生(Mr. Jasjit Chopra)分享了他的知识,并举办了一场关于在Microsoft Azure上运行(Microsoft Azure)WordPress网站的研讨会。在这篇文章中,我尽力总结了研讨会并为您提供了运行WordPress的相关步骤天蓝色(Azure)。
在Microsoft Azure上托管WordPress的好处(WordPress)
我们通常将我们的网站托管在成本较低的共享主机(Shared Hosting)上,但同时速度和安全性有时也会受到影响。我们讨论了使用云计算托管WordPress的可能性。事实证明,带有固态驱动器的虚拟服务器比这些传统的网络托管服务要好。不过,相比之下,所产生的成本可能会更大。但是您可以托管多个网站并确保它们以尽可能快的速度加载。提供Azure(Azure)的固态驱动器和一流的硬件功能,WordPress可以以惊人的速度运行。
在整篇文章和我们的研讨会中,我们使用了一个免费的Dev Essential帐户来访问Microsoft Azure。注册后,您将在一年内(每月 25 美元)免费获得 300 美元的Azure 信用额度。(Azure Credit)这么多功劳足以让您试用Azure并部署您的测试网站。
所以基本上,我们将在本教程中使用的所有工具和服务都是免费的。并且只有在您真正为您的企业构建某些东西时才需要付费。免费信用可以促进您的测试项目。
本教程分为两部分,第一部分讨论Azure注册过程和创建虚拟服务器。第二部分讨论设置和配置您的服务器以托管WordPress。
设置 Azure
第 1 步(Step 1):在此处访问(here)Microsoft Dev Essentials网站。完成注册过程以获得您的免费信用。现在前往 Azure网站(website)并使用您的凭据登录,现在您拥有一个功能齐全的Azure帐户,可用于部署应用程序。
第 1 步(备选方案):(Step 1 (Alternate):)如果您不想使用Dev Essentials注册,可以使用备选方案。您可以直接访问Azure网站并开始免费试用,免费试用 200 美元,为期一个月。
第 2 步(Step 2):现在我们需要创建一个虚拟机,它将运行我们的服务器。我们使用Ubuntu 14.04 LTS来部署服务器。您可以自由使用其他版本甚至 Windows 来部署服务器。
要创建新的虚拟机,请点击Azure仪表板中的绿色加号(plus)图标。现在搜索“ Ubuntu Server 14.04 LTS ”并点击“ Enter ”。从搜索结果中选择相关选项并选择“资源管理器(Resource Manager)”作为部署模型。点击创建(Create)按钮。您可以点击图片查看大图。
第 3 步(Step 3):现在我们需要进行一些配置以设置我们的虚拟机。请仔细遵循这些步骤以避免任何验证错误。为机器选择一个名称,然后选择 VM 磁盘类型为“ SSD ”。您需要选择它作为SSD,这样您的服务器的运行速度就会比传统的 Web 主机快很多。
我们在整个教程中的目标是使WordPress安装在后端执行得更快,因此SSD是必须的。现在选择一个用户名并将身份验证类型更改为“密码”(Password’)。创建一个足够强的密码并确保记住用户名和密码。
现在选择资源组(Resource Group)下的“新建(Create new)”并为其选择适当的名称。通常,名称以“ RG ”开头,后跟虚拟机的名称。然后在免费帐户中选择离您最近且可供您使用的位置。我们选择最近的位置来减少延迟并提高速度。完成后点击(Hit)“确定(OK)”。
第 4 步(Step 4):现在在这一步中,您需要选择虚拟机的大小。大小完全取决于您的项目的要求。我们推荐DS1_V2用于本教程和托管您的其他常见项目,您可以随着组织的发展和网站上的更多流量轻松扩展。轻松扩展是Microsoft Azure的魅力所在。DS1_V2配备单核处理器、3.5 GB RAM和 7 GB SSD 磁盘空间,如果您在(SSD Disk)东南亚(Southeast Asia)附近使用服务器,则每月费用约为 60 美元。
您无需支付费用,因为您已经拥有在步骤 1(Step 1)中获得的免费积分。选择合适的尺寸并点击“选择(Select)”。
第 5 步(Step 5):这是我们配置一些可选设置的最关键步骤。您可以在此处选择存储帐户的名称。此外,您可以配置虚拟机的公共 IP(Public IP)。根据您的要求,IP 可以是动态的或静态的。我们在本教程中使用动态。此外,我们需要在“网络安全组防火墙(Network Security Group Firewall)”中创建一个新的入站规则。我们创建此规则,以便我们的机器可以通过端口 80 侦听并提供网站内容。
要添加此规则,请从菜单中选择NSG,然后在“入站规则”(‘Inbound Rules’ )下点击“添加入站规则(Add an inbound rule)”。按照以下配置设置此规则:
- 名称:“http”
- 优先级:任何大于 SSH 优先级的整数 (>1000)
- 服务:“HTTP”
- 端口:80(默认)
- 协议:“TCP”(默认)
- 行动:允许
点击(Hit)所有“确定”按钮以创建规则并保存设置。并且您已经成功配置了能够通过端口 80 与其他计算机通信的虚拟机。
第 6 步(Step 6):现在Azure将在机器上运行验证,以确保您已正确配置它并且没有错误。如果验证通过所有绿色标志,您最终可以通过点击“确定(OK)”按钮来部署您的机器。现在最多需要几分钟才能完成部署。如果在任何情况下部署失败,您可以删除整个资源组并重复该过程或在下面的评论部分与我们讨论。
您现在将能够看到您的虚拟机正在运行。在文章的下一部分—— 如何在 Microsoft Azure 上安装和设置 WordPress——(How to install & setup WordPress on Microsoft Azure)(How to install & setup WordPress on Microsoft Azure)我们讨论了如何连接到这台机器并在其上安装和托管WordPress。
How to run blazingly fast WordPress on Microsoft Azure
Microsoft Azure is the next big thing in cloud computing. Azure is basically a cloud computing service provided by Microsoft that can be used to build, deploy and manage applications through a network of Microsoft-owned datacentres. It is basically a collection of around 68 products that include virtual machines, SQL Database, App Service and others. Azure is a complete set of solutions that you’ll need while deploying web applications and virtual machines.
Run WordPress on Microsoft Azure
Recently I attended an event in Chandigarh, India organized by WordPress Chandigarh and Microsoft User Group – Chandigarh. The event’s title was – How to run blazingly fast WordPress on Microsoft Azure. We discussed various possibilities for using Microsoft Azure to deploy websites and WordPress. And the facilitator of the day, Mr. Jasjit Chopra shared his knowledge and conducted a workshop on running a WordPress website on Microsoft Azure. In this post, I’ve tried my best to summarize the workshop and provide you relevant steps on running WordPress on Azure.
Benefits of hosting WordPress on Microsoft Azure
We usually host our websites on Shared Hosting where the cost is less but at the same time speed and security sometimes are also compromised. We discussed the possibilities of using cloud computing to host WordPress. A virtual server with solid state drive proved to be better than these conventional web hosting services. Although, the costs incurred might be larger in comparison. But you can host more than one website and make sure they load at fastest possible speed. Providing a solid-state drive and top notch hardware capabilities of Azure, WordPress can run blazingly fast.
In this entire post and our workshop, we used a free Dev Essential account for accessing Microsoft Azure. As you sign up you get a free 300$ Azure Credit over a span of a year (25$ a month). This much credit is more than sufficient for you to try out Azure and deploy your testing website.
So basically, all the tools and services that we are going to use in this tutorial are free of cost. And you need to pay only when you are actually building something for your enterprise. The free credit can facilitate your testing projects.
The tutorial is divided into two parts, the first one discusses the Azure sign-up process and creating a virtual server. The second part talks about setting up and configuring your server to host WordPress.
Setting up Azure
Step 1: Head over to Microsoft Dev Essentials website here. Complete the sign-up process to receive your free credit. Now head over to the Azure website and log in using your credentials, now you have a fully functional Azure account that can be used to deploy applications.
Step 1 (Alternate): There is an alternative available if you don’t wish to sign up using Dev Essentials. You can directly go the Azure website and start a free trial that offers you free 200$ credit for a period of one month.
Step 2: Now we need to create a Virtual Machine, that would run our server. We’ve used Ubuntu 14.04 LTS for deploying a server. You are free to use other versions or even Windows to deploy the server.
To create a new virtual machine, hit the green plus icon from the Azure dashboard. Now search for ‘Ubuntu Server 14.04 LTS’ and hit ‘Enter’. Select the relevant option from the search results and choose ‘Resource Manager’ as the deployment model. Hit the Create button. You may click on the images to see the larger version.
Step 3: Now we need to do some configuration in order to set up our virtual machine. Follow these steps carefully to avoid any validation errors. Choose a name for the machine and then select the VM disk type as ‘SSD’. You need to choose it as an SSD so that your server performs a lot faster than the conventional web hosts.
Our goal in the entire tutorial is to make the WordPress installation perform faster in the backend so an SSD is a must. Now choose a username and change the authentication type to ‘Password’. Create a strong enough password and make sure you remember the username and password.
Now select ‘Create new’ under the Resource Group and select an appropriate name for it. Usually, the name starts with ‘RG’ followed by the name of your virtual machine. Then choose a location that is closest to you and available to you in the free account. We choose the closest location to decrease latency and improve speed. Hit ‘OK’ when you are done.
Step 4: Now in this step, you need to choose the size of the virtual machine. The size is completely dependent on the requirement of your project. We recommend DS1_V2 for this tutorial and for hosting your other common projects and you can easily scale up as your organization grows and you encounter more traffic on your website. Easy scaling is the beauty of Microsoft Azure. DS1_V2 comes with a single core processor, 3.5 GB RAM and 7 GB of SSD Disk space and it can cost somewhere around 60$ per month if you are using a server somewhere near Southeast Asia.
You don’t need to pay the cost as you already have the free credits, obtained in Step 1. Select the appropriate size and hit ‘Select’.
Step 5: This is the most crucial step where we configure some optional settings. Here you can choose the name of your storage account. Also, you can configure the Public IP of your virtual machine. The IP can be dynamic or static as per your requirement. We are using dynamic for this tutorial. Furthermore, we need to create a new inbound rule in the ‘Network Security Group Firewall’. We create this rule so that our machine can listen over port 80 and serve the website’s content.
To add this rule, select NSG from the menu and then under ‘Inbound Rules’ hit ‘Add an inbound rule’. Follow the following configuration to setup this rule:
- Name: “http”
- Priority: Any integer greater than SSH’s priority (>1000)
- Service: “HTTP”
- Port: 80 (Default)
- Protocol: “TCP” (Default)
- Action: Allow
Hit all the ‘OK’ buttons to create the rule and save the settings. And you’ve successfully configured up your virtual machine that is capable of communicating with other computers over the port 80.
Step 6: Now Azure will run a validation on the machine to make sure you’ve configured it properly and there are no errors. If the validation passes with all the green flags, you can finally deploy your machine by hitting the ‘OK’ button. Now it will take up to a few minutes to complete the deployment. And if in any case, the deployment fails, you can delete the entire resource group and repeat the process or discuss with us in the comment section below.
You will now be able to see your virtual machine running. In the next part of the post – How to install & setup WordPress on Microsoft Azure – we’ve discussed on how to connect to this machine and install and host WordPress on it.