Which port we can use to run IIS other than 80? - iis

IIS does not work when I start applications like Skype since it also uses port 80.
Which port can I use to run IIS other than 80? (8080 does not work)

You can run IIS on any port you like, as long as it does not conflict with other applications. I am using 88, 8888 and other easy to remember ports.
You can find the common used port here: PORT NUMBERS, and it is safer to choose an unassigned TCP port.
Quote:
The Dynamic and/or Private Ports are those from 49152 through 65535
If IIS is working and you have troubles with an ASP.NET applications, those links might be helpful:
How to: Configure ASP.NET Applications for an ASP.NET Version
ASP.NET and IIS Configuration
ASP.NET IIS Registration Tool (Aspnet_regiis.exe)
IIS and ASP.NET: The Application Pool
If you are still having troubles, it would be helpful to provide more information about your environment, the steps taken so far to solve the problem, and retagging the question (append asp.net for example)

Well you can disable skype to use port 80. Click tools --> Options --> Advanced --> Connection and uncheck the appropriate checkbox.

Port 8080 might have been used by another process in your computer.
Do netstat in command prompt to find out which server/process is using it.
Have a look at this page (http://en.wikipedia.org/wiki/Port_number) it gives you full explanation on how to use port number

Also remember, when running on alternate ports, you need to specify the port on the URL:
http://www.example.com:8080
There may be firewalls or proxy servers to consider depending on your environment.

you can configure IIS in IIS Mgr to use EVERY port between 1 and 65535 as long it is not used by any other application

Stopping Skype from using port 80: http://forum.skype.com/lofiversion/index.php/t15582.html

I'm going to make a few assumptions and come at the problem from a different angle... in that because you have skype installed and running on the same machine, that it is not a production machine and instead used for testing / development?
If so, you may wish to look at alternatives to IIS completely to alleviate your issue. If you use IISExpress or the web server built into recent versions of Visual Studio, they will automatically pick a port for you.
Of course this does mean that it's not particularly useful for giving other people access, but is fine for local development for personal use.
I think the other answers probably offer a better alternative in most situations, but this may offer a different insight.
Here is an intro to IIS Express: http://learn.iis.net/page.aspx/860/iis-express/

You have to configure the port first for example 127.0.0.1:91 then you need to allow access to port 91
from windows firewall->>advance setting->>inbound rules->> new rule.
then check port->> assign new port (91). then next to finished.
After this 127.0.0.1:91 should be accessible from the web.

Related

Setting up a web server for access outside of subnetwork (Node.js, Nginx maybe, Ubuntu server)

A little bit of context. I have developped a webapp on node.js (and a glamourous set of extensions). It has been approved for testing with true users at my company and i am supposed to deploy it now. Problem is that basically i have no idea unto how attack this problem. I have so many questions.
For the moment i have created a virtual machine on the local server. I have installed ubuntu server unto it and i have the intuition about how to deploy the app in this part (i suppose following the same steps as when i started to work on this project). I do not know however if i can have remote access from the outside of my network to this virtual machine. I also dont know if additional configuration in ubuntu's side is needed to make such an idea work (for example: in the installation there was a part about proxies that at the moment i decided to ignore)
From the few documents i have read about it since i was assigned this, a solution may lie in using nginx. The logic behind it if i am not mistaken (and please correct me if i am) is that nginx can help linking the HTTP requests (through the port 80 which is normally opened for access in most machines) and link it to a specific port on the machine (The sexy app i have developped).
In a more early stage, what ressources would i need to start this off? Would i need a domain name? IS it necessary? Do i need a different virtual server to link the apps or can they be on the same machine?
If you have additional comments or tips for someone that is learning to do this kind of thing, please do.
For remote access, you will need a couple of things. First of all, you will need to make sure that your virtual machine is on a bridged adapter. I'm not sure what virtual machine you are on, or I'd give you more detail on how to do this. Second, you will need to make sure that your router has port 80 (or whatever port you chose to use) setup via port forwarding so that requests coming in map to the server (a request comes to the router on the port, the router must then know where to send those requests to). Finally, if you want to use a port other than port 80, you should be able to configure this in the nodejs configuration. This may also be configurable in the router so that requests coming in on port 80 are mapped to, say 8080, but, given that this is a company, it's probably easier to reconfigure the nodejs server than have it set up special mapping.
This experience comes from personal experience with hosting web servers at home. Corporate routers should need similar configuration unless each system has a public IP address on the internet, which is unlikely.

Passive FTP on Windows Azure Virtual Machine

I have setup FTP within IIS7 on a Windows 2008 Virtual Machine. I enabled Port 21 within the endpoints and Active FTP works just fine. But I am unsure to how to connect through Passive. I followed Microsoft documentation (enabled a range of ports within IIS and allowed the same ports on the local firewall) I also allowed the ports within the endpoints in Azure Management. This didnt work.
I read somewhere on an unofficial MS forum that MS do not allow Passive FTP within Azure. Is this true? If not can someone direct me to the right documentation?
Thanks
SOLUTION
I followed instructions in this article.
The problem I was having was I didn't stop and start the FTP service after doing this. It wont work otherwise.
Passive FTP should work fine in Windows Azure Virtual Machines. However, you may not be able to choose large port range since you can only have up to 25 endpoints in Azure and this could be limitation to have Passive FTP. This Forum discussion talk more about it.
You can find this blog which explains how they configure Passive FTP with IIS on Windows Virtual Machine.
An additional piece of info about the post referenced above (http://www.itq.nl/blogs/post/Walkthrough-Hosting-FTP-on-IIS-75-in-Windows-Azure-VM.aspx) - at the end it says you need to use the following command to add the port range in IIS:
appcmd set config /section:system.ftpServer/firewallSupport \
/lowDataChannelPort:7000 /highDataChannelPort:7014
This failed for me, because the port range is locked so it can only be set on the root IIS node. The error is:
Support (Your site name) /lowDataChannelPort:5000 /highDataChannelPort:6000
ERROR ( message:Can not set attribute "lowDataChannelPort" to value "5000".. Rea
son: This configuration section cannot be used at this path. This happens when t
he section is locked at a parent level. Locking is either by default (overrideMo
deDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny"
or the legacy allowOverride="false".
. )
If you traverse up the IIS nodes to the root server node, choose Features View, then FTP Firewall Support, you can set the Data Channel Port Range there using the text box, without the need for scripting, and avoiding this error. Once this is done, you then need to restart the ftp service (as noted above), and passive FTP works well.
I've added this additional answer here because being unable to run the appcmd command to set the port range had me going around in circles for a number of hours, and this may help others avoid the same problem.
I thought others might run into this. If you get the security message indicating that the parent is locked, just go back into your FTP and turn OFF Require SSL Connections. Then rerun the command. Setup your endpoints, open the firewall, etc. THEN go in and turn back on Require SSL Connections!

Is it good idea to put NodeJs behind nginx

Is it good Idea to put nodeJs behind nginx , also can someone let me know nginx supports http 1.1;
Also how to make sure websockets works with this setup ( nodeJs Behind nginx)
If you want WebSockets, don't put it behind nginx. There might be some way that I don't know of, but DotCloud doesn't support WebSockets with Node.js because of its reliance on nginx, and they know nginx pretty well.
I assume you want to run your server on Port 80. If node is your main server, that will mean either:
Running node as root. This is often not ideal because there is potential for bugs in app code and with root access it could cause more damage. If a VM is set aside for a very particular purpose, all backups are made to outside of the VM, and rebuilding is quick, this may not be a big problem, though.
Using iptables to forward network traffic to port 80 to a higher-numbered port. I set this up and I felt like it was a good solution.
Edit: You can also run node.js as root and downgrade to a non-root user with setuid after binding to Port 80. The Jetty project (a web server for Java) suggests this technique.
nginx doesn't fully support HTTP 1.1. However, work is being done and will possibly be integrated into the development branch soon so keep your digits crossed and have a look at this mailing list thread to see what I'm talking about (there are patches but I haven't tried them as yet). More discussion here.
Depending on your needs you can do what Ben suggests using IPTables although I would also 'stealth' the high port using the mark module; I've upped a simple shell script that will do it for you.
If you need other applications on 80 you'll need to proxy; haproxy is one option but you can keep it all node using the excellent node-http-proxy.

Is it possible to run IIS and Tomcat side by side?

I am required to publish a JSP/Java servlets webapp. Unfortunately IIS does not support such deployments. The server I need to deploy it on already runs IIS and several IIS applications. I don't want to interfere with those applications but it is necessary for them and the new webapp to run on the same server. I tried setting up a proxy to redirect traffic to tomcat, but that broke the other applications.
I was wondering if it's possible to run IIS (accessible through good ol' port 80) and tomcat (running on port 8080); and be able to access both remotely. So far my efforts have been fruitless. Accessing IIS applications yielded no problems, but when I tried to connect to tomcat the browser would just time out. I unblocked port 8080 as well, so I'm sure that is not the issue.
Any help appreciated, thanks.
It's definitely possible, as long as they run on different ports. If you can access tomcat locally (http://localhost:8080) but not remotely, then it's a firewall issue. Also, if you really wanted you could have iis forward requests to tomcat.
You can arrange IIS and Tomcat in 2 different IP addresses or you can setup reverse-proxy (nginx, lighttpd, mod_proxy, etc.) to port 80 and then set IIS to use port 8080 and for Tomcat port 9090.
Melder, It is perfectly possible to run IIS & Tomcat on same port with Different IPs. One server can have multiple virtual IPs for the same.

Port 80 is being used by SYSTEM (PID 4), what is that?

I am trying to use port 80 for my application server, but when I perform netstat -aon I get:
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 4
When I look up the process in task manager, it shows PID 4 is SYSTEM, that's it. No extension... nothing. Just "SYSTEM". What's going on here?
I'm afraid to end this process, what do I do?
There are many services, which can listen port 80 on windows.
Luckily you can detect and stop them all running simple console command:
NET stop HTTP
When you'll start it, you will get list first:
To avoid this problem in future go to Local Services and disable listed services.
N.B. - Some services will restart themselves immediately, just run 'NET stop HTTP' few times.
A new service called "Web Deployment Agent Service" (MsDepSvc) can also trigger "System" with PID=4 to listen on port 80.
Also, try stopping "SQL Server Reporting Services (MSSQLSERVER)", that apparently defaults to 80. I did that and port 80 freed up. PID identified the culprit as "System", but apparently that System can mean multiple things.
I had the same problem. Could fix it by stopping the World Wide Web Publishing Service under running services.
the IP adress is 0.0.0.0, state = LISTENING: means that port 80 is listening to all interfaces (not used)
How to read NETSTAT -AN results:
https://sites.google.com/site/xiangyangsite/home/technical-tips/linux-unix/networks-related-commands-on-linux/how-to-read-netstat--an-results
This works for me:
Right click on My Computer.
Select Manage.
Double click Services and Applications.
Then double click Services.
Right click on "World Wide Web Publishing Service".
Select Stop.
It sounds like IIS is listening to port 80 for HTTP requests.
Try stopping IIS by going into Control Panel/Administrative Tools/Internet Information Services, right-clicking on Default Web Site, and click on the Stop option in the popup menu, and see if the listener on port 80 has cleared.
Working solution - tested on Windows 10
There are many reasons for this, the one cause/solution I recommended is this:
Open Command line as Administrator, then:
stop http service
net stop http /y
configure 'http' service to be disable by default
sc config http start=disabled
If above solution does not work, find your specific case - here
Restart your web server/XAMPP/Apache and you're done.
To re-enable http service
use
sc config HTTP start= demand
the source of explanation is here
https://web.archive.org/web/20190917190806/http://servicedefaults.com/10/http/
I've found out that "SQL Server Reporting Services (MSSQLSERVER)" starts automatically and listens on port 80.
I hope this helps.
O
This can be very easily fixed by following these five steps:
Open Services
Right click on World Wide Web Publishing Service
Click STOP
To prevent this issue in future :
Go to Properties
Change Startup type to Manual
Viola u are good to go !
For more info on root cause: https://serverfault.com/questions/65717/port-80-is-being-used-by-system-pid-4-what-is-that
An other service that could occupied the port 80 is BranchCache
services.msc showing it as "BranchCache"
or use the net command to stop the service like
net stop PeerDistSvc
Update:
PeerDistSvc is a service behind svhost.exe, to view svchost services type
tasklist /svc /fi "imagename eq svchost.exe"
The issue is how to free it up, simply use
net stop http
https://stackoverflow.com/a/16243333/777982
I knew these answers were right , but my services.msc was not showing the services, however this did the trick:
sc stop "MsDepSvc"
sc config "MsDepSvc" start= disabled
netsh http show urlacl
The command is mentioned in a previous comment but I'd like to bring it up as an answer. It will get you all reserved URLs in the system. If you look through all records with "80" in URL, you shall have your answer.
For example, in my case, I got:
Reserved URL: http://+:80/Temporary_Listen_Addresses/
User: \Everyone
Listen: Yes
Delegate: No
SDDL: D:(A;;GX;;;WD)
Reserved URL: http://+:80/0131501b-d67f-491b-9a40-c4bf27bcb4d4/
User: NT AUTHORITY\NETWORK SERVICE
Listen: Yes
Delegate: No
SDDL: D:(A;;GX;;;NS)
After a quick Google search, I learnt that "NT AUTHORITY\NETWORK SERVICE" belongs to SQL Server. So I went to Services and stopped SQL Server Reporting Service, port 80 is free again as I check netstat -a -b
I just got this problem today, since it showed up after Norton requested reboot I blamed Norton.
But it wasn't Norton, I removed Norton, rebooted -> problem still there.
netstat -nao was showing that PID 4 owned my port 80 connection.
I then went to control panel,
then "Turn Windows features on or off"
then unchecked Internet Information Services.
Rebooted, the problem went away.
My xampp server is running ok now.
I don't ever remembering turning IIS on in the first place.
I had been running many months before this happened.
I still don't know what caused it in the first place.
Maybe a previous windows updated enabled iis and my reboot turned it on, I don't know.
This Process works for me:
Right click on My Computer.
Select Manage.
Double click Services and Applications.
Then double-click Services.
Right click on "World Wide Web Publishing Service".
Select Stop
Restart XAMPP
Identify the process programmatically
All the answers to date have required the user to do something interactive. This is how you find the PID when netstat shows you PID 4, without needing to open some GUI or handle a dialogue about depending services.
$Uri = "http://127.0.0.1:8989" # for example
# Shows processes that have registered URLs with HTTP.sys
$QueueText = netsh http show servicestate view=requestq verbose=yes | Out-String
# Break into text chunks; discard the header
$Queues = $QueueText -split '(?<=\n)(?=Request queue name)' | Select-Object -Skip 1
# Find the chunk for the request queue listening on your URI
$Queue = #($Queues) -match [regex]::Escape($Uri -replace '/$')
if ($Queue.Count -eq 1)
{
# Will be null if could not pick out exactly one PID
$ProcessId = [string]$Queue -replace '(?s).*Process IDs:\s+' -replace '(?s)\s.*' -as [int]
if ($ProcessId)
{
Write-Verbose "Identified process $ProcessId as the HTTP listener. Killing..."
Stop-Process -Id $ProcessId -Confirm
}
}
That really busted my chops. I hate HttpListener and wish I'd just used Pode.
On the lastest version of windows this service is called as "World Wide Web Publishing Service" (W3SVC)
C:\Windows\system32\svchost.exe -k iissvcs
You can stop this service by going to Services (services.msc) and stopping the service and then setting the "Startup type" -> Disabled for preventing it from running on windows startup.
I had this same exact problem, except that i have never used IIS. While I was fixing another system bug, I had set the apache service to manual start, hoping to reduce the complexity of my system. After I fixed the other bug, apache wouldn't start. I futzed for a while, but all it took was setting apache back to automatic start: Start > Administrative Tools > Services.
Apparently when Apache starts this way, it claims port 80 before the SYSTEM process can.
hth someone. all my googling turned up the 'can't have IIS and Apache on the same machine.' this is for the other one percent of us.
For me it worked after stopping Web Deployment Agent Service.
In case you use Razer product and install Razer Synapse software on your PC, it blocks the port 80 too.
It is not included in the netstat command so I am not able to troubleshoot it. Since there are many services included within the software, I can't analyze which one that blocks the port. After uninstalling the Razer Synapse, I can start the Apache server again on Windows 10.
Try netstat -b, that may hopefully shed some light on the situation (showing what .exe is using the port). Good luck.
This wouldn't explain the PID side of things, but if you run Skype, it likes to use Port 80 for some reason.
In my case, it happened after installing Microsoft Web Matrix. Uninstalling this trash along with "Microsoft Web Deploy" fixed the issue.
I was looking around for PID 4 and came to this question. From this answer and a blog post I figured that anything to do with PID 4 is probably a Windows Service, so you may want to look for the relevant services in services.msc.
Also, this process is run by System, which is considered another "logged-on" user.
I had the same problem and it was because of IIS running on the server, you can stop it using IIS Manager if it is the case for you.
If you are running Windows Server 2012 R2 then make sure to get rid of Work Folders: http://blogs.technet.com/b/filecab/archive/2013/10/15/windows-server-2012-r2-resolving-port-conflict-with-iis-websites-and-work-folders.aspx
Removing Work Folders feature under File Server worked for me.
None of these worked for me. I had to go to a SuperUser question.
If it is a System Process—PID 4—you need to disable the HTTP.sys driver which is started on demand by another service, such as Windows Remote Management or Print Spooler on Windows 7 or 2008.
There is two ways to disable it but the first one is safer:
Go to device manager, select “show hidden devices” from menu/view, go to “Non-Plug and Play Driver”/HTTP, double click it to disable it (or set it to manual, some services depended on it).
Reboot and use netstat -nao | find ":80" to check if 80 is still used.
This is the one that worked for me!
BranchCache was my problem. My resolution was to run Powershell as an administrator and run:
Disable-BC -Force
Reference: https://learn.microsoft.com/en-us/powershell/module/branchcache/disable-bc?view=win10-ps
For me I had to uninstall "Citrix Virtual Desktop Agent" on my VM

Resources