It was a year and half when last time I updated my web site. Sadly this is just one project I have where I can have some experience with web development. And because I really missed it, so I've put three things on my agenda:
- Move domain from ru to com, so now my site is available on https://www.outcoldman.com.
- Add support for mobile devices and make some minor changes.
- Move site from masterhost to orcsweb. I have both of them for free, but second one gives better conditions, like more storage and better network bandwidth. And I like orcsweb, because these guys update their servers on next days after new .NET Framework ships.
But how you can understand from the topic I failed last task. Because orcsweb sets medium trust for shared sites – this is a huge pain for developers. For example I met problems with using AntiXSS.
Windows Azure Web Sites
Azure Web Sites is still in preview. Azure gives you up to 10 Shared Web Instances for free. But if you want to use custom domains you need move instance to Paid Shared Instance Model, which will cost you about 10-15$ per month. I'm not sure about this, I still cannot understand how this will work if my instance will use CPU only for 1 minute in an hour. I will need to pay for whole hour or just for one minute?
Couple days ago also I saw an information that Web Sites now support .NET Framework 4.5. And this was the latest argument for Web Sites instead of orcsweb. Particularly I dreamed also about to try cloud.
I don't want to tell you how it was easy for me to create a Web Site Instance in Azure. Azure portal has really good documentation and a lot of videos about how to do this. I just want to say – try it. If you don't have an account in Azure – you can try free trial, which will ask you about credit card, but don't worry. You can set limit to 0$, so you will not need to worry about what will be when trial period will come to end or what if you will use more resources than Azure gives you for free. Each free shared web instance on Web Sites has domain name like x.azurewebsites.net, so it is very easy to use them to try something or show your project to world.
And this is really cool that you don't need to think a lot about settings. I just downloaded Publish Profile, which I imported to the ASP.NET MVC 4 project in Visual Studio (right click on project in solution explorer and choose Publish…). And that is it.
Mobile Devices support
I thought that this requires a huge amount of work. Because I remembered from ASP.NET – you need to render your pages on server for mobile devices in special way if you want to support them. I was so surprised when I found that to do this you just need to add two things. Set viewport for mobile devices:
And set special css classes for case when width is less than some defined value:
The easiest way is to take a look how ASP.NET MVC 4.0 defines its classes for mobile devices. This is really good example.
At first I specified for both of my domains that they should redirect to azure web site instance. After this I set two special rules for Url Rewriter in web.config. Url Rewriter is installed on Web Sites by default.
After this I found that it is really easy to change domain in Google Web Master and Google Analytics services. As I understand to do the moving right – I will need also to find main referral pages in internet (Google Analytics can help me to do this) and change links on it (or ask owners to change them). And after this I can say good bye to my old domain.
What is next?
As I said I really missed web-development. So I have some plans to continue improving my web site. At first I want to refactor couple places in source code and publish it to GitHub. When I tried some new features, like Entity Framework and SQL Server CE I didn't try to do it well, I just tried it. And when I saw that it works – I published it with thoughts that I will refactor this code in future. Very common situation, right?
One thing which I still cannot understand – is how to analyzer log files from 0:/LogFiles/http/RawLogs/*.log. They have next format:
# date time s-sitename cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs-host sc-status sc-substatus sc-win32-status sc-bytes cs-bytes time-taken
The best option which I found is to import them to excel.