Detailed explanation of the WEB server of IIS (on)


1. Introduction to WEB server

WEB server is also called web server or HTTP server . Everyone can understand web server, why is it called HTTP server?

Because the protocol used by the WEB server is HTTP or HTTPS , the only difference between the two protocols is security .HTTP does not encrypt data, HTTPS encrypts, there is no difference between the two elsewhere. So generally we don't mention HTTPS,The WEB server is collectively referred to as the HTTP server

Since the WEB server provides HTTP services, theIt means that this server has opened the HTTP service. If our clients want to enjoy HTTP services and access web pages online, they also need to understand HTTP services. The browsers we use every day, such as Google, Firefox, 360, IE, etc., their professional names are HTTP clients , and these clients can recognize HTTP services.

2. Service port number

HTTP protocol port number: TCP 80
HTTPS protocol port number: TCP 443

3. WEB service publishing software

Since we want to learn to build a server, the steps to build other servers are the same as before: first configure a static IP, then install the service software, and finally open the software for proper configuration. WEB servers are no exception, but there are more than one types of software to choose from. After all, WEB servers are the most demanded servers on the Internet. If we have written a front-end webpage, or downloaded a webpage source code from the Internet, we only need to publish it on a certain server through the web service software, and then assign a domain name to the server, so that others can see it.

Let me introduce several commonly used WEB service publishing software :

  1. Microsoft: IIS (can publish WEB sites and FTP sites, highly recommended)
  2. Linux: Apache/LAMP/Tomcat/Nginx , etc.

The above are all officially released software, and some third-party released software such as: phpstudy , XAMPP, etc., if it isIn the actual production of an enterprise, it is necessary to build an enterprise server and choose the above two official types of software,TheseThird-party software is only suitable for personal experiments. Today we are going to learn and use Microsoft's IIS software

4. Deploy the WEB server

1. Configure a static IP address

The two virtual machines used in today's experiment are: Windows XP and Windows server 2003 , the IP configuration for XP is 10.1.1.1 , and the IP configuration for 2003 is 10.1.1.2 . I have already configured it in advance, so I won’t talk about the specific configuration method. If you still have friends who don’t know how to configure static IP, you can read my last blog [ How to Remotely Manage Servers ].

2. Install the IIS-WEB plugin

The steps to install the IIS-WEB plug-in are as follows:

  1. Enter the 2003 virtual machine, open [ My Computer ], double-click to open the boot CD

insert image description here

  1. Click [ Install Optional Windows Components ]

insert image description here

  1. Scroll down to find [ Application Server ], double-click to open

insert image description here

  1. Double-click to open [ Internet Information Services (IIS) ]

insert image description here

  1. Check [ World Wide Web Service ], the following is the FTP service , which will be used later, we also check and install it, and then click [ OK ].World Wide Web is WWW, WEB server is also called WWW server. What needs to be noted here is: when you check [ World Wide Web Services ], you will also select [Public Files], this is also necessary, do not remove the check

insert image description here

  1. Click [ OK ], click [ Next ] to enter the installation process

insert image description here

  1. During the process, the following pop-up window will appear twice, you need toChange the D drive to the E drive, and change it twice, and then click [ OK ]

insert image description here

insert image description here

  1. Click [ Finish ], the installation is successful

insert image description here

  1. Click [ Start ] in the lower left corner, click [ All Programs ], click [ Administrative Tools ], you can see the installed [ Internet Information Services (IIS) Manager ], and then open it

insert image description here

  1. After opening, you can see the left side, and the website site and FTP site have been displayed

insert image description here

Now the question is: Is port 80 of this server open?

insert image description here

It doesn't matter, we can verify it, cmd enters the console, enters the command: netstat -an , and then press Enter, as shown below:

insert image description here

In the figure, we can see that port 80 has been opened, port 21 is the FTP service , we can see that port 443 is not opened, and we will introduce 443 later, this port is generally not easy to open. Now that port 80 has been opened, it isIt means that this server has opened the HTTP service. Go back to XP to verify, open the IE browser, enter the IP address of this server 10.1.1.2 in the address bar , and press Enter, as shown below:

insert image description here

You can see that http is automatically completed in the address bar , because all browsers have their own http client , and there is no port 80 behind it, which meansThe default is to access port 80. Looking at the content of the webpage again, there is displayed content, and no error is reported. It means that my request has been sent to this server, and this server also responded to me and returned a webpage to me.It shows that the server built has been successful, and a website has been released to the outside world.

So where is the published website? Go back to the 2003 server, click [ Website ], you can see that there is a default website . In fact, no matter IIS software has its own default website, Apache , Nginx, etc. that you will come into contact with in the future will all come with their own default website.

insert image description here

Here comes the question: Where is this default website? Let's find out. Open [ My Computer ], open the C drive , you can see that there is a folder called Inetpub

insert image description here

Open Inetpub , the wwwroot inside is the WEB site.A website generally exists in the form of a folder, and its related web pages are placed in a folder. This folder is called a website.

insert image description here

Let's open the wwwroot folder to see, there is a web page in the following picture:

insert image description here

Double click to open this page

insert image description here

You can see that this is exactly the same as the page you saw just now when the client accesses it, which means that just nowThe website visited by the client is the webpage under this path. It means that after we install the IIS software, we don't need to do anything, and the website already exists. Here comes the question: Can this default website be stopped?

insert image description here

It can be stopped, but it is not recommended to delete. Because I will introduce various certificate services later, including https services, which may use the default website, so it is not recommended to delete them. We right-click [ Default Website ], and click [ Stop ] in the pop-up drop-down list

insert image description here

It can be seen that it has stopped

insert image description here

When the last website of IIS (and of course the only one at present) stops, we go back to XP, open the IE browser, enter the IP 10.1.1.2 , and press Enter to check again

insert image description here

It can be seen that an error has been reported, and we request the server through the client at this time, and the server will tell us: Sorry, port 80 is closed. Let's go back to the 2003 server, enter the console, enter the command: netstat -an , press Enter to see

insert image description here

Port 80 can no longer be found . When the last website on the server is stopped, that is, there is no website, port 80 will be automatically closed.Port 80 is actually opened by the website. If there is no website, it will be closed naturally.

Guess you like

Origin blog.csdn.net/2201_75641637/article/details/132415753