How Can I Get My Flask-based Web App Hosted Online? - model-view-controller

I'm using the Flask microframework to run the Python back-end of my site with an SQLite database. It all looks fine and well running on my Ubuntu machine. But how and where can I actually host it online with a proper URL as in: "https://appname.io"?
Do web hosts usually provide Linux and SSH capabilities?

The 'proper URL' you describe is a domain name, and they can be purchased from many online retailers you'll discover when you Google it.
To host your site you will need an actual server host. Many retailers that sell domain names also sell web hosting, but not all. Essentially, every host will provide you with SSH, FTP, MYSQL and anything you may need to host your site. Linking your domain name is normally done automatically if you're purchase both your domain and hosting from the same retailer. However, if purchasing separately you will have to enter the DNS server information to resolve your host.
Try reading this article to get a good idea of how to move your project to a host. This article is for WordPress, but you should be able to get the general idea on the process.

Related

Unable to set up custom domain on Heroku using Google Domains DNS?

To preface this, I am new to backend web development so I'm coming at this totally clueless. My past experience is with Netlify, which makes it pretty seamless to add a custom domain to a website with their free DNS service.
To start, I am working on a Flask application that ideally I would like to put on a subdomain of my website (i.e. app.my-website.whatever, not actually my real domain since it includes my real name) on a different host, in this case Heroku, while keeping my main website (www.my-website.whatever) on Netlify. This required me to switch from using Netlify's DNS to using the DNS tools provided by Google Domains.
After deploying the app on the free domain, which went just fine, I tried setting up my domain for the website, following these steps:
On my website's dashboard, I went to Settings > Domains > Add domain and under domain entered app.my-website.whatever, including the subdomain of course.
Copied the DNS Target Heroku gave me.
At my dashboard for my-website.whatever at domains.google.com, under DNS > Default name servers > Resource records, I added a custom record with the hostname app.my-website.whatever (Google Domains automatically adds the .my-website.whatever), type CNAME, TTL 600, and in the Data field I pasted the DNS Target.
In my Ubuntu (WSL) terminal, when I type host app.my-website.whatever, the output says app.my-website.whatever is an alias for {bunch-of-random-characters}.herokudns.com.
Unfortunately, this has not been successful. When I try to visit the domain, I usually get an error such as DNS_PROBE_FINISHED_NXDOMAIN or alternatively ERR_SSL_UNRECOGNIZED_NAME_ALERT. I've also tried the same thing with just www.my-website.whatever, and the same issues occur.
When I try to visit the site, most browsers will automatically append https://, which I would assume doesn't quite work since I do not have a cert set-up for my site, which I need to do manually.
Does the above error mean that there is a problem related to SSL, or is it something else? Is it because my browser forces https:// that I cannot see anything changing (i.e. would http:// work?)?
From what I can tell, I should be able to do all of this on the free-tire, but I have some confusion about a few details, and feel like I could be missing some other things:
Do I need a certificate/SSL for my custom domain to work at all with Heroku?
If it could possibly be an easier solution: Is there a better alternative to Heroku in my case?
With regards to setting up the cert, I tried following the tutorial here:
https://medium.com/#bantic/free-tls-with-letsencrypt-and-heroku-in-5-minutes-807361cca5d3
For certbot, as the tutorial explains, you are given two strings like so: <long-string>.<other-long-string>, and you need to serve a file at /.well-known/acme-challenge/ with the name <long-string> (no extension), but as an unrelated issue, I cannot get Flask to serve this file, even on a local dev server, and I just get a 404 message, which the certbot utility also reports. I can create another file, such as a simple .txt file, in that same directory, and it will serve just fine.
I'll admit, these issues feel a bit basic, but I genuinely am lost, and none of the guides or posts I see online seem to have any remedy or explanation for what is happening here.
If there is any more information I should share, please let me know.

create php web service and access to the internet

I have recently installed PHP, MySQL Server, and Apache web server. I played around with some PHP scripts locally on the PC to insert some entries to MySQL Database.
Noob question so please be patient with me:
How do I get my web service out to the internet, by self hosting? Say I already have a domain for example mydomain.com How do I make it so that when someone not within my network can access mydomain.com/something and can send some data so my server gets it and do anything with that data?
Webhosting
You have to have some form of webhosting. You pay for hosting and you can upload your PHP files to their servers. They will usually also have database servers you can use.
Your domain name has to point to those servers via DNS so the internet can reach your application. I'd suggest you search the internet for popular hosts that provide the tools your need for this.
Self hosting
Another possibility is to open your network up to the world, but this is not recommended unless you have network administration experience due the security trouble that comes with it.
In short: forward a port through your router to the machine running your application. The website portforward.com has instructions on how to do this but keep in mind that misconfiguration could lead to vulnerabilities in your network.
In order to make you site public
1. you need host
2. you need domain
there are bunch of hosting sites you should get one first.
This link explains very well about self hosting
https://www.boutell.com/newfaq/creating/hostmyown.html

How to access an Orchard multi-tenant site externally on the same network

I've got multi tenancy set up on my Windows 7 machine using Orchard 7.1 and IIS 6.1 which I can access locally no problem.
They relevant sites are all added within the bindings of the applicationhost.config file, as well as the computers' host file and therefore show up as they should by accessing the url.
I have previously had a single tenant set up on my machine that meant I could access on my network, which was done by adding the site to IIS then binding to localhost/my ip address etc.
However the issue I am having is how to access these sites via a mobile device/another computer (on the same network) now that I have set it up for multiple tenants.
Any help appreciated
Liam
You'd need some sort of naming service inside your network, something like Bonjour.
Short of that, I guess you'd have to configure those other machines one by one so their hosts files point to the server.
One final possible possibility may be to simply use DNS. There is no reason why you couldn't use a domain that you control to map several names to local addresses such as that of your server.

Set up a simple go server in a webhost

I wanted to set up a simple go server in a webhost. I acquired a domain mydomain.com and hosted it using Bluehost. Now, going through the Go tutorial, I went through this example http://tour.golang.org/#59 and it works fine on my machine. Now, instead, I want to make the HelloWorldServer work when I call mydomain.com:4000 or some other port.
What I did was ssh to my server at bluehost, install go there, then compile the server and run. But then I try to access mydomain.com:4000 and it is not found. I also tried to change "localhost:4000" to just ":4000". any ideas how to make it work ?
Any help or pointers are appreciated. (some more details: it is a shared-hosting account)
This is due to the firewall on your BlueHost server not having ports (including 4000) open on a shared hosting account, Firewall Port Restrictions
If you want to do some simple (and not so simple) web hosting, why don't you look at Google App Engine

Map my domain name with my own server

Hi I am having my own domain mydomain.ac.in and i am having my own server (windows 2008) and a Public static IP.
Now i want to host my site in my own server.
Please give me the step by step information to get it done.
Thanks.
You need to register your domain with some DNS hosting service (DNS provider), there is such an astronomic number of these on the web that I do not want to spam the site. Google.
Also, collocation center where you keep this server (and from where you have probably obtained that public IP) may also provide DNS services.
From the other side, any computer can be configured as the name server but this will probably not work Internet wide and can be used inside the local network only (combined with DHCP service). If there is an easy way to make this Internet wide, I would also be very interested in, but I doubt.
Your operating system is not much relevant to this question.
I registered my domain already in ernet by indian Government and I got my Public Static IP from BSNL India. I hosted my site already and i am able to access my site already using the ip. Now i want to map my domain with the server that i have so that i can access my domain using a domain name.
I tried the steps in http://www.hosting.com/support/dedicated/dns/setdns#additional.. But when i add the name server information it says cannot resolve hostname??? that s why i want to know where i am making mistake..
I once again tried the steps at http://www.hosting.com/support/dedicated/dns/setdns and got it right..Now i have updated the name server info at my domain registrar ernet and waiting for it to be updated. Thanks fo the people helped me

Resources