Web Farm of IIS Web Server (shared Web page and shared configuration)

Source: Internet
Author: User

The Web Farm of the IIS Web server uses the environment to create a Web Farm composed of the IIS Web server and set its website to www.itchenyi.com. We will enable Windows NLB directly on the two IIS Web servers in the figure. The NLB operation mode adopts the unicast mode. 650) this. length = 650; "class =" aligncenter size-full wp-image-3600 "title =" webframgx "src =" http://www.bkjia.com/uploads/allimg/131228/0241501040-0.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241501040-0.jpg "height =" 320 "width = "490"/>
Web FarmSoftware and Hardware requirementsIf you want to build the above environment, the hardware and software configurations must match the following claim requirements, such as non-production environment. We recommend that you use the virtual machine provided by Microsoft Hyper-V for testing)1, IIS WebServer Web1And Web2: The two servers that constitute the Web Farm are Windows Server 2008R2 Enterprise, and the Web Server IIS role will be installed. At the same time, we will create an NLB cluster, and add the two servers to the cluster. The two servers have two NICs and one connectionNetwork1, One-piece connectionNetwork2, OnlyNic1Enable Windows NLB, soNic1In addition to the original fixed IP addresses 192.168.1.1 and 192.168.1.2), they also have a common cluster IP address 192.168.1.254) and the cluster IP address is used to receive the http://www.itchenyi.com/) for Internet requests from the test computer Win-XP /).2, File server FileServer: This Windows Server 2003 Server is used to store the webpage content of the Web Server, that is, the home directories of the two Web servers are in the same folder of this file Server, the two Web servers should also use the same settings, and these sharing settings are also stored on this file server.Tip:Because the Web Farm settings are used here, the test environment is simplified to only one file server. Therefore, the webpage content and sharing settings have no fault tolerance function, therefore, multiple file servers can be set up to use DFS replication to synchronize webpage content and sharing settings to provide fault tolerance.DNSServer: The Windows Sever 2003 Server is still used to parse the IP address of the Web Farm website www.itchenyi.com.Testing Computer WIN-XP: I still keep using my habits here. I used XP to test whether www.itchenyi.com can connect to the Web Farm normally. I suggest that the computer and DNS server can be the same computer, which has no impact on the test.Prepare the network environment and ComputerHere we will list the entire process of building the Web Farm environment for your reference. 1. Connect DNS1 and WIN-XP Nic to network 1, Web1 and Web2 Nic 1 to network 1, Nic 2 to Network 2, FileServer Nic to Network 2. If you use Windows Server 2008R2 Hyper-V virtual machine, create two virtual networks. 2. Change the two network card names of the two Web servers to facilitate identification, for example. Tip: If you have copied the operating system through a virtual machine, run the sysprep.exe program on the computer to change its SID. 650) this. length = 650; "class =" aligncenter size-full wp-image-3601 "title =" webframgx1 "src =" http://www.bkjia.com/uploads/allimg/131228/02415063L-2.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/02415063L-2.jpg "height =" 223 "width = ""559"/>
3. Set the IP address, subnet mask, and preferred DNS as shown in the preceding topology. 4. temporarily disable the firewalls in all test environments.DNSServer settings, such as Windows 2003Need to insert a CD)650) this. length = 650; "class =" aligncenter size-full wp-image-3602 "title =" webframgx2 "src =" http://www.bkjia.com/uploads/allimg/131228/0241501922-4.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241501922-4.jpg "height =" 307 "width = ""596"/>
New region |AddRecord omitted irrelevant steps)650) this. length = 650; "class =" aligncenter size-full wp-image-3603 "title =" webframgx3 "src =" http://www.bkjia.com/uploads/allimg/131228/0241503518-6.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241503518-6.jpg "height =" 190 "width = ""638"/>
Test DNSResolution provided normally650) this. length = 650; "class =" aligncenter size-full wp-image-3604 "title =" webframgx4 "src =" http://www.bkjia.com/uploads/allimg/131228/0241505325-8.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241505325-8.jpg "height =" 210 "width = ""580"/>
Tip:Although the cluster IP address of the Web Farm website is successfully resolved, no cluster is created or the cluster IP address is set. Therefore, information about the connection failure is displayed. If both the cluster and the cluster IP address are set up. If the icmp packet is still sent, it is likely that the firewall of win server 2008 is not disabled.File Server SettingsThis file server is used to store the sharing settings of the Web server. To share Web content, you must create a user account in the local security database, so that the two Web servers can use this account to connect to the file server. Tip: if the file server has joined the Active Directory domain, you can also use the domain account. 650) this. length = 650; "class =" aligncenter size-full wp-image-3605 "title =" webframgx5 "src =" http://www.bkjia.com/uploads/allimg/131228/0241501F6-10.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241501F6-10.jpg "height =" 353 "width = ""384"/>
Add a webuser to the WebFiles File Permission 650) this. length = 650; "class =" aligncenter size-full wp-image-3606 "title =" webframgx6 "src =" http://www.bkjia.com/uploads/allimg/131228/0241504120-12.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241504120-12.jpg "height =" 443 "width = ""392"/>
Create two subfolders in the file, one for storing the shared configuration and the other for storing the Home Directory of the shared web site), and set the file name to meet the requirements and Contents, such as 650) this. length = 650; "class =" aligncenter wp-image-3607 "title =" webframgx7 "src =" http://www.bkjia.com/uploads/allimg/131228/024150O20-14.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/024150O20-14.jpg "height =" 218 "width =" 641" />
WebServer Web1.We will install the Web server IIS role on Web1, and assume that the Web page is written in ASP. NET. Therefore, you also need to install the ASP. NET role. 650) this. length = 650; "class =" aligncenter wp-image-3608 "title =" webframgx8 "src =" http://www.bkjia.com/uploads/allimg/131228/0241506221-16.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241506221-16.jpg "height =" 232 "width =" 624" />
650) this. length = 650; "class =" aligncenter wp-image-3609 "title =" webframgx9 "src =" http://www.bkjia.com/uploads/allimg/131228/0241504255-18.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241504255-18.jpg "height =" 248 "width =" 624" />
Next, create a new homepage for testing. The file name is default. aspx, but the content is as follows. Put the file under the default home directory % SystemDrive % \ inetpub \ wwwroot of the website.

<B> the IP address of the client is: </B> <% Response. write (Request. serverVariables ("remote_addr") %> <br> <B> the IP address of the Web Server is: </B> <% Response. write (Request. serverVariables ("local_addr") %>
We recommend that you change the priority of the website to read default files so that the website can read default files first. aspixel, 650) this. length = 650; "class =" aligncenter size-full wp-image-3610 "title =" webframgx10 "src =" http://www.bkjia.com/uploads/allimg/131228/02415053H-20.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/02415053H-20.jpg "height =" 278 "width = ""642"/>
Then we use the browser on the client to test whether the website can be connected normally. For example, the interface for successful connection. In the figure, we directly use the fixed IP address of Web1 to connect to the Web, because Windows NLB is not enabled yet. The cluster IP address cannot be used for connection. 650) this. length = 650; "class =" aligncenter size-full wp-image-3611 "title =" webframgx11 "src =" http://www.bkjia.com/uploads/allimg/131228/0241504946-22.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241504946-22.jpg "height =" 158 "width = ""584"/>
Web Server Web2 SettingsThe settings of Web2 are roughly the same as those of Web1, and only the summary is listed below: 1. Install the Web server IIS on Web2) Role and ASP. NET role service. 2, NoCreate default. aspx and NoCopy default. aspx to the main directory of web2. 3. perform the test directly, as shown in the following 650) this. length = 650; "class =" aligncenter size-full wp-image-3612 "title =" webframgx12 "src =" http://www.bkjia.com/uploads/allimg/131228/0241503647-24.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241503647-24.jpg "height =" 194 "width = ""645"/>
Shared web page and shared ConfigurationNext, let's make the two websites use the webpage and sharing configuration stored in the FileServer of the file server. Configure the Web1 shared web page. We will use the web page of Web1 as the shared web page of the two websites. Therefore, we will first use the test homepage default. aspx in the Web1 home directory. Copy files to the Shared Folder \ IP \ Webfiles \ Contents of the FileServer over the network. 650) this. length = 650; "class =" aligncenter size-full wp-image-3613 "title =" webframgx13 "src =" http://www.bkjia.com/uploads/allimg/131228/0241501463-26.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241501463-26.jpg "height =" 142 "width = ""565"/>
Note: Enabled in Windows Server 2008R2 Network discoveryAfter the function, you may not be able to find the file server. The possible reason is that Network discoveryThe feature is automatically disabled again, probably because the four services are not started: DNS Client, Function Discovery Resource Publication, SSDP Discovery, and UPnP Device Host. Next, set the main directory of Web1 to the \ IP \ WebFiles \ Contents shared folder, and connect to the shared folder by using the webuser, a local user account created in the FileServer of the file server, you must create a new user account with the same name and password on Web1. Change the password upon next login, Change and select Password Never ExpiresAnd must be added to the IIS_IUSRS group, such as 650) this. length = 650; "class =" aligncenter size-full wp-image-3614 "title =" webframgx14 "src =" http://www.bkjia.com/uploads/allimg/131228/0241502020-28.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241502020-28.jpg "height =" 173 "width = ""501"/>
To create the Web1 main directory to the \ IP \ WebFiles \ Contents shared folder, follow these steps: 1. Click Basic settings 650 on the right of the Default Web Site.) this. length = 650; "class =" aligncenter size-full wp-image-3615 "title =" webframgx15 "src =" http://www.bkjia.com/uploads/allimg/131228/0241504348-30.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241504348-30.jpg "height =" 219 "width = ""637"/>
2. For example, enter \ IP \ WebFiles \ Contents in the physical path and click Connect. 650) this. length = 650; "class =" aligncenter size-full wp-image-3616 "title =" webframgx16 "src =" http://www.bkjia.com/uploads/allimg/131228/0241501b3-32.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241501b3-32.jpg "height =" 227 "width = ""565"/>
3. Select Specific user→ Standalone settings → enter the user name and password used for connection → OK] 650) this. length = 650; "class =" aligncenter size-full wp-image-3617 "title =" webframgx17 "src =" http://www.bkjia.com/uploads/allimg/131228/0241505W2-34.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241505W2-34.jpg "height =" 230 "width = ""569"/>
4. Click test settings in to test whether the above shared folder can be connected normally, 650) this. length = 650; "class =" aligncenter size-full wp-image-3618 "title =" webframgx18 "src =" http://www.bkjia.com/uploads/allimg/131228/0241502T3-36.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241502T3-36.jpg "height =" 196 "width = ""606"/>
After the process is completed, the browser cache should be clear before you use the client to access the test. At this time, you should be able to see the page of default. aspx. Tip: If the website is abnormal for any reason or the security settings change, you may need to execute ReclaimTo restore the website to normal or obtain the latest security settings. For example, if the application pool of the Default Web Site is defaappapppool, as shown in .... 650) this. length = 650; "class =" aligncenter size-full wp-image-3619 "title =" webframgx19 "src =" http://www.bkjia.com/uploads/allimg/131228/024150A53-38.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/024150A53-38.jpg "height =" 295 "width = ""639"/>
Web1 Shared ConfigurationWe will use the settings of Web1 as the sharing settings of the two Web servers. Therefore, first export the settings and keys of Web1 to \ IP \ WebFiles \ tolerations, then specify Web1 to use the settings at \ IP \ WebFiles \ deployments. 1. Export and store the Web1 settings to the file server, and double-click the shared configuration 650 of the Web1 server.) this. length = 650; "class =" aligncenter size-full wp-image-3620 "title =" webframgx20 "src =" http://www.bkjia.com/uploads/allimg/131228/024150K94-40.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/024150K94-40.jpg "height =" 454 "width = ""639"/>
2. Click Export Configuration... In the physical path shown in the figure, enter the path of the file server → click connection → enter the user name and password → click OK. 650) this. length = 650; "class =" aligncenter wp-image-3621 "title =" webframgx21 "src =" http://www.bkjia.com/uploads/allimg/131228/02415013R-42.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/02415013R-42.jpg "height =" 395 "width =" 641" />
3. For example, set the password used to protect the encryption key → click OK → click OK in the previous figure. The password must be at least 8 characters long, the password must contain numbers, special characters, and uppercase/lowercase letters that match the server password complexity ]. 650) this. length = 650; "class =" aligncenter size-full wp-image-3622 "title =" webframgx22 "src =" http://www.bkjia.com/uploads/allimg/131228/0241501D0-44.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241501D0-44.jpg "height =" 373 "width = ""435"/>
4. enable the sharing configuration function of Web1: for example, enable the sharing configuration → Physical pathEnter the path of the storage sharing configuration → enter the user name webuser and password that have the permission to connect to the shared folder → click Application → enter the key password set earlier → OK ]. 650) this. length = 650; "class =" aligncenter size-full wp-image-3623 "title =" webframgx23 "src =" http://www.bkjia.com/uploads/allimg/131228/024150OR-46.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/024150OR-46.jpg "height =" 391 "width = ""638"/>
5. After confirmation, the existing encryption key of Web1 will be backed up to the directory (% Systemroot % \ system32 \ inetsrv \ config) used for storage on the local computer ). Web2 Settings of the shared Web Page We need to create the main directory of Web2 to the shared folder of FileServer on the file server, and connect the shared folder with the local user created in the file server. You also need to create a new account and password with the same name on Web2, set the password to never expire, and add it to the IIS_IUSRS group. 650) this. length = 650; "class =" aligncenter size-full wp-image-3624 "title =" webframgx24 "src =" http://www.bkjia.com/uploads/allimg/131228/0241504621-48.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241504621-48.jpg "height =" 173 "width = ""490"/>
The steps for setting the Web2 home directory to the file server are exactly the same as those for web1, which is no longer repeated here, 650) this. length = 650; "class =" aligncenter size-full wp-image-3625 "title =" webframgx25 "src =" http://www.bkjia.com/uploads/allimg/131228/024150LN-50.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/024150LN-50.jpg "height =" 210 "width = ""548"/>
After that, you can use http: // 192.168.1.2/on the XP Server to test the function. At this time, you can see the page of default. aspx ,. 650) this. length = 650; "class =" aligncenter size-full wp-image-3626 "title =" webframgx26 "src =" http://www.bkjia.com/uploads/allimg/131228/0241504315-52.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241504315-52.jpg "height =" 160 "width = ""409"/>
  Web2 Shared Configuration Now we want Web2 to use the shared configuration on the file server. The steps are as follows: 1. Double-click the shared configuration on the Web2 interface. Refer to the previous steps) 2. Select enable shared configuration → enter the shared configuration path in the physical path → enter the user webuser and password to be connected → stand-alone application → enter the encrypted key password set earlier → OK. 650) this. length = 650; "class =" aligncenter wp-image-3627 "title =" webframgx27 "src =" http://www.bkjia.com/uploads/allimg/131228/0241504U9-54.jpg "alt =" "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/0241504U9-54.jpg "height =" 290 "width =" 597" />
The sharing of the two Web servers has been completed! Wait for the time to be blank. The NLB cluster settings are also sent.

This article from the "IT Chen Yi" blog, please be sure to keep this source http://itchenyi.blog.51cto.com/4745638/1127399

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.