How to implement multiple Web site methods on a single server _ server

Source: Internet
Author: User
Tags port number
Summary: After the Windows2000server is successfully installed, a default Web site is typically launched to provide Internet services for the entire network. In small and medium-sized LAN, the server is often only one, but a Web site is obviously unable to meet the needs of the job. So, can you set up multiple Web sites on a single server (hereinafter referred to as "one machine, multiple stations")? The answer is yes, and there are many ways to achieve this. We know that each Web site on the network has a unique identity that enables the client to access it accurately. This identification consists of three parts, namely TCP port number, IP address and host header names, to achieve "one machine multiple stations" need to do in these three areas.
Now we have a windows2000server server, on this server to establish the default site "Teacher's house" and the new site "Student World" (to build more sites the same principle), below we explore three different ways of implementation.
Approach one TCP port method
We know that the default port for a Web site is typically 80, and if you change this end, you can achieve the purpose of adding a site on the same server.
Assuming that the server name is master and a network card is installed with an IP address of 192.168.0.1, then installing IIS automatically generates a default Web site, which we will use as the teacher's home site. Click "Start" → "Program" → "Administrative Tools" → "Internet Services Manager", the Internet Information Services window appears (see attached picture). Right-click Default Web Site, and select Properties to set. In Web site identification, change the description to "Teacher's house", and the IP address select 192.168.0.1,tcp port to leave the default 80 unchanged. Copy the made Web site files to the default directory, and the "Teacher's home" setting is complete.
Below we will add "student World" site. In the Internet Information Services window, click the selected host name master and select operations → new → web site, the Web Site Creation wizard window appears, click Next, and then set the site description as "Student World", IP address selection 192.168.0.1, in the TCP port bar must be the default of 80 modified to other values, such as 1050, selected home directory, set good access, "Student World" Site settings are also completed.
Test the effect, enter http://192.168.0.1 in the browser address bar (the default port number 80 can be omitted), enter, we will visit the "Teacher Home" site. Enter http://192.168.0.1:1050 (Note that the port number after the IP address must not be less), the "Student World" site will appear. Unfortunately, multiple sites that are set in this way cannot be used in conjunction with DNS.
Typically, a single network card has only one IP address set. If we are binding multiple IP addresses for this NIC, each IP address corresponds to a Web site, the same can be achieved "one machine multiple stations" purpose.
Click "Start" → "settings" → "Control Panel", double-click Network and dial-up connections, right-click Local Area Connection, select Properties to bring up the local Area Connection Properties panel, select Internet Protocol (TCP/IP), and click Properties to bring up the Internet Protocol (TCP/IP Properties panel, click "Advanced" below to bring up the Advanced TCP/IP Settings panel. The IP address and subnet mask set by the network adapter are listed under the IP Address bar. Click the Add button, in the pop-up dialog box to fill in a new IP address (such as 192.168.0.2, note can not duplicate the IP address of other machines), the subnet mask is the same as the original (such as 255.255.255.0). Then, in turn, the bindings of multiple IP addresses are completed.
Set the default site "Teacher's house" as described in the previous example, and then we'll add the "Student World" site. In the Internet Information Services window, click the selected host name master, select action → new → web site, the Web Site Creation wizard window appears, click Next to set the site description as "Student World", IP address selection 192.168.0.2 ( Note You cannot be the same as the IP address of the default site, the TCP port remains the default of 80, select the home directory, set the access rights, the "Student World" Site settings complete.
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 that by entering the IP address to access the site is not convenient, you can completely set up DNS, with http://www.teacher.com instead of http://192.168.0.1 to visit the "Teacher's house", with http:// Www.student.com instead of http://192.168.0.2 to visit the "Student World".
Method of three main nose
Without changing the TCP port and IP address, the same can be achieved "one machine multiple stations", where we need to use "Host header names" to distinguish between different sites.
The so-called "host header names", in fact, refers to the friendly web site such as www.student.com, so to use the "host head" to achieve "one machine multiple stations", you must first DNS settings. Set up the http://www.teacher.com and http://www.student.com two URLs in DNS to point to the unique IP address 192.168.0.1.
The default site "Teacher's house" is set first in the previous two examples, so there is no need for special settings for the default site. Then refer to the above two examples to add "student World" site operation, IP address selection 192.168.0.1,tcp port to keep the default of 80, "the main head of this site" must fill in the www.student.com, and then select the home directory, set up access rights, "student world "The settings for the site are complete.
Enter http://www.teacher.com and http://www.student.com two URLs in the browser address bar respectively to test the effect. Unlike the last two cases, a "multiple station" implemented using the "Host Header" method must use a friendly web site to access it. The above three ways, you can choose to use depending on the circumstances. If the server has more than two network adapters installed, the same can be used "IP address method" for each network card to specify a different IP address, so as to achieve "one machine multiple stations."

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.