How to host a website with database having server as my Laptop for free and which has a https link? - web

I want to host my website which has a node js server and uses sql from xampp. It works great on my laptop using localhost. I want to host it on internet for free from my laptop. I want a https link which can connect to my laptop.

You can easily do this by using a module of nodejs called localtunnel. Suppose you choose a subdomain popeye assuming it is not taken before and port you are using for localhost is 3000 , then use following command .
$ npm install -g localtunnel
$ lt --port 3000 --subdomain popeye
Then whenever you go to link
http://popeye.localtunnel.me it will server from your computers localhost.

Register domain name. Use a dynamic DNS provider to map your domain name to your current IP.
This can be more or less complex.
Consider some cheap VPS server. On the long run this may be easier and cheaper, than dealing with dynamic DNS.

Related

How to open localhost:8000 using VPS Ubuntu

hello I need help how to open http://localhost:8000 from my pc. because my project polkadot substrate installed on a VPS Ubuntu, after I try to open IP:8000 it also doesn't work
Images
You have to run the substrate node using --rpc-cors all option. Please note that substrate chains don't expose websocket connections to the public internet without some hacking. I am assuming your question asks how to connect a substrate node running on a remote server to your local pc front end. If that's right let's continue:
https://wiki.polkadot.network/docs/maintain-wss
Describes the entire process. You need to install NGINX, configure /etc/nginx/nginx.conf and within the http code block insert the mentioned code, with proper variable replacements. Then generate a self-signed SSL certificate, and open port 9944 and 443 on your remote machine. Next visit the machine with https://IP:443 to whitelist that site, and finally connect to your substrate node with a local installation of polkadot-js-apps. You cannot connect it using the online polkadot.js explorer , so you must use a local connection. And that should get you up and running.

ng serve | Will not cast to ther devices

I run my app to my local machine via ssl like this:
ng serve --ssl --host: 0.0.0.0
so it is up at: https://localhost:4200
I also using my ipv4 adress which is: XXX.XXX.XX.XXX to make my requests to the server via my services, so i make my api calls like this: https://XXX.XXX.XX.XXX:80/api...
In my back end, I have created an https server so my API calls are been made via https
Everything works great to my desktop
Problem is: The app wont cast to ther devices.. it wont even load and
after some time i get the msg this site cannot be reached
The built in webpack server that is used for ng serve is not meant for production or sharing to other computers, it is only supposed to work on local for development because of security reasons. You should consider hosting a compiled version with a separate web server such as nginx. If you absolutely NEED the built in webpack one to work, you can force it to bind to all of your IP addresses with this:
ng serve --host 0.0.0.0
You may need to disable the host check as well:
ng serve --host 0.0.0.0 --disable-host-check
You can access this, but you might need to turn off your Firewall, this mostly happens in windows machines.
Try turning it off and accessing the IP from other machine.

Run nodejs app through HTTPS

I have a node app that is setup on SSH by running node osjs run --hostname=dc-619670cb94e6.vtxfactory.org --port=4100.
It starts at http://dc-619670cb94e6.vtxfactory.org:4100/ without problems, but instead I want to serve it through HTTPS https://dc-619670cb94e6.vtxfactory.org:4100/ , where I receive an error ERR_CONNECTION_CLOSED.
If I use the port I'm unable to reach it with https, but https://dc-619670cb94e6.vtxfactory.org/ is accessible.
How can I serve the port 4100 through htttps?
Thanks.
This is an implementation detail of OS.js. Their docs recommend setting up a reverse proxy for servers. Doing this will give you more control over SSL and ports, like you want
https://manual.os-js.org/installation/

HTTPS issue when using http-server application in nodejs

Hello I am definitely new to HTTPS so please bear with me. In order to run the nodejs application, http-server, I use this command on my webserver:
http-server -p 80 -S
The -p flag specifies the port and then the -S flag specifies that I will be using the https protocol. I am able to access the website just fine by physically going to the web server's address like:
https://123.456.78.90:80
However when I try to access the site from my domain:
example.com
or even:
https://example.com
I get a connection refused error in the browser. This perplexes me as I have created A records to redirect the domain to the ip address with digital ocean, along with using their nameservers. This whole process works flawlessly when I start up an instance of http-server in normal http mode like this:
http-server -p 80
Any help is MUCH appreciated as I haven't been able to find much on the topic. Thanks internet people.
Try to use a free ports. The port 80 is currently used for http connections.
http-server -p 9090
Wow figured it out. I needed to specify the port 443 when starting the http-server for https to work properly.

how to run nodejs app in vps with plesk enable

Hi guys im newbie in vps... I've bought an ovh not managed vps . I like to face problems... But I don't find any documents to these one. Is simple like I said I want to run a nodejs app in centos vps environment but I have enabled plesk.. and I saw in console running the app with the trace but I try to open website with the port and doesn't find anything.
http://vps406315.ovh.net
Thx for all guys
-----------------EDIT-------------------
I'm going to explain better,sorry for previous post.
There is no error, in my console all is ok. Like I said i have an CentOS VPS. Steps that I did:
Connect with PUTTY
Go to folder where is the NodeJS project.
I set the port to 8080
Write node index.js
The app is running and writing the right trace.
I use chrome to check the ip, and show me the default plesk page.
I use wget to check it, and with only http://92.222.71.137/. I attach
an screenshot
I tried to use with the port 8080 with the chrome and wget in putty,
and the response was the same.
In the other hand if I use http://92.222.71.137:8080/login with putty
download the right login.html, and the nodejs app write a trace
indicate me that someone connect to that page. But if I access with
chrome is not working.
Now I would like no know how to make access frome Chrome.
Thx 4 all and sorry for my newbie knowledge
You should give some other details on the configuration or eventual errors you get (both on the browser and the VPS) and how you run the node app (behind a web server, for example)
If you are not running you node app behind a web server, are the node app listening on the correct interface ? 127.0.0.1 and 92.222.71.137 (your site external address) are not the same.
On your VPS you can try to call the node app from the VPS itself using wget or cURL and looking for what happen in the app trace.
Finally it was easy... only i had to open a port to use with TCP, using
iptables -I INPUT -p tcp --dport 8856 --syn -j ACCEPT –

Resources