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 of

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Set up web server

There are three ways to build a web server:

1. Based on IP address

2. Based on port number (default port 80, which can be modified)

3. Based on hostname (dns, hosts)

First of all, determine the installation of the web service. If it is not installed, you can follow the demonstration below.

This lab is based on windows server 2016.

Open Select Server Manager Select Server role web Server Select next and complete the installation.

After waiting a moment to complete the installation, open the internet informationservices (iis) Manager

After opening it, right-click on the website to add the website you want to add, you can add several more.

It should be noted that only the following format files are recognized by default, otherwise you have to add them manually.

Fill in the required website name and content directory

As mentioned at the beginning, there are three ways to implement this method based on IP address first.

Experiment one

Based on the IP address, different websites can have different IP addresses, but the corresponding network cards are required to assign their own IP.

For example, my network card one assigned 192.168.5.55 and the second network card assigned 192.168.5.11 corresponding to a website and b website respectively.

Modify the names and physical paths and IP addresses of websites an and b as shown in the figure below.

Confirm and start the website after the modification is completed

Let's take a look at the effect.

A website

B website

Experiment two

-implementation based on port number

In some cases, multiple IP cannot be allocated, so it is necessary to run multiple websites on the same server based on the port number.

Add two websites in the same way, but choose the same IP address and different port number when adding

If the port number of a website is 80 b by default, the website is 8080.

A website effect

B website effect

Experiment 3

-based on hostnam

Based on the hostname, there are also two ways: dns and modify hosts.

Because there is no dns in the experimental environment, it can only be realized by modifying hosts.

Modify hosts on this machine and add the IP address and hostname corresponding to a website and b website

Use ping to detect whether it is accessible, and if the returned data is resolved to the IP address, it is feasible.

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