SoFunction
Updated on 2025-03-09

How to implement multiple web sites on one server

Summary: After Windows 2000 Server is successfully installed, a default Web site will generally be launched to provide Internet services to the entire network. In small and medium-sized LANs, there is often only one server, but one Web site obviously cannot meet the work needs. So, can we set up multiple Web sites on a server (hereinafter referred to as "one machine, multiple stations")? The answer is yes, and there are many ways to achieve this goal. We know that every Web site on the network has a unique identity, allowing clients to access accurately. This identification consists of three parts, namely the TCP port number, IP address and host header name. To realize "one machine, multiple stations", you need to work hard in these three aspects.
Now we have a Windows 2000 Server server. On this server, we need to establish the default site "Teacher's Home" and the new site "Student World" (the principle of establishing more websites is the same). Let's discuss three different implementation methods below.
Path 1 TCP port method
We know that the default port of a Web site is generally 80. If this port is changed, the purpose of adding a new site on the same server can be achieved.
Suppose the server is called Master, there is a network card installed, and the IP address is 192.168.0.1, then after IIS is installed, a default Web site will be automatically generated, and we will use it as the "Teacher's Home" website. Click "Start" → "Programs" → "Administrative Tools" → "Internet Service Manager" and the "Internet Information Service" window appears (see the attached picture). Right-click "Default Web Site" and select "Properties" to set it. In "Web Site Identification", change the description to "Teacher's Home", select IP address 192.168.0.1, and the TCP port remains the default 80 unchanged. Copy the created website files to the default directory, and the settings of "Teacher's Home" are completed.
Let’s add the “Student World” site. In the "Internet Information Service" window, click the selected host name Master, and then select "Operation" → "New" → "Web Site", and the "Web Site Creation Wizard" window appears. Click Next step in turn to set the site description as "Student World", and select 192.168.0.1. In the TCP port bar, you must modify the default 80 to other values, such as 1050, select the home directory, set the access permissions, and the settings of the "Student World" site are also completed.
To test the effect, enter http://192.168.0.1 in the browser address bar (the default port number 80 can be omitted), and press Enter, and we will visit the "Teacher's Home" site. Enter http://192.168.0.1:1050 (note that the port number after the IP address must not be missing), and the "Student World" site will appear. Unfortunately, multi-sites set up in this way cannot be used in conjunction with DNS.
Generally speaking, only one IP address is set for a network card. If we bind multiple IP addresses to this network card, each IP address corresponds to a Web site, then the purpose of "one machine and multiple stations" can also be achieved.
Click "Start" → "Settings" → "Control Panel", double-click "Network and Dial-up Connections", right-click "Local Connections", select "Properties" to bring up the "Local Connections Properties" panel, select "Internet Protocol (TCP/IP)", click "Properties" to bring up the "Internet Protocol (TCP/IP) Properties" panel, and click "Advanced" below to bring up the "Advanced TCP/IP Settings" panel. The IP address and subnet mask that the network card has set is listed under the IP address bar. Click the Add button and fill in the new IP address in the pop-up dialog box (such as 192.168.0.2, note that it cannot be repeated with the IP address of other machines). The subnet mask is the same as the original one (such as 255.255.255.0). Then determine it in turn, and the binding of multiple IP addresses is completed.
Set the default site "Teacher's House" as in the above example, and then we will add the "Student World" site. In the "Internet Information Service" window, click the selected host name Master, select "Operation → "New" → "Web Site", the "Web Site Creation Wizard" window appears, click Next, set the site description as "Student World", and select the IP address 192.168.0.2 (note that it cannot be the same as the IP address of the default site), and the TCP port remains unchanged by the default 80. Select the home directory, set the access permissions, and the settings of the "Student World" site are completed.
Enter http://192.168.0.1 and http://192.168.0.2 in the browser address bar respectively to test the effect. If you think it is not convenient to access the site by entering an IP address, you can set up DNS, use it instead of http://192.168.0.1 to access the "Teacher's House", and use it instead of http://192.168.0.2 to access the "Student's World".
Path 3 Host head method
Without changing the TCP port and IP address, we can also implement "one machine and multiple stations". Here we need to use "host header name" to distinguish different sites.
The so-called "host header name" actually refers to a friendly website. Therefore, to use the "host header method" to achieve "one machine and multiple stations", DNS settings must be performed first. Set and both URLs in DNS, pointing them both to the unique IP address 192.168.0.1.
According to the practice in the above two examples, first set the default site "Teacher's Home". Since it is the default site, there is basically no need to set it up. Then refer to the above two examples to add the "Student World" site. Select the IP address 192.168.0.1, and the TCP port remains the default 80. You must fill in the "Host head of this site" item, then select the home directory, set the access permissions, and the settings of the "Student World" site are completed.
Enter and two URLs in the browser address bar respectively to test the effect. Unlike the previous two examples, the "one machine, multiple stations" implemented by the "host head method" must be accessed using a friendly URL. You can choose to use the above three methods according to the specific situation. If the server has more than two network cards installed, the "IP address method" can also be used to specify a different IP address for each network card, thereby realizing "one machine, multiple stations".