IIS process cannot access file in use

2019-04-18 09:06发布

问题:

We created an SSL certificate for our server and when we want to start IIS we get this error:

The process cannot access the file because it is being used by another process.

Port 443 seems to be in use. How can I solve this? Or How can I learn why port 443 in being used?

回答1:

Marc B's comment is deserving of an actual answer, so I will paste it here:

Use netstat -b -a in an elevated privilege shell. It'll show all active ports and the processes attached to them. You can add -o if the process holding on to your port is svc.exe or another multi-instance executable (thanks to Mike K for the comment).

I've seen this happen on my development box where Skype actually takes over port 80 and/or 443. To turn off and disable Skype usage of and listening on port 80 and port 443,

  1. Open the Skype window
  2. Click "Tools"
  3. Click "Options"
  4. Click "Advanced"
  5. Click "Connection"
  6. Uncheck the checkbox for "Use port 80 and 443 as an alternatives for incoming connections" option.
  7. Click the save button
  8. Restart Skype


回答2:

I just closed the skype, resolved the issue.



回答3:

netstat -aon will show which process is using the file. In my case it was Skype but it could be any process that uses it.

Disabling 'allow port 80 for incoming connections' in skype did the trick for me.



回答4:

In my case -- we had no skype and the netstat didn't return ANY other processes using port 80 or 443. A manual restart from an elevated command prompt did not resolve the issue either. Ended up having to restart the box to clear up the issue.

I changed the default website to port 88 just in case that added to the issue.



回答5:

it may port issue. previously my port was 80 now i change it with 8080 then everything works fine for me.

To change the port:-
1) open iis
2) select your project 
3) there is a "Edit Bindings" option at the right side. click on it.
4) select the host and click on edit.
5) now change the port


标签: iis ssl port