How do I free my port 80 on localhost Windows?

前端 未结 18 1849
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-28 00:59

I installed XAMPP 1.6.8 and for some reason it didn\'t work. Later realized port 80 is not free or not listening. How can I release it or make it free?

Thanks a lot!

18条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-28 01:47

    I was trying to install nginx from here - http://nginx.org/en/docs/windows.html

    Going to http://localhost/ will show something, at least a proper "not found" message
    This is because 80 is the default port, and it was taken by other processes.

    Now run below command:

    net stop http
    
        // Above command stopped below services  
        // - SSDP Discovery  
        // - Print Spooler  
        // - BranchCache  
        // - Function Discovery Resource Publication  
        // - Function Discovery Provider Host  
    

    Now, going to http://localhost/ will fail with a broken link page message.

    Main process was BranchCache
    This process, after stopped, will restart in a few seconds.
    So we need to run other commands we need soon, an example below:

    // this will stop
    net stop http
    
    // immeidately run other command you want to
    start nginx
    

    Now, going to http://localhost/ gave me:

    Welcome to nginx!
    

    Hope that helps.

提交回复
热议问题