Web Hosting - Overview
So you have your website built. To make it available to online visitors, well, you need to put it online. Sure you can install a web server on your laptop, but you need to make sure it is always power-on, always connected to Internet, and can handle the potentially growing traffic; Or, find him a home in the cloud. That is the "Web Hosting" we are discussing here, a server(or a bunch of servers) hosting your content and always be ready to serve the visitors' requests.
If you think developing a website is hard and time-consuming, try deploying it and maintaining it by yourself. You need to manually config the servers, backup the content, scale up or scale out. Thankfully there are some awesome web services to help us get started. Often times they provide one-click (linux) distributions and apps, and scales automatically.
- starts from $3.95/month
- Starts from $5/month.
- Deploy some popular apps by one-click
If you desire more flexibilities, try out the 3 major public clouds:
S3 HTTPS: via CloudFront, $600/month
- How to host static website on Amazon AWS EC2
- How to host static website on Amazon AWS S3
- [Github Pages]
Suppose you have your website developed and ready to be deployed, here are a few options
By using Infrastructure-as-a-Service, you need to config everything by yourself, here's an example using Apache server
Put everything in folder
<VirtualHost *:80> DocumentRoot /var/www/mydomain ServerName www.mydomain.com </VirtualHost>
e.g. a node.js app named
app1, started by
forever, using port
<VirtualHost *:80> ServerName app1.mydomain.com ProxyPreserveHost on ProxyPass / http://127.0.0.1:2599/ ProxyPassReverse / http://127.0.0.1:2599/ </VirtualHost>
Deploy your code to
app2.herokuapp.com, then add your own domain name
By using Github Pages, you simply create a repository named
<username>.github.io and push your code there, then your website can be access by
AWS: Free tier for 12 month Google: 60days trial, up to 200
CDN stands for Content Delivery Network. It can distribute your content globally, so visitors can get the content from a server that is close to them.
- CloudFlare: highly recommended. The free tier provides CDN, HTTP/2, and HTTPS
- AWS CloudFront: if you are already using AWS