Article directory
1. Build an IIS website
1. Configure IIS in Windows Server 2008,
open the server manager, role, add role, and then click Next
Choose to install web server iis
Select role service
click to install
For testing http://127.0.0.1
Add an ASP application
and then confirm the installation
Put the site's source code on disk
Add a site and set it up
Find the clash you want to access in the application pool and modify it
Create a new "index.asp" under the default document
"Start" to modify the website application pool in the directory browsing , and forgot to modify it when setting up the website
Start under "ASP"
There may be some problems when building a website for the first time, and we may be prompted to add iis permissions to the website directory
Site Directory
Each website corresponds to a directory, and add IUSR and IIS_IUSRS permissions to this website directory
For example, I created an IIS directory under the root directory of the D disk, and then created a yidacms directory in it. My website program is placed in this directory. Among them, iis only needs to continue to save the permissions of the d drive, and for the yidacms directory, we need to add two more permissions, namely IUSR and IIS_IUSRS.
finally accessible website
Two, http redirection
First install the http redirection function
to redirect to Baidu
When we visit http://10.40.2.20 again, we will be redirected to Baidu's homepage
Three, virtual directory
The virtual directory is to integrate some scattered folders in the hard disk and then mount them under the main directory folder of the website. Users can access the mounted folders by using the method of visiting the website + virtual directory to access the files according to the path
.
Fourth, use the domain name to access the website
Because IP addresses are not easy to remember, users are more accustomed to using domain names to access websites; we can use domain names to access websites by creating host records for websites on the DNS server. First, after installing the dns service, you need to create a new zone
wizard
Subsequent default can be used, and then create a new host
cmd domain name resolution successfully
finally accessible website
5. Website Security
Install the security role first.
For example, disable anonymous authentication. After basic authentication is enabled, an account and password are required to access the website.
You can also restrict specific IP access, etc.
For example, my machine can be accessed normally,
but when the virtual network card gateway is disabled, it cannot be accessed.
Six, little knowledge
After we build a website, we can access it through the domain name and ip address,
but there are some differences between the two methods.
The domain name resolution directory will be under the specified directory of the website, and the IP address resolution directory will be in the upper-level directory of the website directory, and the scope will be wider.
For example :
I create a test111.txt file in the source code directory, the content is 1111111
Create test222.txt in the parent directory, the content is 2222222
Now use the domain name and ip to access respectively.
The domain name can be used to access test111.txt, but the test222.txt cannot be accessed
and the ip access is the same. It is expected that test222.txt can be accessed, but test111.txt cannot be accessed. Overturned. After
thinking about it, my IP and domain name are bound here, and it is not built in the default website directory of IIS, and the local file corresponding to the IP address is the source file of the website, so it is the same after parsing
In the course, Xiaodige’s website is in the root directory of the default website. The key is that the domain name is bound to the local specified directory, which is in the next level directory of the root directory of the website. Therefore, the ip access is under the website root directory www, and the domain name is in the website directory under www, so there will be such a situation.
Welcome to discuss.
Summarize
This section mainly talks about some website construction and some functions using middleware. There are still many functions used that have not been written, so let's explore by yourself.