Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2e363c6

Browse files
committed
update post with linux info
1 parent729a86a commit2e363c6

File tree

2 files changed

+51
-38
lines changed

2 files changed

+51
-38
lines changed

‎_posts/2021-09-21-provision-a-test-vm-webserver-on-azure.md‎

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title:How to quickly deploy a test web server on an Azure VM
3+
date:2025-06-16 10:00
4+
tags:[Azure, Virtual Machine, Portal, web server, custom script extension]
5+
---
6+
7+
For my**Labs**, I often need to create and build virtual machines.**Many virtual machines** :-). One of the most "popular" machine recently is for me the web server. The requirement for my needs is often very simple:**create a web server that responds on port 80, that is able to make me understand "what machine I’m interacting with"**, so, the ideal response message to the request*http://my-machine-ip* should be "*myMachineName*".
8+
9+
10+
#Windows machine
11+
12+
From Azure portal is quick enough to create a virtual machines. In particular I use as the starting image "**windows 2019 datacenter gen1**".
13+
14+
Once the machine is created, go tpo Azure Portal > virtual machines >`vmname` > run command > run powershell script
15+
16+
type:
17+
18+
```powershell
19+
Install-WindowsFeature -name Web-Server -IncludeManagementTools
20+
Remove-Item -Path 'C:\inetpub\wwwroot\iisstart.htm'
21+
Add-Content -Path 'C:\inetpub\wwwroot\iisstart.htm' -Value $($env:computername)
22+
```
23+
24+
click**Run**
25+
26+
After a couple of minutes the script will be executed, and IIS will be provisioned and working.
27+
28+
![browser output](../assets/post/2021/install-iis-output.png)
29+
30+
#Linux machine
31+
From Azure portal is quick enough to create a virtual machines. In particular I use as the starting image "**windows 2019 datacenter gen1**".
32+
33+
Once the machine is created, go tpo Azure Portal > virtual machines >`vmname` > run command > run linux shell script
34+
35+
type:
36+
37+
```shell
38+
sudo apt-get update
39+
sudo apt-get install -y nginx
40+
sudo rm /var/www/html/index.html
41+
echo$HOSTNAME| sudo tee /var/www/html/index.html
42+
```
43+
44+
click**Run**
45+
46+
After a couple of minutes the script will be executed, and IIS will be provisioned and working.
47+
48+
49+
50+
![browser output](../assets/post/2021/install-iis-output.png)
51+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp