Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Building web Server under server2016 & three kinds of Virtual Host experiment documents of

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Server2016 under the construction of web servers & three kinds of virtual host experimental documents experiment one

I. Experimental tasks

Website Home Directory--Path:c/inetpub/wwwroot

Default document format: View default document, most commonly index.html

Change document to open suffix display

Add Tang poetry website to your own website to run

II. Experimental procedures

1. Build a web server

Start server 2016 via VM, open Server Manager

selection server

Add server role (select web server (IIS))

Add corresponding function (default selected for this experiment)

Open windows administration tools after successful installation

Internet Information Services(IIS) appears, indicating that the service has been built.

2. Build a web site

Open the server that has been set up (the arrow points to the default website)

Set the virtual network card corresponding to server2016, set the IP address of virtual network card VMnet1 and server2016 server network card

Configure virtual NIC (VMnet1 is selected for this experiment, virtual NIC and server NIC are on the same network segment, 192.168.80.0/24 is used for this experiment)

Configuring Virtual Network Cards

Configure Server2016 Server NIC

View Website Home Directory Path

Note: The physical path is the home directory path of the website, and %SystemDrive% is the disk variable in the path, which corresponds to the C disk of the server.

View default documents and default document formats, the most commonly used is Index.html

Change Document Suffix Name

Enter the root directory, delete the content of the default website, create a new text document, and open the hidden extension of the file.

Note: First write the content of the website to be written in the txt file, and finally set the name of the website to index.html.

Add Tang poetry website to your own website to run

Right-click Add Website

Note: website name customization, the most important thing is that the physical path of the website and the bound IP address must exist and be consistent in the server.

3. Verification in PC real machine

Ping Server IP Address 192.168.80.33

Open the browser in the real machine and enter the IP address bound to the website (i.e. the IP address of the server network card)

experiment two

I. Experimental tasks

Virtual directories: Share folders with web pages

Access: 192.168.80.33/music

Note that the content format needs to be recognized

II. Experimental procedures

Align Tang Dynasty website right-click to add virtual directory

Alias custom, music file in physical path created in advance

Verify that the virtual file pressure was added successfully

Create a new html index file in the folder for testing

Verify from the browser of the real machine (add/music after the IP of the original Tang Dynasty website)

the third experiment

I. Experimental tasks

Virtual hosting: multiple websites running on the same server

Three ways to do this:

based on the same IP address;

$, Based on the same IP address, different port numbers; default 80, modify any above 1024;8080

$, based on hostname;(dns)(hosts)

II. Experimental procedures

1. Based on IP address

Based on IP address, that is, a website corresponds to an IP address, and an IP address corresponds to a network card. Therefore, in order to realize the same server running multiple websites, you must add another network card (VMnet2 is used in this experiment).

Add a virtual NIC VMnet2 to the virtual machine

Set the IP address of the same network segment in the real PC and server respectively (the IP address of the network segment 192.168.90.0/24 is used in this experiment)

Configuring Virtual Network Cards in PC

Configuring Virtual Network Cards in Server2016

Add website (bound IP address should be 192.168.90.33)

Check if the website was added successfully

Verify that multiple websites are running on the same server (only two websites were added for this lab)

Website 1:

Website 2:

2. Based on port number (the same IP: 192.168.80.33, port 80 and 8080 respectively)

Add website (port number changed to 8080)

Note: Kaixin website and Tangshi website belong to the same IP address with different port numbers. Tangshi website is the default port 80, and Kaixin website is port 8080.

Browser verification from real PC

Note: Port number colon must be colon in English state; server2016 firewall must be turned off in real machine and virtual machine

3. Based on the host name (Tang Shi net and city dynamic net are used in this experiment)

Select the corresponding IP address to edit

Add host name

Change host file Add DNS manually (path: C:\Windows\System32\drivers\etc)

Note: #stands for comment

Change host files are system files and should be moved to the desktop to change as text and then moved back, otherwise there will be no permission to change.

Verification from PC

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report