Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1ced272

Browse files
committedFeb 23, 2021
freshness updates
1 parent e5e848c commit 1ced272

File tree

2 files changed

+60
-19
lines changed

2 files changed

+60
-19
lines changed
 

‎articles/application-gateway/create-multiple-sites-portal.md

Lines changed: 60 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ services: application-gateway
66
author: vhorne
77
ms.service: application-gateway
88
ms.topic: tutorial
9-
ms.date: 08/21/2020
9+
ms.date: 02/23/2021
1010
ms.author: victorh
1111
#Customer intent: As an IT administrator, I want to use the Azure portal to set up an application gateway so I can host multiple sites.
1212
---
1313

1414
# Tutorial: Create and configure an application gateway to host multiple web sites using the Azure portal
1515

16-
You can use the Azure portal to [configure the hosting of multiple web sites](multiple-site-overview.md) when you create an [application gateway](overview.md). In this tutorial, you define backend address pools using virtual machines. You then configure listeners and rules based on domains that you own to make sure web traffic arrives at the appropriate servers in the pools. This tutorial assumes that you own multiple domains and uses examples of *www.contoso.com* and *www.fabrikam.com*.
16+
You can use the Azure portal to [configure the hosting of multiple web sites](multiple-site-overview.md) when you create an [application gateway](overview.md). In this tutorial, you define backend address pools using virtual machines. You then configure listeners and rules based on two domains to make sure web traffic arrives at the appropriate servers in the pools. This tutorial uses examples of *www.contoso.com* and *www.fabrikam.com*.
1717

1818
In this tutorial, you learn how to:
1919

@@ -72,7 +72,7 @@ Sign in to the Azure portal at [https://portal.azure.com](https://portal.azure.c
7272
> [!NOTE]
7373
> For the Application Gateway v2 SKU, you can only choose **Public** frontend IP configuration. Private frontend IP configuration is currently not enabled for this v2 SKU.
7474
75-
2. Choose **Create new** for the **Public IP address** and enter *myAGPublicIPAddress* for the public IP address name, and then select **OK**.
75+
2. Select **Add new** for the **Public IP address** and enter *myAGPublicIPAddress* for the public IP address name, and then select **OK**.
7676

7777
:::image type="content" source="./media/application-gateway-create-gateway-portal/application-gateway-create-frontends.png" alt-text="Create another VNet":::
7878

@@ -82,15 +82,16 @@ Sign in to the Azure portal at [https://portal.azure.com](https://portal.azure.c
8282

8383
The backend pool is used to route requests to the backend servers that serve the request. Backend pools can be NICs, virtual machine scale sets, public IPs, internal IPs, fully qualified domain names (FQDN), and multi-tenant back-ends like Azure App Service. In this example, you'll create an empty backend pool with your application gateway and then add backend targets to the backend pool.
8484

85-
1. On the **Backends** tab, select **+Add a backend pool**.
85+
1. On the **Backends** tab, select **Add a backend pool**.
8686

8787
2. In the **Add a backend pool** window that opens, enter the following values to create an empty backend pool:
8888

8989
- **Name**: Enter *contosoPool* for the name of the backend pool.
9090
- **Add backend pool without targets**: Select **Yes** to create a backend pool with no targets. You'll add backend targets after creating the application gateway.
9191

9292
3. In the **Add a backend pool** window, select **Add** to save the backend pool configuration and return to the **Backends** tab.
93-
4. Now add another backend pool called *fabrikamPool*.
93+
4. Now add another backend pool called *fabrikamPool* the same way that you added the previous pool.
94+
1. Select **Add**.
9495

9596
:::image type="content" source="./media/create-multiple-sites-portal/backend-pools.png" alt-text="Create Backends":::
9697

@@ -100,13 +101,14 @@ The backend pool is used to route requests to the backend servers that serve the
100101

101102
On the **Configuration** tab, you'll connect the frontend and backend pools you created using a routing rule.
102103

103-
1. Select **Add a rule** in the **Routing rules** column.
104+
1. Select **Add a routing rule** in the **Routing rules** column.
104105

105106
2. In the **Add a routing rule** window that opens, enter *contosoRule* for the **Rule name**.
106107

107108
3. A routing rule requires a listener. On the **Listener** tab within the **Add a routing rule** window, enter the following values for the listener:
108109

109-
- **Listener name**: Enter *contosoListener* for the name of the listener.
110+
- **Rule name**: *contosoRule*.
111+
- **Listener name**: *contosoListener*.
110112
- **Frontend IP**: Select **Public** to choose the public IP you created for the frontend.
111113

112114
Under **Additional settings**:
@@ -119,10 +121,10 @@ On the **Configuration** tab, you'll connect the frontend and backend pools you
119121

120122
4. On the **Backend targets** tab, select **contosoPool** for the **Backend target**.
121123

122-
5. For the **HTTP setting**, select **Create new** to create a new HTTP setting. The HTTP setting will determine the behavior of the routing rule. In the **Add an HTTP setting** window that opens, enter *contosoHTTPSetting* for the **HTTP setting name**. Accept the default values for the other settings in the **Add an HTTP setting** window, then select **Add** to return to the **Add a routing rule** window.
124+
5. For the **HTTP setting**, select **Add new** to create a new HTTP setting. The HTTP setting will determine the behavior of the routing rule. In the **Add an HTTP setting** window that opens, enter *contosoHTTPSetting* for the **HTTP setting name**. Accept the default values for the other settings in the **Add an HTTP setting** window, then select **Add** to return to the **Add a routing rule** window.
123125

124126
6. On the **Add a routing rule** window, select **Add** to save the routing rule and return to the **Configuration** tab.
125-
7. Select **Add a rule** and add a similar rule, listener, backend target, and HTTP setting for Fabrikam.
127+
7. Select **Add a routing rule** and add a similar rule, listener, backend target, and HTTP setting for Fabrikam.
126128

127129
:::image type="content" source="./media/create-multiple-sites-portal/fabrikam-rule.png" alt-text="Fabrikam rule":::
128130

@@ -147,17 +149,19 @@ To add backend targets, you'll:
147149
### Create a virtual machine
148150

149151
1. On the Azure portal, select **Create a resource**. The **New** window appears.
150-
2. Select **Compute** and then select **Windows Server 2016 Datacenter** in the **Popular** list. The **Create a virtual machine** page appears.<br>Application Gateway can route traffic to any type of virtual machine used in its backend pool. In this example, you use a Windows Server 2016 Datacenter.
152+
2. Select **Windows Server 2016 Datacenter** in the **Popular** list. The **Create a virtual machine** page appears.<br>Application Gateway can route traffic to any type of virtual machine used in its backend pool. In this example, you use a Windows Server 2016 Datacenter.
151153
3. Enter these values in the **Basics** tab for the following virtual machine settings:
152154

155+
- **Subscription**: Select your subscription.
153156
- **Resource group**: Select **myResourceGroupAG** for the resource group name.
154157
- **Virtual machine name**: Enter *contosoVM* for the name of the virtual machine.
158+
- **Region**: Select the same region that you used before.
155159
- **Username**: Enter a name for the administrator user name.
156160
- **Password**: Enter a password for the administrator.
157161
1. Accept the other defaults and then select **Next: Disks**.
158162
2. Accept the **Disks** tab defaults and then select **Next: Networking**.
159163
3. On the **Networking** tab, verify that **myVNet** is selected for the **Virtual network** and the **Subnet** is set to **myBackendSubnet**. Accept the other defaults and then select **Next: Management**.<br>Application Gateway can communicate with instances outside of the virtual network that it is in, but you need to ensure there's IP connectivity.
160-
4. On the **Management** tab, set **Boot diagnostics** to **Off**. Accept the other defaults and then select **Review + create**.
164+
4. On the **Management** tab, set **Boot diagnostics** to **Disable**. Accept the other defaults and then select **Review + create**.
161165
5. On the **Review + create** tab, review the settings, correct any validation errors, and then select **Create**.
162166
6. Wait for the virtual machine creation to complete before continuing.
163167

@@ -193,9 +197,9 @@ In this example, you install IIS on the virtual machines only to verify Azure cr
193197
194198
3. Select **contosoPool**.
195199
196-
4. Under **Targets**, select **Virtual machine** from the drop-down list.
200+
4. Under **Target type**, select **Virtual machine** from the drop-down list.
197201
198-
5. Under **VIRTUAL MACHINE** and **NETWORK INTERFACES**, select the **contosoVM** virtual machine and it's associated network interface from the drop-down lists.
202+
5. Under **Target**, select the **contosoVM** virtual machine's network interface from the drop-down list.
199203
200204
![Add backend servers](./media/create-multiple-sites-portal/edit-backend-pool.png)
201205
@@ -204,23 +208,57 @@ In this example, you install IIS on the virtual machines only to verify Azure cr
204208
205209
Wait for the deployment to complete before proceeding to the next step.
206210
207-
## Create a www A record in your domains
211+
## Edit your hosts file
208212
209-
After the application gateway is created with its public IP address, you can get the IP address and use it to create an A record in your domains.
213+
After the application gateway is created with its public IP address, you can get the IP address and use it to edit your hosts file to resolve `www.contoso.com` and `www.fabrikam.com`
210214
211215
1. Click **All resources**, and then click **myAGPublicIPAddress**.
212216
213217
![Record application gateway DNS address](./media/create-multiple-sites-portal/public-ip.png)
214218
215-
2. Copy the IP address and use it as the value for a new *www* A record in your domains.
216-
219+
2. Copy the IP address and use it as the value for a new *www* A records in your hosts file.
220+
1. On your local machine, open an administrative command prompt, and navigate to `c:\Windows\System32\drivers\etc`.
221+
1. Open the hosts file, and add the following entries, where `x.x.x.x` is the application gateway's public IP address:
222+
```dos
223+
# Copyright (c) 1993-2009 Microsoft Corp.
224+
#
225+
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
226+
#
227+
# This file contains the mappings of IP addresses to host names. Each
228+
# entry should be kept on an individual line. The IP address should
229+
# be placed in the first column followed by the corresponding host name.
230+
# The IP address and the host name should be separated by at least one
231+
# space.
232+
#
233+
# Additionally, comments (such as these) may be inserted on individual
234+
# lines or following the machine name denoted by a '#' symbol.
235+
#
236+
# For example:
237+
#
238+
# 102.54.94.97 rhino.acme.com # source server
239+
# 38.25.63.10 x.acme.com # x client host
240+
241+
# localhost name resolution is handled within DNS itself.
242+
# 127.0.0.1 localhost
243+
# ::1 localhost
244+
x.x.x.x www.contoso.com
245+
x.x.x.x www.fabrikam.com
246+
247+
```
248+
1. Save the file.
249+
1. Run the following commands to load and display the changes to your hosts file:
250+
```dos
251+
ipconfig/registerdns
252+
ipconfig/displaydns
253+
```
254+
217255
## Test the application gateway
218256

219-
1. Enter your domain name into the address bar of your browser. Such as, `http://www.contoso.com`.
257+
1. Type a domain name into the address bar of your browser. For example, `http://www.contoso.com`.
220258

221259
![Test contoso site in application gateway](./media/create-multiple-sites-portal/application-gateway-iistest.png)
222260

223-
2. Change the address to your other domain and you should see something like the following example:
261+
2. Change the address to the other domain and you should see something like the following example:
224262

225263
![Test fabrikam site in application gateway](./media/create-multiple-sites-portal/application-gateway-iistest2.png)
226264

@@ -235,6 +273,9 @@ To remove the resource group:
235273
3. On the **Resource group page**, select **Delete resource group**.
236274
4. Enter *myResourceGroupAG* for **TYPE THE RESOURCE GROUP NAME** and then select **Delete**.
237275

276+
To restore the hosts file:
277+
1. Delete the `www.contoso.com` and `www.fabrikam.com` lines from the hosts file and run `ipconfig/registerdns` and `ipconfig/flushdns` from the command prompt.
278+
238279
## Next steps
239280

240281
> [!div class="nextstepaction"]
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.