Stop IIS while using Xampp (Windows 10 - conflicts of ports)? - iis

In Windows 10 IIS and Xampp use the same port (80), I've learned. I know how to change port in Xampp, but I'd prefere to stop IIS while using Xampp. On my old computer with Windows 10 I went to task manager > services and stopped World Wide Web Services by rightclicking. On my new computer with Windows 10, I can't seem to find World wide web services on that spot. Can it be named something else, according to language (swedish - though before on the old computer it was named as mentioned)? Any other way (in simple steps, please - beginner!) to stop IIS using the port, without disabling the IIS alltogether? (might want to learn how to use it later on)
Thanks in advance!

Port 80 is used by default with many web servers (here IIS and Apache which is bundled inside XAMPP).
The default web site created with IIS uses port 80. If you don't want to use this default web site (absolutely no harm and no data loss!), you can delete it by running the following command in inetsrv directory (path would generally be C:\Windows\System32\inetsrv).
appcmd delete site "Default Web Site"
Or you can change the port for the default web site in IIS, with:
appcmd set site /site.name: "Default Web Site" /+bindings.protocol='http',bindingInformation='*:8000:']
appcmd set site /site.name: "Default Web Site" /-bindings.protocol='http',bindingInformation='*:80:']
(8000) is for instance, use any high number you like.

Related

unable to launch iis express web server port 80 is in use

I have MVC4 web application project in visual studio 2010. When I want to start it, I have the following error:
Unable to launch the IIS Express Web server: Port"80" is in use.
The problem came after changing the property "Use Local IIS Webserver"
http://blog.lextudio.com/2012/10/port-already-in-use-then-who-uses-it/
If you already have something monitoring port 80 (such as full IIS), then you cannot use another thing to monitor the same port.
Thus, if you do want to use IIS Express, make sure in Project Url: field you specify another port number other than 80.
In VS 2013:
Go to your Web Project Properties, Web Tab.
Select "IIS Express" from the dropdown.
Enter a project URL, such as http://localhost:64510/
If you have "Override application root URL" checked, uncheck it.
The port is probably in use. I usually end the iisexpress.exe. This works if for some reason the port is open and you want to close it.
CTRL+ALT+DEL -> Task Manager ->End process for iisexpress.exe
I just had this happen to me, and didn't understand why as everything had worked fine until restarting my machine. Seems that the full IIS service was running, but only within the manager had it been STOPPED, so when I restarted it turned back on.
FIX IT THIS WAY:
Open up the Internet Information Services (IIS) Manager (use search programs and files, too. See image)
Right click on localhost (top level, left pane), select STOP. Not called 'localhost'? This will probably be called your machine name, but if you hover over the top level on the left pane, you should see 'https://localhost/'. This is what you want. Right click and select STOP.
Now, this is assuming you only want to run IIS Express sites, as anything that required the full IIS won't be running. You should be good to go!
If IIS is running and you are using IIS Express you should stop IIS for it to work.
Such error can appear when YourApp.csproj file contains conflicted settings.
<!-- conflicted settings -->
<UseIISExpress>true</UseIISExpress>
...
<IISUrl>http://localhost/application/</IISUrl>
If you want to use IIS Express you should change IISUrl to http://localhost:11222/ or another free port.
<!-- settings for IIS Express -->
<UseIISExpress>true</UseIISExpress>
...
<IISUrl>http://localhost:11222/</IISUrl>
If you want to use IIS you should set UseIISExpress to false.
<!-- settings for IIS -->
<UseIISExpress>false</UseIISExpress>
...
<IISUrl>http://localhost/application/</IISUrl>
Another answer does mention this, however, if you're using IIS Express within Visual Studio AND have IIS enabled in Windows Features; It will be the "Default IIS Site" that is using port 80. Simple open IIS and stop the site running by right-clicking on the top node.
Sql Server could also be the culprit. I stopped Sql Server and it freed up the port.

WiX 3.7 IIS Setup

When running our installer, we have it configured to setup 3 websites in IIS, before the upgrade this worked as expected, even if the default website (or any site listening on the same port) was still present.
If the website listening to Port 80 was already started, WiX would create the website from our installer, and just not start it (which is what I'd expect). Since upgrade to 3.7, however, what I've found is that the installer does not create the website if there is any other site configured in IIS that's listening to the same port.
Is there something missing in the WiX setup that I need to add to force WiX to add the website from our installer, or is this just a known issue with creating websites via WiX?
Edit:
Looking into this further, it appears that the website is checked by the port, rather than by name. If I have "Default Website" on port 80, any applications that are under the website I have in the installer are configured under the Default Website.
The IIS CustomActions in the WiX toolset use the "natural key" to find the web site which is the ip:port:header combination. Most websites, only the port is specified. In you scenario, I expect the WiX toolset found the existing website and "fixed it" based on the specifications in your installation package.
Thanks Rob, I managed to fix the issue by setting the ConfigureIfExists flag to true, which created the site as I'd expected it to originally.

Creating Web-Site and Web Application in IIS

Till date, I was thinking that we always create/host web-site in IIS.
But I was going through powershell tutorial today which says it is different to create web-site and a web application.
This is the tutorial link (check different section on creating web site and application) -
http://learn.iis.net/page.aspx/433/powershell-snap-in-creating-web-sites-web-applications-virtual-directories-and-application-pools/
Can please guide what is the difference between the two.
Any example will be really helpful.
Thank you!
A web site in IIS is the top level under Sites. The default one that is normally automatically created for you when installing IIS is named "Default Web Site".
This is the "root" that runs on port 80.
Under that, you can create virtual directories, which is basically sub-levels under the root web site, or you can create separate web applications that lives as separate applications under the root level.
A web application must live under a web site.
It is possible to create other web sites that can either be set up to run on other ports (i.e. 81), or to be named with a different host name which enables multiple sites to run on same port number. If named with a different host name, this name must be registered in a DNS server somewere to point to the IP address for your server. A workaround is also to to add it as an entry in the hosts file on the client computer that should access it.
This is example on how it looks in IIS Manager:
I have a script I use when creating a website and AppPool in IIS 7+, .net4, Integrated pipeline and thought you might find it useful.
Use it as so:
CreateSite.ps1 [WebsiteName] [AppPoolName] [Port] [Path]
If you are reinstalling the site, you will need to Stop it first. That is done as so:
StopSite.ps1 [WebsiteName] [AppPoolName]
you can grab the scripts from my gist
Update I have added/extended the scripts and put them in their own Github repository
Here is my CreateWebsite PowerShell script: http://www.zerrouki.com/create-website/

IIS 7.5 - no default site / no http binding

I enabled/installed IIS on my win 7 home premium hoping to be able to run asp pages on my comp.
There are two issues that I don't know how address:
1- I don't see the Default Website in the IIS Manager
2- I don't have http option under binding
This is what I did...
I enabled/installed IIS 7.5
Control Panel - Programs - Turn Windows Features On or Off
checked everything under "Intenet Information Services"
checked everything under "Intenet Information Services Hostable Web Core"
I open the IIS Manager and see three panes (windows):
Connections on the left
Features or Content view in the middle section
Actions on the right
This is my question # 1: Any idea why I don't see any default site in the connections pane?
Server name
Application Pools
Sites (folder)
**** nothing here !!! ****
My question #2 relates to binding... when I want to set up a new site, I do the following:
(in Actions pane) - add web site
site name:
app pool: ASP .NET v4.0
Physical path: C:\inetpub\wwwroot\testsite
Under binding type, these are the options that I see... but there's no http option available.
Binding type:
- net.tcp
- net.pipe
- net.msmq
- msmq.formatname
Any idea why and/or what to do to have http option available?
I should probably mention that I am running xampp 1.8.0 on my comp as well on port 80.
127.0.0.1:80.
Any tips or suggestions are appreciated!
Thanks!
I had the same issue and the only solution was:
Remove WAS (Windows Activation Services)
Remove IIS
Reboot
Install WAS
Install IIS
Reboot
open the IIS and see the default web site with both HTTP and HTTPS bindings

Recreate the default website in IIS

I've accidentally deleted the default website in IIS; It no longer shows up in the tree of IIS manager and browsing "localhost" returns a 404 error.
I've re-installed IIS, but the default website still doesn't exist... Is it possible to recreate the default website so I can create my folder inside?
Other answers are basically right, thanks to them I was able to restore my default web site, they're just missing some more or less important details.
This was the complete process to restore the Default Web Site in my case (IIS 7 on Windows 7 64bit):
open IIS Manager
right click Sites node under your machine in the Connections tree on the left side and click Add Website
enter "Default Web Site" as a Site name
set Application pool back to DefaultAppPool!
set Physical path to %SystemDrive%\inetpub\wwwroot
leave Binding and everything else as is
Possible issues:
If the newly created web site cannot be started with the following message:
Internet Information Services (IIS) Manager - The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)
...it's possible that port 80 is already assigned to another application (Skype in my case :). You can change the binding port to e.g. 8080 by right clicking Default Web Site and selecting Edit Bindings... and Edit.... See Error 0x80070020 when you try to start a Web site in IIS 7.0 for details. Or you can just close the application sitting on the port 80, of course.
Some applications require Default Web Site to have the ID 1. In my case, it got ID 1 after recreation automatically. If it's not your case, see Re-create “default Website” in IIS after accidentally deleting. It's different for IIS 6 and 7.
Note: I had to recreate the Default Web Site, because I wasn't able to even open a project configured to run under IIS in Visual Studio. I had a solution with a couple of projects inside. One of the projects failed to load with the following error message:
The Web Application Project is configured to use IIS. The Web server 'http://localhost:8080/' could not be found.
After I have recreated the Default Web Site in IIS Manager, I was able to reload and open that specific project.
Did the same thing. Wasn't able to recreate Default Web Site directly - it kept complaining that the file already existed...
I fixed as follows:
Create a new web site called something else, eg. "Default", pointing to "C:\inetpub\wwwroot"
It should be created with ID 1 (at least mine was)
Rename the web site to "Default Web Site"
I suppose you want to publish and access your applications/websites from LAN; probably as virtual directories under the default website.The steps could vary depending on your IIS version, but basically it comes down to these steps:
Restore your "Default Website" Website :
create a new website
set "Default Website" as its name
In the Binding section (bottom panel), enter your local IP address in the "IP Address" edit.
Keep the "Host" edit empty
that's it: now whenever you type your local ip address in your browser, you will get the website you just added.
Now if you want to access any of your other webapplications/websites from LAN, just add a virtual application under your default website pointing to the directory containing your published application/website. Now you can type : http://yourLocalIPAddress/theNameOfYourApplication to access it from your LAN.
You can try to restore your previous state by doing the following:
Go to IIS Manager
Right-click on your Local Computer.
Point to All Tasks
Point to Backup/Restore Configuration
Select the configuration you want to restore
Wait untill configuration applies
Check out this answer on SuperUser:
In short: Reinstall both IIS and WAS.
In details -
Step 1
Go to "Add remove programs"
"Turn windows features on or off"
Remove both IIS and WAS (Windows Process Activation Service)
Restart the PC
Step 2
Go to "Add remove programs"
"Turn windows features on or off"
Turn on both IIS and WAS (Windows Process Activation Service)
Note: Reinstalling IIS alone won't help. You have to reinstall both IIS and WAS
This approach fixed the problem for me.
Follow these Steps
Restore your "Default Website" Website :
create a new website
set "Default Website" as its name
In the Binding section (bottom panel), enter your local IP address in the "IP Address" edit.
Keep the "Host" edit empty
I deleted the C:\inetpub folder and reinstalled IIS which recreated the default website and settings.

Resources