##Related recommendations: "python video"
Method to configure web server:
1. Installation of IIS Generally, IIS is not installed by default when installing the operating system, so IIS needs to be installed when configuring the web server. The installation method is: 1. Open the "Control Panel", open "Add/Remove Programs", and the "Add/Remove Programs" window will pop up. 2. Click the "Add/Remove Windows Components" icon in the window to pop up the "Windows Component Wizard" dialog box. #3. Select the "Application Server" check box in the "Wizard". Click the "Details" button to pop up the "Application Server" dialog box. #4. Select the required components, among which "Internet Information Services (IIS)" and "Application Server Console" must be selected. After selecting "Internet Information Services (IIS)", click the "Details" button to pop up the "Internet Information Services (IIS)" dialog box. 5. Select "Internet Information Services Manager" and "World Wide Web Services". And after selecting "World Wide Web Service", click the "Details" button to pop up the "World Wide Web Service" dialog box. 6. "World Wide Web Service" must be selected. If you want the server to support ASP, you should also select "Active Server Pages". Click the "OK" button one by one to close each dialog box until you return to the "Windows Component Wizard" dialog box in Figure 1. 7. Click the "Next" button, and the system will start the installation of IIS. During this period, you may be asked to insert the Windows Server 2003 installation disk, and the system will automatically perform the installation. 8. After the installation is completed, a dialog box prompting successful installation will pop up. Click the "OK" button to complete the installation of IIS. Special Tip: If you want to load the FTP server at the same time, you should also select the "File Transfer Protocol (FTP) Service" check box in the "Internet Information Services (IIS)" dialog box. 2. Create a Web website in IISOpen "Internet Information Services Manager", right-click on "Website" in the directory tree, Select "New → Website" in the right-click menu to pop up the "Website Creation Wizard": The website description is the name of the website. It will be displayed in the directory tree of the IIS window to facilitate the administrator to identify each site. In this example, it is named "Zhiye's website". Website IP address: If you select "All Unassigned", the server will bind all IP addresses of the machine to the website. This option is suitable for servers with only The situation of this website. You can also select an IP address from the drop-down list box (the IP addresses listed in the drop-down list box are the configured IP addresses of this machine. If not, you should configure the IP address for this machine first and then select it.) TCP port: Generally, the default port number 80 is used. If it is changed to another value, the user must add the port number to the address when accessing the site. Host header: If the site already has a domain name, you can enter the domain name in the host header. #The home directory path is the location of the root directory of the website. You can use the "Browse" button to select a folder as the home directory of the website. Website access permissions are the permissions that limit users when accessing the website. "Read" is required. "Run script" allows the site to support ASP. Other permissions can be used as needed. set up. Click "Next" and the "Complete Wizard" dialog box will pop up, completing the creation process of the new website. You can see the newly created website in IIS. Copy the completed web page and related files to the home directory, and you can usually access the website.The method to access the website is: if you access it on this computer, you can enter "http://localhost/" in the address bar of the browser; if you access it on other computers on the network, you can enter it in the address bar of the browser. Enter "http://website IP address".
Note: If the TCP port of the website is not 80, the port number needs to be added to the address. Assuming that the TCP port is set to 8080, the access address should be written as "http://localhost:8080/" or "http://website IP address:8080".
3. Basic configuration of the website
If you need to modify the parameters of the website, you can right-click on the "Website Name" and select "Properties" in the right-click menu to open the "Website Properties" ” dialog box.
1. "Website" tab
"Website Identification": You can set the website name, IP address, and port number. Click the "Advanced" button to set the host header name.
2. "Home Directory" tag
The path name and access permissions of the home directory can be set in the local path.
3. "Document" tag
The default document refers to the default web page you want to open when visiting a website. This web page is usually the homepage of the website. . If the default document is not enabled or the website's homepage file name is not in the default document list, you need to specify the file name in the address when accessing the website.
There are initially only 4 file names in the default document list: Default.htm, Default.asp, index.htm and Default.aspx. I added an index.asp using the "Add" button and moved it to the top using the "Move Up" button. This is mainly because the home page of my website is called "index.asp", so it should be added to the list. It doesn't matter whether it is at the top of the list.
After the above configuration, a Web website can be used. Copy the created web page to the main directory of the website. The file name of the website home page should be included in the default document. Open the browser and enter "http://local IP address" in the address bar to open the homepage of the website. Other pages can be opened using hyperlinks within the web page.
4. Virtual Directory
A virtual directory can save a website from having to place all its content in the main directory. The virtual directory remains within the home directory from the user's perspective, but the actual location can be elsewhere on the computer, and the virtual directory can have a different name than the real directory. For example:
In the picture, the user sees a folder "pic" located in the home directory. Its real location is on the server. "D:myimage", and the home directory is located at "C:mywww". Assume that the domain name of the website is "www.abc.com", then when the user accesses "http://www.abc.com/pic/file 1", the actual location visited is "D:myimage file 1" on the server. Therefore, the real name and location of the virtual directory are unknown to the user.
Method to create a virtual directory:
Open the Internet Information Services window, right-click on the website where you want to create a virtual directory, and select "New" → "Virtual Directory". The virtual directory creation wizard pops up:
The alias is the mapped name, that is, the name when the customer accesses;
Path: the real path name on the server, that is, the actual location of the virtual directory;
Access permission: refers to the customer's access permission to the directory.
Click the "Next" button, a completion dialog box will pop up, and the virtual directory is successfully created. Copy the relevant files to the virtual directory, and users can access the specified files according to the virtual tree structure.
Usually, the access permissions, default documents, etc. of the virtual directory are inherited from the main directory. If you need to modify it, you can right-click on the virtual directory in "Internet Information Services Manager" and select "Properties" to modify it. The parameters of the virtual directory are set.
FAQ
1. How to create multiple websites on one web server?
Right-click on "Website" in IIS Manager, select "New Web Site", and then use the "Website Creation Wizard" to create a new website. One website can be created each time it is run.
The key to multiple websites is how to distinguish each website. The basis for differentiation is IP address, TCP port number, and host header. As long as any one of these three parameters is different.
①Use IP address to distinguish each website: First configure multiple IP addresses for the server, and then set an IP address for each website in the IP address column of the website properties.
②Use TCP port to distinguish each website: At this time, each website can use the same IP address, but set the TCP port differently (a value between 1024~65535 should be used), so that each website can also be distinguished. However, this method requires users to add the port number to the address when accessing the website, which is inconvenient and is generally not used.
③Use the host header to distinguish each website: The host header is a symbol string that conforms to DNS naming rules. Generally, the domain name of the website is used as the host header. You can set the host header by clicking the "Advanced" button in the "Website" tab of the website properties. As shown in the figure:
#Using this "advanced" setting, you can also configure multiple IP addresses for a website, or use different TCP ports.
2. After the website configuration is completed, why can’t it be opened?
The most common situation is that the file name of the website homepage is not added to the default document list. There are only 4 default documents for the website in IIS6: Default.htm, Default.asp, index.htm and Default.aspx , if your website homepage name is not one of these 4, you should add it. If not added, this page should be accessed using the address with the file name.
3. Why can’t my ASP page be executed?
In IIS6, ASP files must be executed when "Active Server Pages" is enabled. If "Active Server Pages" is not selected when installing IIS, "Active Server Pages" will not be enabled by default on the server and cannot be Execute the ASP file.
The method to enable "Active Server Pages" is: open "Internet Information Services Manager", select "Web Service Extensions", and then enable "Active Server Pages" inside. As shown in the picture:
The above is the detailed content of How to configure web server. For more information, please follow other related articles on the PHP Chinese website!