run node.js webbapp on 80 port on windows - windows

I need to make my local node.js webapp listen 80 port. Now if run my app on port 80 I get this erro
events.js:72
throw er; // Unhandled 'error' event
^
Error: listen EACCES
at errnoException (net.js:901:11)
at Server._listen2 (net.js:1020:19)
at listen (net.js:1061:10)
at Server.listen (net.js:1127:5)
at Object.<anonymous> (\scripts\server.js:23:4)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
And if run app on 4321 port this error do not reproduced, so it's port depending.
What should I do to be able run my app on port 80 on Windows 7

On windows machine you 80 port probably busy with IIS Server. Try to stop iis first and after run node.js webapp with port 80.

IIS on 80 port is definitely issue. And instead of turning it of you can try IIS node. http://www.hanselman.com/blog/InstallingAndRunningNodejsApplicationsWithinIISOnWindowsAreYouMad.aspx
Probably you don't need port 80 in local development at all, but if you go in production on Windows machine IIS Node is good choice to load balance.

I had this issue also on my Windows 10 PC.
I followed the command on this link (net stop http): https://stackoverflow.com/a/16243333 in a Command Prompt that I opened up as administrator and got this output:
C:\Users\<user>\Documents\project>net stop http
The following services are dependent on the HTTP Service service. Stopping the HTTP Service service will also stop these services.
World Wide Web Publishing Service
SSDP Discovery
Print Spooler
Function Discovery Provider Host
Do you want to continue this operation? (Y/N) [N]: y
The World Wide Web Publishing Service service is stopping.
The World Wide Web Publishing Service service was stopped successfully.
The SSDP Discovery service is stopping.
The SSDP Discovery service was stopped successfully.
The Print Spooler service is stopping.
The Print Spooler service was stopped successfully.
The Function Discovery Provider Host service is stopping.
The Function Discovery Provider Host service was stopped successfully.
The HTTP Service service was stopped successfully.
C:\Users\<user>\Documents\project>
I then did npm start again on another command prompt where I'm not running it as Administrator, and got this Error Dialogue
I clicked ok to close it and just typed localhost on my browser and my app launched!
What is weird is that I went back to the TaskManager -> Services tab, and I restarted all four services that were stopped. In the screen shot below you can see one of the services that was stopped before (look at the Description column), but now restarted:
But now when I run npm start my node app does get launched still.
So it does seem a little weird for me, that before I stopped those services I couldn't launch my app. After stopping them I now can launch my app. But I can still launch my app even after restarting those services.

Sigh - i just found out that SKYPE.EXE was lurking on my ports 80 and 443. Use netstat -anb to see what might be blocking node.exe from accepting sockets on those ports...

Like #jimme my problem was because I installed skype client for testing another project on the same development machine.
In my case I could }).listen(80); but not }).listen(80, "0.0.0.0"); My server was unreachable from anything but localhost. When I investigated by doing netstat -abn I could see that something was listening on that port but there was no process information. I lucked upon the info that "Windows attempts to accommodate such inflexible services by not binding its dispatch mechanism to port 80 until something actively asks for that. (This is why you won't necessarily see a problem initially, but can run into this issue after some sort of update or config change.)," at https://serverfault.com/questions/65717/port-80-is-being-used-by-system-pid-4-what-is-that which pointed to the article https://www.mikeplate.com/2011/11/06/stop-http-sys-from-listening-on-port-80-in-windows/.
When I saw that important piece of information and #jimme 's answer I remembered that I had also installed skype. I just made skype not start at startup and I was good.

#CAMD_3441 's extremely useful answer allowed me to launch the SignallingWebServer of my Unreal Engine 5 Pixel Streaming App.
I couldn't get SWS to use (listen) to port 80 and it was giving me this error :
node:events:371 throw er; // Unhandled 'error' event ^ Error: listen EACCES: permission denied 0.0.0.0:80 at Server.setupListenHandle [as _listen2] (node:net:1288:21)
All I had to do to fix that issue was type net stop http, and enter yes.
My SWS was able to launch on port 80 and I was able to view the Pixel Streaming page on 'localhost' using the browser which wasn't working if I connected the SWS to another port beside 80.

Related

server stop systematically when I upload my model

Could somebody help me !
I see no particular place in all the documentation for that.
When I upload my model....my server disconnect systematically.
My WebPage shows in the console : an error 504
zone.js:2744 GET http://localhost:4201/rest/$catalog/$all 504 (Gateway Timeout)
I try to kill the process with : sh killWakanda.sh Wakanda Server in
the terminal....this was the answer from Xiang in the "stackoverflow question :
Wakanda Server scripted clean shutdown
when restarting wakanda , i receive sometimes this screen
I don't see any documentation to administrate the localhost server and data in one project with wakanda...and angular
The error "Address already in use" indicates your Angular project (web) is still running after you killed Wakanda process.
My answer from last year showed how to shut down Wakanda Server, which listens to port 8080 and 8081, etc.
In Angular projects, the studio also uses webpack dev server for development. It listens to port 4200, 4201, etc.
In versions after 2.0.0, Wakanda Task manager allows you to stop/start Wakanda server and Angular server in studio represented by 'backend' and 'web' project.
To shut down webpack dev servers Manually. You could run this in terminal:
sudo lsof -t -i tcp:4201 | xargs kill -9
Note the port number (4201) might change if you run Angular server multiple times.

Apeche service of Xampp not install in win7 64 bit

While i am trying to install the Apache service then It shows Service not install. How can i solve this problem?
xampp version:3.2.2enter image description here
That means that apache cannot be currently installed as a service. It happens because the system failed to start apache.
Try to run it pressing the start button, to see if you can get more details about the error.
One of the most common thing is that the port 80 (or the port you have configured to serve web) is being used by another application such as Skype.
In order to solve this, you have to close that application and stop all services using that port and configure the application or service to run in another port.
To see what process is using your port: How can you find out which process is listening on a port on Windows?

RabbitMQ server is not starting after installation in Windows 7 machine

I have installed RabbitMQ in my Windows 7 machine but it's not getting started and throws following error:
Unable to connect to epmd on : address (cannot connect to host/port)
I have installed RabbitMQ 3.5.4 and Erlang 18.0.
I used netstat -an and I was able to see port 4369 is in listening mode, but I don't see 5672, 5671 ports in listening mode, is that the problem? if so how to resolve it?
I tried to reinstall both Erlang and RabbitMQ, but no luck.
I thought latest version of RabbitMQ is not supported in Windows 7, so downgraded to RabbitMQ 3.1.3. but no luck.
I have even added hostname in Windows hosts file, no luck.
My Windows firewall is already turned off, so wont be blocking any port.
From "Services" Window, I see RabbitMQ service is not started. even if I manually start it, it again goes back to stopped state.
Have you checked Windows Firewall to make sure it's allowing all the proper ports through?
According to the RabbitMQ docs:
Port Access
Firewalls and other security tools may prevent RabbitMQ from binding to a port. When that happens, RabbitMQ will fail to start. Make sure the following ports can be opened:
4369 (epmd), 25672 (Erlang distribution)
5672, 5671 (AMQP 0-9-1 without and with TLS)
15672 (if management plugin is enabled)
61613, 61614 (if STOMP is enabled)
1883, 8883 (if MQTT is enabled)
It is possible to configure RabbitMQ to use different ports.
I would turn of Windows Firewall and see if it runs. If it runs with Firewall off, then you will need to open these ports in the Firewall
Have you already follow this guide to troubleshoot your problem?
https://www.rabbitmq.com/troubleshooting.html
Taking from above link:
If the (windows) service fails to start, make sure the service has been installed.
On starting the service, if the service output reads "The process terminated unexpectedly" instead, then the service did not start
correctly. Check that the environment variables are set correctly. The
logfiles in RABBITMQ_BASE may also contain useful diagnostic
information.
If RABBITMQ_BASE path contains non-ASCII characters, RabbitMQ service may fail to start with the error "RabbitMQ: Erlang machine
stopped instantly (distribution name conflict?)". If this is the case,
override RABBITMQ_BASE to point to a directory that only has ASCII
characters and re-install the service (restarting will not be
sufficient).

XAMPP - Port 80 in use by "Unable to open process" with PID 4! 12

I've tried deleting skype but that didn't work, I've tried turning off the world wide web thing off, IIS off nothing seems to work.
12:51:22 PM [Apache] Problem detected!
12:51:22 PM [Apache] Port 80 in use by "Unable to open process" with PID 4!
12:51:22 PM [Apache] Apache WILL NOT start without the configured ports free!
12:51:22 PM [Apache] You need to uninstall/disable/reconfigure the blocking application
12:51:22 PM [Apache] or reconfigure Apache and the Control Panel to listen on a different port
Open a CMD prompt as administrator and execute the following command:
net stop was /y
Open the Run dialog box (press Win+R), then type: services.msc
Then search for World Wide Web Publishing Service (WWW-Publishing Service) and Web Deployment Agent Service and stop them. You should also disable them.
Start Apache again with XAMPP :)
Link Ref: https://www.sitepoint.com/unblock-port-80-on-windows-run-apache/
Another very easy option is to simply set Apache to listen on a different port. This can be done by clicking on the "Config" button on the same line as the "Apache" module, select the "httpd.conf" file in the dropdown, then change the "Listen 80" line to "Listen 8080". Save the file and close it.
Now it avoids Port 80 and uses Port 8080 instead without issue. The only additional thing you need to do is make sure to put localhost:8080 in the browser so the browser knows to look on Port 8080. Otherwise it defaults to Port 80 and won't find your local site.
This will also require you to restart Apache for the change to take effect.
Voila! Fixed.
In httpd.conf change the following lines and then restart the application:
Listen 80 to Listen 8080
ServerName localhost:80 to ServerName localhost:8080
When you press "Start" the application can still say that you have an error like "Port 80 in use by "Unable to open process" with PID..." but it will still work.
If the error includes "Port 443 in use by "Unable to open process" with PID..." you need to change both httpd.conf and httpd-ssl.conf.
In httpd-ssl.conf change:
Listen 443 to Listen 4433
<VirtualHost _default_:443> to <VirtualHost _default_:4433>
ServerName www.example.com:443 to ServerName www.example.com:4433
Extracted from this article:
Go to your run command and enter:
netstat -o -n -a | findstr 0.0:80
The last number here is the process ID using it. This is most often IIS or other web relates service and is easy to resolve, but every so often (very often it would seem looking around on google) it appears to be PID 4 – which according to the Windows Task Manager is the NT Kernel and System. Not very helpful given killing this will result in a blue screen of death.
The thing hogging port 80 has nothing to do with IIS or web anything, it's SQL Server Reporting Services. Turn off anything that resembles a SQL Server Services and start Apache again, no need for a reboot.
So problems with PID 4 listening to port 80? Check your SQL services and turn them off.
UPDATE -
Comment from #sangam:
Worked at a shot. In my case, it turned out to be SQL server reporting
services. I stopped the service for all the installed instances, and
it worked (without machine reboot).
So I have faced the same problem when trying to start Apache service and I would like to share my solutions with you.
Here are some notes about services or programs that may use port 80:
Skype: Skype uses port 80/443 by default. You can change this from Tools -> Options -> Advanced -> Connections and disable the checkbox "use port 80 and 443 for addtional incoming connections".
IIS: IIS uses port 80 be default so you need to shut it down. You can use the following two commands: net stop w3svc, net stop iisadmin.
SQL Server Reporting Service: You need to stop this service because it may take port 80 if IIS is not running. Go to local services and stop it.
VMware Workstation: If you are running VMware Workstation, you need to stop the VMware Workstation server - port 443 as well.
These options work great with me and I can start Apache service without errors.
The other option is to change Apache listen port from httpd.conf and set another port number.
Hope this solution helps anyone who faces the same problem again.
You might need to stop the "Web Deployment Agent Service"
Press Win+R and type services.msc
Right click on Web Deployment Agent Service and select "Stop"
Restart XAMPP
Also after double clicking "Web Deployment Agent Service" you can make the Startup type to Manual, So that "Web Deployment Agent Service" will not start automatically
As there is comment by #johnkarka on the question, this port is used by SQL Server reporting service as well. After stopping this, Apache started fine.
Go to "SQL Server Configuration Manager"
Click on "SQL Server Reporting Service" and stop it
The funny thing is IIS was working fine in same configuration but not Apache, had to stop SQL Reporting service to make it work on default port (80).
After changing the main port 80 to 8080 you have to update the port in the control panel:
Then click here:
And here:
Then save and restart.
Open Task Manager (Ctrl+Alt+Delete).
Go to "Details" tab.
Sort by PID number.
End process that is using PID number indicated in error.
Restart XAMPP.
What worked for me was stopping the Internet Information Services (IIS). If you are using Windows 7, click on your Start button and in your search box, type "iis". Click on "Internet Information Services (IIS) Manager". When the window pops up, and assuming you've got none of the icons selected, you should just be able to click Stop on the right action pane. My XAMPP Apache started right up. Hope it all worked out for you.
In windows 10, to free up port 80:
in my case, I open "Services" from "Search Windows" (on the left corner on screen), then stop all of SQL server services MSSQLSERVER and it works again
I had this problem too and stoping services using port 80 didn't helped. I resolved it by following this procedure (found on a french board):
Launch RegEdit
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP
Change the value of "start" to 4 (disabled)
Reboot your computer
Not sure how this affect other services, but it solved permanently the issue and so far I didn't see any issue.
Using Windows 10.
If you've SQLServer Reporting Services running locally then you need to stop that also..
I've had the same problem, but in my case Apache was already running and for some reason the XAMPP config tool didn't show that. It happened after I started XAMPP for the first time after the installation. After crashing the other Apache instances all was fine and ports 80 and 443 were free again.
So before making changes to your systeem, make sure something as obvious as the above isn't happening.
"SQL Server Reporting Service" was causing issues in my system, after stopping it, Apache started working fine
I have the same issue, I solved the problem, just disabled
"BranchCache Service" in services.
Somehow windows updates, this service is triggered in startup, and uses 80 ports. When you check via netstat you could see the system is used this but couldnt understand which service is used.
Click services on the Xampp control panel (filename is services.msc, extra info).
First, look for IIS, if it is running. Stop it (stop this service option on the left after clicking on the service name.). Then, this is the main problem, Look for Web deployment Service (not the exact name though it has Web deployment at the beginning.). Stop this service too. Try again and Apache should work.
If you are running Skype, exit out of that too, run Apache, then launch Skype
I've had same problem, when I was installed MS WebMatrix, IIS Server was blocked the port 80 which XAMPP was running on. I tried to find World Wide Web Publishing Service and stop it, but could not find it on list. Best way is changing a port.
Please refer with this
link ref.
For those with ASP.NET, C# or having SQL Server users, If you are using SQlServer OR Visual Studio Your port might encounter. easiest thing you might want to do is on Command> servies.msc and then find SQl Server Reporting Service and then stop it.
if the service is http.sys
You need to change the binded IP address for http.sys
netsh http add iplisten ipaddress=::
Work fine without restart the os.
The Web Deployment Agent Service is deployed with WebMatrix and was the cause of my woes. It may also be distributed with other applications installed using Microsoft’s Web Platform Installer.
Uninstall it solved my problems!
For me usually works:
- Turn off Skype
- Turn off all SQL Server processes displayed in services.msc
- Turn off World Wide Web Publishing in services.msc
It usually works afters you stop IIS Server and Skype
XAMPP - Port 80 in use by “Unable to open process” with PID 4! 12
run the comment in cmd tasklist
and find which the PID and process name related to this now open window task manager
you can also open window task manager by using CTRL+ALT+DEL
now click on the process tab and find the name which using PID and right click on that and
end process
now again restart the xampp
I had same issue. After some googling arrived to this page. Since I guess this error may have various reasons, so listen to my experience:
Xampp red line log:
12:53:54 PM [Apache] Problem detected!
12:53:54 PM [Apache] Port 443 in use by "Unable to open process" with PID 3908!
...
Finally it turned out that I had this line of code in my php codes :
$res = file_get_contents("http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
The purpose of this piece of code was to get a mirror of php result from somewhere in my server. But it's just stucked in a loop that gets its own content!
I repaired code:
$res = file_get_contents(str_replace("my_uri.php" , "mirror_uri.php" , "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"));
Then I restarted apache ... and that apache error never happened again.
So sometimes searching for probable halting points in your code is a good approach.
In Ubuntu by default, the system will not allow you to occupy privileged ports [ 0 to 1023], other than specifying the port as 80, you need to run XAMP with sudo.
I write this, because i coudn't find answear for the same question.
In my case PID was 2484.
you must find a process or service with this PID:
open cmd (in Windows) and write:
tasklist
Find your PID in this list and read name of process or service.
Now you can kill this using Task Manager
find this name on Process list
click End Process.
That's my case. Possibly you must open services.msc and stop Service with your PID.
On my computer xampp it worked fine :)

Apache can't connect to http://localhost/. Port is changed to 81

I've just installed apache2.2 and installed it, but to get it running I had to change it listening port to 81. But the thing is now that I cant connect to it through localhost. The only thing I get is a login window and when I type in the authentication information that I think is my windows login. I get:
error '8002801c'
Error accessing the OLE registry.
/iisHelp/common/500-100.asp, line 17
The computer is a winxp and I've opened the ports out and no firewall is blocking apache.
Seems like the machine has another webserver running, probably IIS.
You can uninstall that through the configuration screen.
Try http://localhost:81/ to get the apache install.

Resources