How do I use livereload.js when my server is hosted? - networking

I setup my development environment on a cloud server (why not, it's lovely!).
Specifically I am running my dev environment in google cloud with docker, forking the meanjs/mean GitHub and corresponding Dockerhub entry as a starting point.
I have mapped the port 3000 from my container where my server is running to port 80 on my cloud server where docker-engine is running. I also mapped the 35729 port to 35729 in same fashion.
See output of $ sudo docker ps (can't seem to put that table of long lines in a snippet, sorry I put it in a screenshot instead):
output of $ sudo docker ps
Now when I go to my website I gets stuck forever on liverload.js (seeing it in the browser console "Network" tab).
livereload hanging forever
Please help 'cause this is driving me nuts!
Closely related to this question, but I want to use livereload not disable it: how to stop using livereload.js in my MEAN app

It looks like port 35729 isn't open.
$ nmap -p 35729 23.251.146.156
Starting Nmap 7.12 ( https://nmap.org ) at 2016-07-08 09:34 EDT
Nmap scan report for 156.146.251.23.bc.googleusercontent.com (23.251.146.156)
Host is up (0.0043s latency).
PORT STATE SERVICE
35729/tcp filtered unknown
Are you sure that you've allowed port 35729 traffic? There could be something like iptables or some Google Cloud configuration that needs to be done to allow the traffic through.
It looks like this answer gives a good step-by-step on opening a port in Google Cloud. I can't verify, since I don't use Google Cloud.

Related

Why does Nginx Proxy Manager Stream won't work?

I'm currently trying to setup a tunneling tool, specific for game servers.
So you can start the server locally and everyone can join without open your ports or getting unsecure.
Basicly I do a reverse ssh tunnel to one of my dedicated linux servers where the game port get mapped to a different port (for example 8888). So the server is now exposed to the internet and available for anyone and the user don't have to get unsecure and open his own ports. Everyone can connect to the following ip: SERVERADRESS:8888.
The command which gets executed looks like this:
ssh -N -R "*:8888:localhost:25565" root#SERVERADRESS
This works fine just as i want. But I also want to secure my "forwarding" server, so I'm relativ new to networking but I found reverse proxy's. I watched some tutorials and I installed the "Nginx Proxy Manager" tool which comes with a web interface and looks very good and easy. So there is an option to create an Stream (Picture below), there you can enter the incoming port and the forward Host + port, for example: REVERSEPROXY:7777 -> FORWARDINGSERVER:8888. So with this I want to hide the ip adress from the server where all the ssh tunnels. Sadly this Stream tool won't work, I already saw some other topics with that. They all said to enter the port into the docker-compose.yml which I already did + restart. But for now it won't work. Any other soloutions for this problem? Or completly different ideas to protect my server?
https://i.stack.imgur.com/FolLe.png https://i.stack.imgur.com/KuJbt.png https://i.stack.imgur.com/2SN4a.png https://i.stack.imgur.com/9kzbj.jpg
I try to do my own tunneling tool, but with a protection so that my server getting damaged.

HTTP fails on Inetsim

I'm trying to set up a malware analysis lab, following the instructions found here:
https://blog.christophetd.fr/malware-analysis-lab-with-virtualbox-inetsim-and-burp/
In setting up inetsim to simulate internet protocols, I keep getting "http_tcp_80 - failed!" everytime I run it. Changing the port it uses in the configuration file to 8080 causes the it to work. When I run it on a different vm, the configuration works as intended.
I have apache also installed on this vm. Could it be interfering?
Edit: I just installed a new vm to try using inetsim without apache installed. HTTP is reported to be running, but now dns_53_tcp_udp is reported to be failing to start. Trying to browse web pages to bring up inetsim's default page fails, regardless of if I use the FQDN or the IP address. The only time I get the page is with localhost. Otherwise, I get server not found. At least I know its not apache.
The error I get with DNS indicates that the 0.0.0.0 ip is already in use, which doesn't make sense to me since 0.0.0.0 is being used to bind the services to all IPs. Changing the inetsim.conf file so "service_bind_address 10.0.0.0" instead of "service_bind_address 0.0.0.0" seems to run dns, but the browser on both the analysis machine and the victim machine still report no server found.
You should stop the Apache server:
service apache2 stop
It works for me.
I guess there are some other processes listening on those ports.
Use
sudo netstat -tulpn | grep LISTEN
It will print out those processes with their pid. For example, 964 is the pid of the first process in this case:
Check if something is occupying your corresponding ports. Shut them down with
sudo kill -9 <pid>
Of course, the busy processes running on those ports may not in listening states but still be able to cause such a problem. So you can check it with
sudo netstat -tulpn
just in case.
Anyway, it does work for me.

Can't start site in IIS (use by another process)

When I try to start a site in IIS it says:
the process can't access the file because it used by another process
I searched in Google and found that another site may have been using Port 80 but in MyIIS I see that only this site is using Port 80. What else could be using Port 80 or is there another issue involved?
Check using netstat -aon or netstat -aon | findstr 0.0:80 in a command prompt to see which Process Id is LISTENING to port :80 and then watch for that Process Id (PID) in Task Manager with view->select columns-> process id checked. End that process, restart IIS and you are done. (Note: if you have Skype installed, try exiting that process first.)
In a modern Task Manager, you need to go on the Details tab to search for the PID. Or, as mentioned by #Nikita G in the comments, you can use this command to find the task from your command prompt:
tasklist /FI "PID eq 123"
Note: change 123 with the PID returned from the first command.
It is happening because a different process is using port 80, it may be a chat application on your PC like Skype.
First, change the default web site port which was 80 to some unused port (e.g. 8087). To achieve this right click the application and then click on 'Edit Binding'.
After this port change restart again.
Now you can identify which process is blocking the IIS Port 80. To check this use netstat command which displays the details of port along with the process ID.
Sign out of Skype and try again. I have experienced the same issue and I just logged out of Skype and then reset my IIS. It worked for me.
You can also run this command to find out which application or service is using the port and then trace it down in Task manager (Provided it's not the Web Deploy Agent Service).
netstat -o -n -a | findstr 0.0:80
Then open Task manager, go to Processes, click the "Show processes for all users" checkbox and then click the View menu and Go to the Columns, add the PID column.
Match the Process ID from the netstat command to the PID in task manager and you will find the service or application that's using the port.
As others have said, something else may be using port 80 or 443. It was VMWare Workstation Server for me, but check other answers for how to use netstat.
I think this link gives a pretty good explanation and fix of this problem http://support.microsoft.com/KB/890015
Most of the time; it's caused by one of the two reasons:
1) port 80 is being used by something else and as suggested by others you can use netstat -o -n -a |findstr 0.0:80 to see whether this is the case. If yes then kill the process from task manager (tick show processes from all users)
2) if port 80 is not used, the second cause is potentially an invalid ip address in the ListenOnlyList filed in the registry key of HTTP->Parameters. If you follow the link to set the key manually or in fact you can use (xp and server 2003) httpcfg delete iplisten -i ipaddress to delete the invalid ip address.
You must restart the http once you edit the ipaddress!
In my case, it was the "Sync Share Service" (SyncShareSvc) that was running and using port 80.
netstat showed 80 as free, though. I could get the site to run on another port, but not 80. if I added a Host name, IIS would allow me to start the site, but I'd get prompted for Digest authentication when browsing to localhost (or any host name I added). Only Anonymous and Forms Auth were enabled in IIS...
I also found that, after stopping IIS, http://localhost still prompted me for Digest authentication.
The solution - in my case - was to remove File and Storage Services > Files and iSCSI Services >
"Work Folders" from the services installed (restart required).
After removing the "Work Folders" service and restarted, IIS worked as expected.
My case was after installing RD Web Access, the original default websites couldn't be started. Removed the RD Web Access role still same. Removed port 443 binding solved the issue.
Most times when this happens by web developers is the reason apache, so if you go to the config file from apache! open it up and search with ctrl + f to 80 and change the ip you will see to 8080 and the sentence beneath there with 80 to 8080 and you need to confige that in you xampp, or the program u are using currently
Hope I'll help u guys out
In order to get more meaningful information, one way is to also get ownership information when issuing netstat so that you know the process which is using either 80 (default http binding) or 443 (if https binding is defined):
netstat -ab
In my case the culprit was vmware:
TCP 0.0.0.0:443 ComputerName:0 LISTENING
[vmware-hostd.exe]
netstat can be piped into find to search for ports 80 or 443 (e.g. find ":443"), but these particular active connection will show at the beginning of the list at they are easy to see.

how can I troubleshoot meteor just hanging?

Hi I am trying out meteor for first time today.
my symptoms: meteor just hangs when trying to connect to port 3000 (it is listening, checked with lsof and looking at ps) a mongo instance is started on port 3002 but i can not connect to it with mongo (so perhaps neither can node ?)
background: I do already have mongo 2.0.3 installed and running (can it be a conflict?)
What can I do to troubleshoot and get meteor started ?
Site was bugging me to accept an answer or start a bounty...So here is explanation of my comment:
localhost on my machine resolves to ipv6 address first and meteor
binds only to 127.0.0.1.
So to answer the specific question of "how to troubleshoot":
I used lsof -i to verify that the meteor mongo instance was actually listening. This showed me that is was listening on 127.0.0.1. This eliminated the concept of mongo not listening. next i did host my machine's name and noticed the ipv6 came back first. this sparked a hunch and led me to force meteor to connect to 127.0.0.1 instead of localhost and it worked.
Well, check that port 3000 is open netstat -a
try a telnet localhost 3000
Use firefox extension TamperData or any other flow analysis tools to see what's going on at the HTTP level http://tamperdata.mozdev.org/
Have you tried to run against the bundled node and mongodb ?

How to run meteor server on a different ip address?

How can i start meteor server on a different IP address? Currently in the examples am only able to run on a localhost:3000 address.
export BIND_IP no longer works, bind IP is defined with --port (or -p or --app-port) option(s):
$ meteor run --port 127.0.0.1:3000
Reference: https://github.com/meteor/meteor/commit/9b8bd31a7b6c857e5d8fc0393982e6e6b2973eb0
If you are looking to run something on another IP address (but still have the files local) you need to look into editing your vhosts file. If you are on a mac, look into Virtual Host X
The proper way to change ports with meteor is this:
meteorapp : meteor --port 5000
According to this change, you should be able to configure your app to bind to a specific IP address by configuring a BIND_IP environment variable.
export BIND_IP=127.0.0.1
You may need to update your app to a newer version of Meteor for this to work correctly.
Using Meteor 1.3.2.4, If your IP is 192.168.0.13 as in my case, on the terminal, type:
meteor --mobile-server 192.168.0.13
or
meteor --port 192.168.0.13:3000
And you will see the Meteor welcome page by typing
http://192.168.0.13:3000
on your browser.
At the moment, you can't - meteor binds to all IP addresses, but there's an issue open to add support for binding to a specific IP.
Deploy it on another server and connect to the internet-ip of the server from outside of the internal net, or connect to the local-ip of the server from the lan.
How to deploy on another server?
'meteor bundle'
and read the README
This isn't possible yet, but there is an open pull request for it. They are waiting for the author to sign the meteor contributor agreement before it can be accepted.
https://github.com/meteor/meteor/pull/469/
If you need it before it's official you can apply the patch yourself (or potentially just replace 127.0.0.1 with the IP address you want to bind to in the same files references by the patch (app/lib/mongo_runner.js and app/meteor/run.js).
Actually, Meteor behaves differently in production and development environments.
Production
Use environment variable BIND_IP
Development
Use --port argument like meteor run --port 192.168.1.1:port
Docs here
According to netstat -tapn Meteor/Node.js listens on all available IP addresses on the machine:
tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN 9098/node
Do you have something like iptables running?

Resources