How to host my nodejs API on my local ubuntu machine - node.js

I want to host my nodejs api that is being served to a front end (react-native). I know how to do it on aws ec2 (using nginx) but I don't know how to do it on my local ubuntu machine. (I am using a wifi router, Jio Fiber to be specific). Someone told me that port forwarding is the thing which I currently need.

Related

Cant hit Node-Red web page on Vultr Machine

I have just finished setting up Node-red on the a cloud machine hosted with vultr ( Ubuntu 20.04 x64 ) and I am wanting to be able to hit the Node-Red web page but I am failing to do so.
I have setup WireGuard so I can VPN into the machine
I am able to ping the servers Local IP address from my Windows PC
But I am still unable to hit the Node-Red Web Page
Even though Node-Red is running
I am fairly new to working with cloud machines so any help would be highly appreciated.
I'm going to guess that you haven't opened port 1880 for the server.
This could be in one of 2 places
Vultr appear to have their own firewall which you will need to ensure a suitable rule to allow TCP traffice on port 1880 exists. How to configure the firewall appears to be documented here https://www.vultr.com/docs/vultr-firewall-quickstart-guide/
You will need to make sure that the port is open in the Ubuntu Firewall as well. Running sudo ufw allow 1880/tcp should do this.

NodeJS hosting on linux VM, and http requests from Windows to Linux

If I'm hosting a local NodeJS server on an Ubuntu Linux Machine, is it possible to make http requests from a browser on Windows. For instance if the server is hosted on localhost:7700 on the Linux VM, how can I make http requests from Windows on?
The server is hosted with NodeJS on a Linux VM.
You have to set port forwarding. If you are using Virtual Box look here link. Instead of localhost:7700 try using 0.0.0.0:7700. Also remember to open 7700 port on your machine. The last thing is to set your network as bridged adapter to allow connection between your host OS and VM.

Cannot connect to a server on Cent OS Machine

I have installed CentOS as a virtual machine (using Virtual Box), on my Windows OS. I am running a lighttpd server on my CentOS machine. I am trying to access the server, from my browser, which is running on Windows, using the IP address and port number. But, I am getting the following error: Firefox can't establish a connection to the server at 10.209.145.152:8080.
Also, when I am running the server on Ubuntu(as a virtual machine using VMware Player), I am able to connect from the Window's browser successfully. Can anyone please suggest me, what I might have been missing on CentOS Machine. Thanks.
I would suggest that it is something that has to do with the VM setup. Compare the configuration of your Ubuntu VM and the CentOSVM. In order to connect from Windows to the VM, I think that you need to setup a bridge network connection rather than NAT. But I am not sure, so I would suggest you try all the different options.
Hope that helps!

can't ping avahi alias from windows over LAN but can from other linux VMs

Context: i've set up a vm server for GIS testing and dokuwiki on the domain root. I'd like to serve the gis web apps on a subdomain so that dokuwiki url renaming will never conflict (and it just feels cleaner). I thought i had it solved with avahi-aliases, but then discovered...
Problem: I can't reach the subdomain from any windows pcs on the LAN. Linux VMs connect just fine. Am i trying the impossible or just doing it wrong? (i'm a DNS noob) Why would Linux find the subdomain but Windows not, even on the same LAN??
Setup:
i can't change anything on the corporate routers/servers.
VMs are on different PCs on the same corporate LAN.
VM1 (virtualbox, hosted on windows PC1): Mint 13
VM2 (virtualbox headless server, hosted on windows PC2): ubuntu server 12.04, LAMP, samba, avahi, avahi-aliases.
primary domain: vm2.local
subdomain: gis.vm2.local (configured in apache and avahi-alias)
What works:
I can reach vm2.local AND gis.vm2.local from vm1 (via ping and browser).
I can reach vm2.local from any windows pc on LAN (via ping browser).
What doesn't work: I cannot reach gis.vm2.local from any windows pcs on the LAN.
Any ideas or advice is appreciated!
Sounds like either a firewall issue or Apache/IIS (whatever is hosting your web app) isn't listening to all traffic (If you are actually sharing networks). Try a traceroute/tracert from the machines to the destination and see what paths they take. It's a little hard to troubleshoot without actually seeing how your network looks.
You can also test if your hostname resolves by trying a ping on the PC's having issues.
If it says "Ping request could not find host . Please check the name and try again" - It's a DNS issue and you can address it quickly by providing the IP of the machine with its hostname in %WINDIR%\system32\drivers\etc\hosts

host webapp in my machine trough virtual machine

im using windows 7 ultimate in a vmware non-commercial version, i have an mvc4 asp.net app running within IIS. i manage to get my app working on localhost (vmware win 7) perfectly.
now im asking 2 questions :
1 - is it possible to browse my app from a machine connected to my local network ?
2 - is it possible to host my app trough this configuration and to make it available in internet. like http://xxx.xxx.xxx.xxx (my public ip adress)
thank you all.
Yes to both questions, if your browser machine can hit the port the server machine is serving the app on. On WAN, you would need to make sure your router didn't block requests to the server's port, and the same for any modem/firewall that connects you to the internet at large. Also, if your public ip is not static, it may change.

Resources