Hosting a Web Application - heroku

I have a quick question regarding hosting web applications. I've recently started getting into hacking so I just wanted to understand them a little more.
I am aware that to host websites you need to pay for a domain name, as well as a hosting service. So let's say you buy a domain from GoDaddy, and then you buy hosting from Dreamhost.
Let's say I'm making a web application in Node.js, then I need to buy a cloud platform such as heroku, correct?
So do I need to buy a domain, hosting service, AND a cloud platform in order to launch a web application?

Cloud hosting is just another kind of hosting versus stuff like Dreamhost.
You likely can't run something like Node.js on Dreamhost's shared hosting, but you could on one of their VPS/dedicated servers. Heroku's just easier for that sort of thing. You'd in most cases pick either Dreamhost or Heroku, not both.

Related

Deploying an Internal API

I basically have an API that is going to be used with a web app and a mobile app. I don't want the API to publically available, where should I deploy it then? is there a way without using AWS? Thanks, Nav :)
There are multiple ways of doing this. This is a sensitive topic, as this is an opinion-based field.
However, I will try to answer below - and challange your way of approaching this.
It really depends on your 'operational' skills, funds, need for security, deadline(s) etc.
Basically you need to make an endpoint available on the www, without everybody being able to connect.
You could either:
Deploy a virtual machine or web app. in Azure/AWS/GCP/... and whitelist the IP's you need to connect from.
Rent a VPS from any provider, and deploy your application here - Again, whitelisting. (Edit: Not phones, since this IP changes constantly. A proxy can be implemented here (potential bottleneck), or any authentication mechanism like OAuth, JWT, Certificates etc. can be implemented either on the ingress controller (e.g. NGINX) or the application itself.)
Deploy the application on your Home-PC, order a static IP to your home and make a forwarded port and set up security on your premise (not recommended, and raises and bunch of other headaches)
Get in touch with a company that hosts web applications (Can be quite expensive)
Based on the limited information provided in your question, there is a ton of options, nice-2-haves and factors that comes in to play when choosing the setup that suits your needs.
You should also consider; VPN usage, Backup/disaster recovery, data leaks, redundancy, the need for future deploys, how you would access your environment in six months....
I hope this answered your question, but also raised a few for you to answer yourself.
Finally, I'd recommend you looking for inspiration here.
EDIT:
Question:
Whitelisting mobile IP's.
VPS selected.
Answer:
This becomes quite a task when mobile phones tend to change IP's frequently.
Since you are looking further into the VPS setup, you are more in control of the setup and can choose to look into OAuth and JWT.
Links:
OAuth - https://oauth.net/getting-started/ https://developer.okta.com/blog/2019/01/22/oauth-api-keys-arent-safe-in-mobile-apps
NGINX JWT - https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-jwt-authentication/
So - At the end of the day, you can make your app use a proxy (potential bottleneck) and whitelist this IP, or make the endpoint open (any -> 443) and implement an authentication mechanism like the ones mentioned above.
Consider implementing a DMZ zone for incoming traffic from the web.
https://en.wikipedia.org/wiki/DMZ_(computing)
and put your application behind this zone, making sure that the only the DMZ zone is facing the internet, and the server hosting your application is talking to the server in the DMZ.
Again, this is quite a big topic and is hard to simplify to a stackoverflow post.
If you are hosting the app on AWS you have a couple of options.
API Gateway now supports private endpoints. These endpoints can not be called via the public internet. That means if your app is hosted on AWS only the internal services of the app can call the end point. i.e. front end to database etc. I've used this method for internal micro services such as placing in house app data onto kinesis streams.
Alternatively, if you don't want to use API Gateway you have lots of options. Most of which would involve you creating rest APIs from where ever you plan on hosting your code. This could be on the server it's self or some sort of container.
API Gateway Private Endpoint Reference:
https://aws.amazon.com/blogs/compute/introducing-amazon-api-gateway-private-endpoints/

What is the best solution to use a common domain/subdomain with Jekyll on Heroku and other hosting website?

I just moved my personal website to Octopress from Drupal. I am hosting it on Heroku and I really don't like the herokuapp.com domain. I already have myname.com domain which I am planning to use with Heroku now for my main website.
The problem is I have some other websites hosted on my hosting service which use databases and other stuff. They were being accessed by project1.myname.com, project2.myname.com etc. I don't want to move them and have a similar subdomain naming thing to access them.
How can achieve this?
If I'm understanding you correctly, it should be easy to do this with your DNS settings. Simply point the DNS "A" records for "myname.com" and "www.myname.com" to Heroku and leave "project1.myname.com" and "project2.myname.com" pointing to your existing provider.

Can I host a RAP application (Rich Ajax Platform) in Heroku?

I'm thinking of creating an application (RAP). I would like to know if I can host in Heroku or if you know a hosting provider that offers this service.
You can host anything that can run on Linux as long as you're not having to persist anything on the filesystem and you have a buildpack which suits your needs.
Once those are in place, the world is your oyster.

Hosting service that use lighttpd

where can i find a list of good web hosting services that allow me to use lighttpd? (and wordpress, btw)
I know of dreamhost if you use the privete server, but the price is quite high isn't it? How good is as a service?
Thanks
You are looking for a VPS or dedicated server. These give you root access to the servers, so you can install your own web server.
VPS servers can cost as low as $5 a month depending on what you need. I would check out lowendbox.com. They have deals on very cheep VPS servers.

Best and most convenient way of handling multiple sites for different clients?

A very broad question, but how would you handle multiple domain names for different clients? Do you setup a "Web Hosting"-like server where you install Cpanel?
What are other cheaper alternatives to Cpanel?
You can choose to buy a "reseller" account from web hosting companies. This allows you to host multiple domains, each under different hosting account. Server management and technical support is done by the web hosting company without you having to worry about it. Each client has its own control panel.
I know Arvixe offers this by example. They provide cPanel for Linux hosting, and WebsitePanel for Windows hosting.
http://lordmatt.co.uk/item/966/

Resources