Windows Web Hosting, Web Technologies, etc
Web Applications
Are You Getting ViewState Errors like: "The viewstate is invalid for this page and might be corrupted."
Aug 14th
If you’re seeing viewstate errors like “The viewstate is invalid for this page and might be corrupted” here’s the dealio. For security ASP.NET encrypts the viewstate using an Autogenerated Key that is generated when your application pool (or worker process) is started. At AppliedI.net (and many hosts today) each website is placed in a unique application pool so your site is isolated from the other sites on the server. If your application pool recycles for whatever reason, the viewstate key will change and when you go to post back to your application is may fail with the gloriously informative error of:
“The viewstate is invalid for this page and might be corrupted”.
What’s causing the application pool to do this?
Your application pool is recycling due most likely to a couple things:
- you edited your web.config and that caused the change (not likely)
- IIS was reset on the server and that caused the change (less likely)
- Your application errored out causing the application pool to recycle (possible)
- Your application pool reached a memory limit and was forced to recycle (I put my money on the #4 horse to win! this is probably it)
All hosts today that use dedicated application pools, isolated application pools or “website sandboxing” whatever they may called also set a memory limit on the application pool in shared hosting, some set it more aggressively than others. The advanced web applications of today are using more and more resources as they are more and more complex, it’s not uncommon to find a web application using anywhere from 150-350MB of memory today, although the average is still just in the range of 80-120MB.
The good news is you have options on how to get around this.
- You can upgrade your shared hosting account to an account that has a higher memory limit. At appliedi.net we offer 4 different shared hosting accounts each with separate memory limits.
- You can upgrade to a VPS hosting account or dedicated hosting account and set an even higher memory limit.
- You can completely disable the viewstatemac by adding “enableViewStateMac=”false” in your web.config. This would be a bad thing though and you can google viewstate injection for why this is bad.
- You can generate a predefined key and stop using the default autogenerated key method.
#4 is probably the route you’ll want to go. My recommendation is to go with #1 first and not just because I work for a hosting company and want to see you spend more money per month. I recommend you upgrade your hosting account to an account that has a reasonable memory limit for your application because every time that application pool recycles your site is going to be slow as it recompiles and initializes the application. You also just lost your session state information so if you’re an ecommerce site and your client was in the middle of a checkout, they probably just lost their cart contents and have to start over.
Creating a predefined viewstatemac key
The guys over at www.aspnetresources.com have a keycreator tool that makes generating your own predefined viewstatemac key effortless. To do this you’d do the following
- visit: http://www.aspnetresources.com/tools/keycreator.aspx and use it to build a key
- Copy this key into your applications web.config file between <system.web> and </system.web>
- Save your web.config file and test your application to make sure it still works. If for some reason it doesn’t work, you can delete the changes and revert back.
Where to learn more
There’s always google. But Microsoft has a pretty extensive article in their KB at: http://support.microsoft.com/default.aspx?scid=kb;EN-US;829743 that will also help. If this sounds like something that’s happening to you at AppliedI.net on your ASP.NET hosting account please contact our support team and they’ll be happy to help you troubleshoot the issue.
How Microsoft UK got hacked and how you can learn from their mistakes
Aug 1st
I subscribe to windowsecurity.com‘s newsletter which is actually a pretty good read. Today’s newsletter has an article about the Microsoft UK Events Website getting defaced and goes into great detail to show just how the site was compromised.
In a nutshell, they used SQL Injection and the fact that the web.config was configured to display errors instead of displaying a custom error page.
I highly recommend any developer or website owner to review the article at:
http://www.windowsecurity.com/articles/Microsoft-UK-Events-Website-Hacked.html
so that they can avoid falling prey to these same tactics.
As a host, I can firmly say the #1 issue we see today with sites getting defaced is a weak password (using password, your username, your simple passwords simply aren’t secure) and the #2 issue is SQL Injection. Not many website owners (and unfortunately web developers) are familiar with SQL Injection and assume that their web app is inherently safe, this is a classic ASS-U-ME assumption. WindowsSecurity.com recommends that you use a commercial product from Acunetix to scan the security of your site. But other resources are:
- ScanAlert’s (or any other reputable scanning company’s) PCI compliance scanning service: http://www.appliedi.net/scanalert-pcicompliance/ which is offered free for the first year for AppliedI.net hosted websites.
- Nessus is a freely available scanning solution you can use as well (and the same tool many commercial security scanning providers use)
- xfocus.org also has a scanning tool called x-scan that I like to use as well. It uses nessus rules but is created by a Chinese company so there’s not really any documentation on it.
This is by no means the end all article on web site security but if you read the windowsecurity.com article I think you’ll be more aware of the techniques being used by hackers today and if you sign up for one of the commercial services and also experiment with a few of the free tools available today you’ll be a little more aware of just what’s out there.
Oh and one word of advice on using security scanners, most hosts today employ IPS (intrusion protection servers) or some other network security devices so don’t be surprised if you attempt to scan your live website it becomes unavailable. That could mean one of two things happened, one you crashed your website and have a serious issue or two, the host’s IPS or other network security saw your scans as an attack and has disabled your access to their network. It’s a good idea to scan your application locally of course and should you need to do a remote scan let your host know before hand.
Free Blogs courtesy of webmastersdepot.com
Mar 23rd
My friends at webmastersdepot.com have been awesome. I’ve been helping them out with their VPS and the configuration of their applications and recently helped them setup wordpress mu. WordPress MU is a blogging application built around wordpress (greatest blogging app available) that allows you to create a blogger.com, livespaces.com, wordpress.com (in fact it powers wordpress.com) type system.
So the guys at webmastersdepot have now started offering free blog hosting! Say what? a webhost recommending someone else’s free hosting? Well, we believe it’s a good thing. Why? you’ll get a taste of wordpress and before long you’ll want to move to a full hosting account. Webmastersdepot.com will get affiliate credits for referring you and we’ll gain you as a hosting customer. It’s a win-win.
Anyway, head over to http://webmastersdepot.com/blogs/ and signup for your free blog today.
Smartermail, Spamassassin, Virtuozzo VPSs
Jan 17th
A follow up to Smartertools answers the cry on the fight against spam with smartermail 4.0.
Alot of clients have been asking about how we’re handling spamassassin with Smartermail 4.0. It’s no secret that spamassassin on a windows server runs horribly slow. If more than a handful of domains are involved I have no doubt that spamassassin would cripple the server if not fail completely. However I also believe that greylisting is the more effective component in the smartertools anti-spam arsenal and will reduce spam to a fraction of what it would be with just spamassassin alone.
So there’s a ton of interest in farming out spamassassin to a Linux vps. Why, you ask? Well quite simply spamassassin runs like a mad cow on steroids on a Linux server. Okay maybe I’m exaggerating but it’s a ton faster. Plus as hard as it is to admit it, being a die hard windows geek, it was developed on Linux and the community support for is still very much linux so it just runs better. Fortunately, smartertools (under the leadership of Tim Uzzanti, formerly of Crystaltech and my two superhero-style developer home-boys Grady W and Bryon G) saw ahead and knew this could be a problem. What did they do? They devised smartermail to support not only a remote spamassassin processing server on linux but if need be a farm of spamassassin processing servers. By going with a linux install of spamassassin you’ll gain the added support of the spamassassin community (also linux geeks er um developers .. ehh linux developer, geek … same thing
).
What’s so great about Spamassassin on Linux?
Out of the box spamassassin isn’t very effective. Okay, it’s good but not nearly as good as it should be. To really take advantage of spamassassin you’ll want to add a few functions:
- DCC, DCC is the Distributed Checksum Clearinghouse. Basically your server creates a checksum from messages you receive compares this checksum to a distributed database of checksums to decide if the message is spam or not and then scores it accordingly. Basically you and a bunch of other mail server operators are teaming together to create a distributed, constantly updated database of spam and non-spam messages. Very cool.
- Vipul’s Razor, is similar to DCC but uses the Cloudmark Spamnet network (my understanding is it’s the same database that backs their commercial services).
- Pyzor, Similar to Razor, Pyzor is a completely free database and client written in .. you guessed .. python. It was developed out of fear that the Razor database being commercial may be ripped away from the opensource community at some point.
Now, these three tools will slow down your message processing (around 2-10 seconds generally and you should set a timeout so that they don’t hold up email too long) but they really add some power behind Spamassassin.
You now have evolved from the rules only processing of spamassassin into a rules processing system combined with a series of independent distributed message clearinghouses. I should note that if you have any volume whatsoever DCC is going to want you to setup your own DCCD (which we have setup currently but are still beta testing smartermail 4.0 before rolling out completely).
Why Rules? Don’t the Spammers Know These Rules too?
So now you have the default rules (around 91 I believe) and the clearinghouses. But what good are the rules right? I mean afterall if I have them the spammers have them too. Now enter the SpamAssassin Rules Emporium (SARE) a series of frequently updating rules that you can download at various times updating your rules using a tool like sa-update. This means your rules are constantly evolving just like the spammers are. Now we got kerosene on the fire. We have a set of consistently changing rules (which you’ll want to pick from carefully remember these could be touchy and some rules may flag good mail as bad) and a series of Independent distributed message clearinghouses.
A note about rules from SARE: There are different levels of rules, some that when tested against a mail test database picked up only spam messages but not all of the spam messages, some that picked up more spam messages but flagged a few good emails as spam too and finally some that picked up all the spam messages but flagged more ham as spam. It’s really up to you to decide what’s safe and what’s now.
Which rules do you deploy? Our own testing has shown that greylisting filters 90% of the spam and that spamassassin does a good job of flagging almost all of those that get through greylisting with just the safe level of rules employed. We have about 501 tests we run each message through currently and it takes between 1.2 and 5 seconds without the distributed database checks, with the database checks it takes 1.2 seconds to 20 seconds. Now our system hasn’t been fully optimized and tweaked yet but it’s getting there.
Rules and DCC what else does Spamassassin Give me?
So now we have a constantly updating database of rules, a way to compare our messages to a distributed database of email signatures to see if others have flagged them as spam and… here’s the coolest part. You know those annoying image emails you get selling viagra or stocks? That you can’t for the life of you figure out how to filter? Well spamassassin has OCR (object character recognition) plugins available that will read these messages and then review the text to see if it’s truly spam. This is VERY cool! But as the cat and mouse game goes, have you noticed that your image spam is becoming colorful now? Strange backgrounds? Multi-colored text? You know all those tricks we perform with CAPTCHA to keep bots from registering on our forms? Yeah the spammers are using those techniques in spam messages now (the rat bast*rds).
The Spam Fighting Duo becomes a powerful Dynamic Trio!
Spamassassin is very cool and Smartermail has gotten even cooler. Now enters the final member of our Team of Superhero Techno-tools, SWSoft‘s Virtuozzo. Virtuozzo is a OS virtualization VPS engine. What’s this mean? Hardware virtualization systems like Microsoft Virtual Server and VMWare have a overhead (reported on the order of 20%) due to virtualizing the hardware. This means 4 VPSs on a single server will only deliver the processing power of the single box at 80%. With hardware virtualization you gain a great deal of flexibility in being able to run mixed guest operating systems on a host system (IE, running Linux and Windows VPS’s on a Windows Host machine) but you pay for that with a performance loss (most argue with today’s processing power it’s an acceptable loss but you decide for yourself).
With OS virtualization you are still very much virtualized but you run the same Guest OS as the Host OS so you can’t run Linux on windows. But guess what? You aren’t getting bottlenecked as you are in HW virtualization. Now Virtuozzo gets even cooler. You get all the raw power, plus now that you’re using the same OS at the Host and across all of your guest OS’s they can actually share common memory and diskspace. So the 2GB of diskspace you’d normally lose in a 10GB VPS partition isn’t lost at all. You only give up any diskspace for files that differ from the host machine’s version (for instance if you created your own bind binary it and it’s necessary libraries would be unique to your vps and use your diskspace and memory allotment of your VPS servers) I believe this is around 100 to 200MB on average.
Next you get something called Virtuozzo templates. These are ready made application, operating system and in some cases full VPS machine templates that are shared across multiple VPS virtual engines (VE’s or VPSs if you will). So now you can have a series of very similar VEs (vps’s) running on a single hardware node all sharing resources. This means although your apps and virtual machine is very much separated and secure you’re not running all of the overhead of the guest operating system on your virtual machine and you’ll gain performance over a HW virtualized system. Our own informal testing showed this to be a great benefit and very much worth the tradeoffs between HW and OS virtualization for a hosted application and webhosting platform.
So why Virtuozzo for our spamassassin VEs?
- The performance difference between HW virtualization and OS virtualization. HW virtualization is great, adds alot of functionality that you may or may not need and will get the job done but OS virtualization is the only way to go in a production hosting environment that demands maximum performance, reliability and scalability.
- Shared OS resources reducing the need for redundant processes and diskspace waste. Allowing for more VPSs per HW node and thus lower cost.
- The ability to create templates of a working VPS design and then replicate it across hundreds of VPS’s within a matter of minutes (I didn’t really get into that but it’s extremely cool)
- The ability to patch a single VPS and then create a template for this patch and replicate it automatically across all VPSes.
- The ability to move a VPS from one HW node to another HW node with near zero downtime (again extremely cool)
- Finally, it’s a platform we’ve already adopted and have been using for about 3 years now and are extremely familiar with it and find it quite popular in the hosting industry.
I know there’s already been a ton of work on a VMWare image in the smartertools community and this is without question trail blazing efforts. For many servers the ready built solution is a clear winner. I mean afterall how many admins are going to have a Virtuozzo Linux HW node sitting around? Please don’t think I’m downplaying this solution or the great benefit this donation to the community has been, it’s a very very clever solution. But I honestly believe the more practical solution is a dedicated Linux VPS. Under high loads any mail server is going to slow down and require maximum disk I/O. Dedicated some of this disk I/O to a VPS engine on the same machine (using HW virtualization no less) is going to come at a cost and potentially not provide the performance required.
Side Note: Early on our shared mail servers were using SATA raid arrays. SATA drive I/O is known to burst to SCSI levels but won’t sustain those levels. As a result we had no choice but to move from SATA to SCSI and that was the only difference between the two configurations. Disk I/O is king in a mail server and fast drives and plenty of them in a RAID array is the only way to go for a mail server. Giving up some of this disk I/O to a collocated VPS scares me in our own environment. Your environment is probably much different and may or may not have the same issue but that’s for you to decide.
We’re creating these VPS engines so that we can offer not only a farm of Spamassassin servers for our shared hosting mail servers that we’re able to dynamically add additional nodes to quickly, but provide dedicated managed Spamassassin VPSs to our dedicated hosting clients and potentially mailserver admins worldwide regardless of where their mail servers reside.
Think about it, a plug and play spam fighting solution. This may not be an original Applied Innovations “Innovation” (that distinction goes to: someone_else )but it’s definitely one we’ve taken to the next level and that my friend is just why our company is named Applied Innovations, it’s not just a name, it’s what we do.
The Applied Innovations Spamassassin VPS solution is currently available in beta mode. It will be fully available following the completion of our beta testing. If you’re an Applied Innovations dedicated hosting client and need a spamassassin managed VPS online today, let us know and we’ll quote you a price.
Windows Live Writer Style Not Updated
Oct 11th
I recently installed the WordPress Category Visibility Plug-in which allows you to select categories you don’t want to show up in different places on your blog. I have delicious set to upload my delicious links every day to a special category and I removed it from the frontpage to keep it from junking up my blog. I also set the default category so that all of these entries would be entered in their own category and this is the category I don’t display on the homepage. Well, shortly after this change I updated my blog template and when I went to update my Windows Live Writer so it would show new posts using the new template it failed, and failed and failed. I really couldn’t figure it out.
Well today I went to check my delicious links and found all the temp posts that WLW uses when it’s trying to determine your blog’s style (very cool actually). Turns out the problem was that these posts weren’t displaying on the homepage but instead in my delicious category and also weren’t getting deleted (I have like 50 temp posts in there). I turned the default category back to “Uncategorized” and set it to display on the homepage and presto! WLW works again. I suspect I’m not the only one having this issue so I hope this helps someone else.