Skip to content

Commit 3470802

Browse files
feat(tutorial): publishing a website to a windows server instance
1 parent 28bb19b commit 3470802

File tree

2 files changed

+107
-0
lines changed

2 files changed

+107
-0
lines changed
25.5 KB
Loading
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
meta:
3+
title: Publishing a website to a Windows instance using Web Deploy
4+
description: Learn how to configure a Scaleway Instance with Windows Server to remotely publish web applications using Web Deploy.
5+
content:
6+
h1: Publishing a website to a Windows instance using Web Deploy
7+
paragraph: Learn how to configure a Scaleway Instance with Windows Server to remotely publish web applications using Web Deploy.
8+
tags: instances windows-server iis web-deploy
9+
categories:
10+
- instances
11+
- elastic-metal
12+
dates:
13+
validation: 2025-01-20
14+
posted: 2025-01-20
15+
---
16+
17+
## How to Use Web Deploy to Publish a Website to Scaleway's Windows Server VMs
18+
19+
This guide explains how to publish a web application to a Scaleway instance with Windows Server using the following tools:
20+
- (IIS)[https://iis.net/], which is the default web server developed by Microsoft for hosting web applications on Windows.
21+
- [Web Deploy](https://www.iis.net/downloads/microsoft/web-deploy), a single click remote deployment technology for IIS.
22+
Throughout this guide, you'll learn how to:
23+
- Configure the Windows Server instance with Web Deploy;
24+
- Set up a website in IIS;
25+
- Publish an application directly from Visual Studio.
26+
27+
<Macro id="requirements" />
28+
- A Scaleway account logged into the [console](https://console.scaleway.com)
29+
- [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization
30+
- An [Instance](/compute/instances/how-to/create-an-instance/) running Windows Server or Windows Server Core with an attached IPV4 address
31+
32+
<Message type ="note">
33+
The Windows Server instance must have an [IPV4 address attached](/compute/instances/concepts/#dynamic-ip).
34+
</Message>
35+
36+
## Configuring Windows Server to accept Web Deploy
37+
38+
In Windows Server, IIS and its remote management components are not installed by default and need to be added as features. Web Deploy, a tool for deploying web applications, is distributed separately by Microsoft. Here's how to set up your Windows Server to accept Web Deploy:
39+
40+
1. [Connect](/compute/instances/how-to/connect-to-instance/) to your Windows Server instance and open a PowerShell prompt.
41+
42+
2. Install the necessary IIS features and management tools:
43+
```powershell
44+
Install-WindowsFeature Web-Server, Web-WebServer, Web-Mgmt-Tools, Web-Mgmt-Service
45+
```
46+
47+
3. Download and run the Web Deploy installer. An up-to-date, direct download link can be found at https://aka.ms/webdeploydownload:
48+
```powershell
49+
Invoke-WebRequest -Uri "https://download.microsoft.com/download/b/d/8/bd882ec4-12e0-481a-9b32-0fae8e3c0b78/webdeploy_amd64_en-US.msi" -OutFile webdeploy.msi
50+
Start-Process msiexec.exe -ArgumentList '/i webdeploy.msi'
51+
```
52+
53+
4. Follow the installation wizard launched by the previous command. When prompted, select the *Complete* installation.
54+
55+
5. Start the Web Management Service for IIS:
56+
```powershell
57+
Start-Service WMSVC
58+
```
59+
60+
## Creating the Website Configuration in IIS
61+
62+
The instance is now ready to accept Web Deploy connections. You will create a configuration for a new website in IIS to use as a Web Deploy target. In this guide, the website is named *MyApplication*.
63+
64+
1. Create a directory for the website:
65+
```powershell
66+
mkdir "C:\inetpub\wwwroot\MyApplication"
67+
```
68+
69+
2. Create a new website in IIS with the specified name and path:
70+
```powershell
71+
New-Website -Name "MyApplication" -PhysicalPath "C:\inetpub\wwwroot\MyApplication"
72+
```
73+
74+
3. Remove port bindings of the default website and create a new binding for the MyApplication website on port 80:
75+
```powershell
76+
Remove-WebBinding "Default Web Site"
77+
New-WebBinding -Name "MyApplication" -IPAddress "*" -Port 80 -HostHeader ""
78+
```
79+
80+
4. Start the newly created website:
81+
```powershell
82+
Start-Website -Name "MyApplication"
83+
```
84+
85+
## Publishing from Visual Studio
86+
87+
1. Open or create a web project in Visual Studio.
88+
2. Right-click the solution and select "Publish".
89+
3. Choose "Web Server (IIS)" and click "Next".
90+
4. Select "Web Deploy" and click "Next".
91+
5. Set up the publish profile:
92+
- Server: `<Your_Instance_IP>:8172`
93+
- Site name: MyApplication
94+
- Destination URL: `<Your_Instance_IP>`
95+
- User name: Administrator
96+
- Password: (Use the password retrieved earlier)
97+
<Lightbox src="scaleway-webdeploy_profile.webp" alt="A screenshot of the Web Deploy profile configuration in Visual Studio" size="medium" />
98+
6. Click "Finish" to create the profile.
99+
7. Click "Publish" to deploy your website.
100+
101+
## Accessing Your Website
102+
103+
Open a web browser and navigate to your server's IP address. Your website should now be live.
104+
105+
<Message type="note">
106+
Depending on your website technology, you may need to install additional runtime components on the Windows Server instance, such as the [.NET hosting bundle](https://dotnet.microsoft.com/en-us/download/dotnet).
107+
</Message>

0 commit comments

Comments
 (0)