What if port 80 is occupied when a website is published?

Source: Internet
Author: User

What if port 80 is occupied when a website is published?

In the past, when I published a website on iis, there were very few problems, because the ports were configured by myself. However, this problem has recently been encountered. Please refer to the figure below:


After the website is published, it cannot be started. When it is started, an error is reported, prompting that the process cannot be accessed. The reason is that the port is occupied.

We previously set a port when releasing a website, which is different from other ports and will not be repeated, so we have never encountered this problem. What is the situation now? The port of the program has been set, that is, port 80. We cannot reconfigure the port, but we can only publish the program that has already been prepared as a website. This causes a port conflict. The two programs use port 80 at the same time. When the website is published but cannot be started, an error in the preceding figure will be reported.

The root cause of the problem has been found, and our solution to the problem has also come out. Since the program has been released, it cannot be modified, then we can only modify another program that uses port 80. The first step is to find the program. The second step is to kill the program or modify its port.

Solution: Step 1: Find the process using port 80 (for example, Windows7)

Windows + R open and run, Enter CMD to open the command prompt, and enter:

Netstat-aon | findstr "80"

Then press enter to display the following results:


The process with the ID of 1780 occupies port 80. Next, let's see what the process is. In the Command Prompt window, enter:

Tasklist | findstr" 1780"

The following result is displayed:


It turns out that the httpd program occupies port 80. What exactly does this program do? Baidu did not understand it. Next, you can kill the process or change the port. First, I tried to kill the process as follows: solution 1

Method 1: Enter tskill 1772 in the Command Prompt window and restart iis.

Method 2 ctrl + alt + del, open the task Resource Manager, click View, select a column, and check the PID (process identifier) item, query the process whose PID is 1772 in the window, end the process, and restart iis.

This method is not very good, because sometimes it will prompt that the process cannot be found, and the process will not be saved after it is shut down, and the process has to be killed when it is started again, so this method is not recommended, we use solution 2 to modify the port of this process.

Follow the steps below (for example, Windows 7) to open the computer --- drive c -- Windows -- Apache-conf folder, and then you will see httpd. conf file, open it in the text editor, and then find: Listen 80. This is the port of the program. modify this port to any value. For example, add 81 to listen 8081 and save it, restart iis.



If the problem persists, restart the computer.


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.