How to take an ASP.NET 2.0 Application Offline
If you own or manage ASP.Net 2.0 websites, you will like this not very-known feature called the App_Offline.htm.
When you want to take offline an application, you only have to create a small App_Offline.htm and place it at the root of your web application. IIS will automatically detect it and return its content everytime a request is made to this web application (whatever the asked file is). Internally what IIS does is to kill the application domain of the web application.
When you're done updating your website, just delete the file and IIS will start a new application domain with your update content.
This feature is cool but sometimes your users may not see the content of the file if their browser (IE) is showing "Friendly HTTP errors". IE shows you friendly HTTP errors when the size of the response is less than 512ko, so add content to your file so every user will see the page correctly instead of the "friendly" page. Personnaly I don't know what is friendly in "The page cannot be displayed" !
Adding another VPS to be always up and running
From the beginning, my websites are hosted on a single server. At the start they were hosted on a shared hosting plan but last year I switched to a Virtual Private Server (VPS) so I can have full control over my server and configuration. I decided to do this because I always want to have full control over what I do and because I had multiple problems with the shared hosting (lost of data multiple times). At HostDepartment they are not very professionnal and there servers are slow, they put too many websites and databases on there server. With the VPS I get full control and great performance for about 25$/month, and that is awesome (VPSLand).
Even if now I have my VPS I'm not 100% secure in terms of data loss; the fact is that my VPS got corrupted 2 times and each times all my websites were down 10 days (translated in a loss in traffic and revenue), so recently I decided to buy another VPS to be able to switch from one to another when I detect a problem. Everything is identical between the 2 VPS. To switch from one to another I simply have to change to DNS entries (done by a couple of clicks) to point to the other VPS.
The only thing different between the 2 VPS is the fact that I only backup the data (DB and some specific files and folders) from the first VPS. The other is not backed up because it is only temporary (the time I take to repair the first VPS).
With this solution I will avoid the 10 day down; I can be up and running within 2 hours. Yeah it costs 50$/month instead of 25$/month but overall it covers the oney I lose when the websites are down.
What type of web hosting is the right for me ?
So you have (or planning to have) a website and you want to find what is the best type of web hosting for you. Depending on what you need to host, you will have to chose a different type, company and plan.
Here are the major types of web hosting you can choose from, starting from the cheapest.
Content hosting
If you simply want to create a blog, forums, photo album or something like that, you can rely on existing services on the internet. Many of them can provide you with something free that will correspond to your needs. Some will ask for you to pay but prices are very low.
Price range (per month) : 0$ to 5$
Hosting companies (examples) : TypePad, SiteGround
Domain hosting
Domain hosting is not really a type of hosting in itself. Sometimes you don't have to buy your domain because free hosting companies (or cheap ones) gives you a subdomain. Because good domain names are almost all taken, there is something called domain auction. Some people simply just buy domain names in hope that someone wants them so he can sell it for a lot more than he paid for.
Price range (per year) : 2$ to 50$
Price range for auctions (one time) : 100$ to 1,000,000$+
Hosting companies (examples) : GoDaddy, Register
Shared hosting
If you have a little website that requires no database, no email server and not a high performance shared hosting is the right thing for you. When you start a complete website on your own, your first hosting choice should be shared hosting. It give you an FTP access to your files but you don't have access to the server via Remote Desktop.
Normaly there are many hosting plans you can choose from. The differences are that some gives you more space, more performance, etc. You can also, with some hosting companies, add more services like a database (SQL Server, MySQL and PostgreSQL), a email server with which you can send emails, but they will charge you more.
Price range (per month) : 5$ to 30$+
Price range with services (per month) : 8$ to 200$+
Hosting companies (examples) : HostDepartment, GoDaddy
Virtual Server hosting
When you need (like me) to have the total control of the server where you host you website but don't have the money to buy a whole server, you can rent a virtual server. That is a complete server with a complete operating system but hosted on a part of a physical server. On the physical machine there's a software in which virtual servers can be created. Each virtual server can have a different amount of RAM, hard disk space, operating system, etc...
With this type of hosting you have full control, but at a lower price than having a full server (or renting it).
Price range (per month) : 15$ to 400$
Hosting companies (examples) : VPSLand, KickAssVPS
Dedicated hosting
Dedicated hosting is like shared hosting but instead of being sharing the computer with other websites, you're alone on the server so you get all the performance you can get out of it. There's companies that don't allow you to control the server with Remote Desktop; in this case, virtual server hosting might be better than dedicated hosting if you compare prices.
Price range (per month) : 50$ to 200$
Hosting compagnies (example) : HostDepartment, iWeb
Co-location (server hosting)
If you absolutely want to have your own server, managing it via Remote Desktop, have the right to install everything you want, etc... you might want to go with co-location. With this type of hosting, you buy your server, you install everything you want and then you pay a company to put it in a server room. Then you pay for your bandwith and physical space.
This type of hosting is expansive, not only in terms of monthly fee. If you own your server, you need to pay all your licenses, so buy a copy of Windows and every third party software you install. Also, if you want your server to be protected by a UPS or be backed up every day, you need to pay for it and it climbs very fast.
Also, if your sites get visited milion times per day, you will need more bandwith, and bandwith cost something so you have to consider it.
Price for a rackmount computer : 500$ to 25,000$+
Price range (per month) : 100$ to 1,000$+
Hosting companies (examples) : iWeb, UltraHosting
My current hosting type, for all my websites
Virtual Server Hosting, 25$/month.