Sunday 31 May 2009

How to solve Unhandled Error in Silverlight Application Code: 2104


I’ve found that I get this error every time I upload a Silverlight application to a new webserver. IIS does not have the correct settings by default.
The Problem: You ftp a Silverlight App to an IIS website, go to the website in a browser, and get the following error:
Message: Unhandled Error in Silverlight Application
Code: 2104
Category: InitializeError
Message: Could not download the Silverlight application. Check web server settings
The Cause: The Silverlight Mime types (.xaml, .xap and .xbap) are not listed in that websites registered mime types, therefore IIS will not send those files to the browser.
The Solution: Open IIS on the server, go to HTTP headers, click on Mime Types, click “Add New” and add the following:
Extension – Mime Type
.xaml – application/xaml+xml
.xap – application/x-silverlight-app
.xbap – application/x-ms-xbap
Hit Apply and your application will load!

Thursday 14 May 2009

How To Add DomainKeys and SPF Records on CPanel Servers

This how to describe how to add domainkeys and SPF (Sender Policy Framework) records on CPanel Servers. Whenever you create a domain on CPanel server using WHM, it wont add domainkeys and SPF records for particular domains. To add domainkeys and SPF records please use following steps.

We consider here we have a domain sohailriaz.com with cpanel username sohailri

Please note on CPanel servers most of the work is done using cpanel username which then reflect setting on particular domains. If you have several domains / sub domains under one username, it will add domainkeys and SPF records for all domains / subdomains.

Execute the following command on your CPanel server using root.

1 DomainKeys


1.1 Add DomainKeys for single user


/usr/local/cpanel/bin/domain_keys_installer sohailri

where sohailri is a username

1.2 Add DomainKeys for all CPanel users.


If you wish to add DomainKeys for all Cpanel users on your server, execute following command.
ls /var/cpanel/users | while read a; do
/usr/local/cpanel/bin/domain_keys_installer $a
done

2 SPF (Sender Policy Framework)


2.1 Add SPF for single account.


/usr/local/cpanel/bin/spf_installer sohailri

2.2 Add SPF for all Cpanel accounts.


If you want to add SPF records for all cpanel accounts exist on your server then use the following command.
ls /var/cpanel/users | while read a; do
/usr/local/cpanel/bin/spf_installer $a
done

3 Enable DomainKeys and SPF for every new CPanel account.


If you want to add DomainKeys and SPF for every new account created on Cpanel, then do the following.
vi /scripts/postwwwacct

postwwwacct is a file which execute after wwwacct (used to create account), paste following lines in the file
#!/usr/bin/perl

my %OPTS = @ARGV;
$ENV{USER} = “$OPTS{‘user’}”;
system q(/usr/local/cpanel/bin/domain_keys_installer $USER);
system q(/usr/local/cpanel/bin/spf_installer $USER);