Set the port for the IIS server to listen to a specific IP address (solution for coexistence of IIS and IHS or Apache)

Source: Internet
Author: User

In the disaster recovery test, if IIS cannot be started, the following error is reported:

 

"The network location cannot be reached, xxxxxx"

 

You must know that Windows reports such a pop-up window error, which can only be viewed in the event manager that comes with windows. Run: eventvwr directly, open the system item, and a big error will pop up:

 

So the error is obvious. We didn't add our new address to the listener list...

 

According to the search results, it seems that IIS cannot listen to a port of a certain IP Address by using the graphical interface tool of IIS. You must use the httpcfg tool to update the listener list. Assume that the listener list is part of the system file. When IIS is started, it may bind the file as a port with a higher priority.

 

Therefore, follow these steps:

 

1) httpcfg query iplisten

First, list the current listeners.

2) httpcfg Delete iplisten-I 10.50.165.45

Remove the old listening IP address.

3) httpcfg set iplisten-I 10.52.21.1

Add a new IP address to the listener list.

 

 

Test again!

 

Still failed... Why? Restart the server ......

 

 

OK. After the server is restarted, IIS starts up with the system. Check the listening port and IP Address:

 

 

Successful! Process 4 listens to port 80 and port 443 of 10.52.21.125. Process 4 is a system process, and IIS seems to be a sub-process hanging in this process (conjecture... Does not understand IIS ).

 

 

After IIS is set, test IHS again. Started normally!

 

 

Check ports 80 and 443. You can also see that the two IP addresses share the same port.

 

Therefore, this server can accept both requests sent to IP: 10.52.21.125 (IIS will process these requests) and requests sent to IP: 10.52.21.45 (IHS will process these requests ).

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.