Test Environment
CentOS 5.2, Apache 2.2.3
Configure Apache
Open the Apache configuration file httpd. conf. For more information, see/etc/httpd/conf/httpd. conf.
Make sure that the mod_write and mod_mime modules have been loaded in the configuration file:
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule mime_module modules/mod_mime.so
Then add the MIME information to the configuration file (the SL can be run without adding it ):
AddType application/xaml + xml. xaml
AddType application/x-silverlight-app. xap
AddType application/x-ms-xbap. xbap
Save httpd. conf, exit the editing mode, and restart the Apache service:
Service httpd restart
Load Silverlight
Because SL runs on the client, you do not need to make too many settings on the Server. Load the xap program to HTML below. Add the following code to create a new PHP program:
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="500px"> <param name="source" value="AutoCompleteBox.xap" /> <param name="onError" value="onSilverlightError" /> <param name="background" value="white" /> <param name="minRuntimeVersion" value="3.0.40624.0" /> <param name="autoUpgrade" value="true" /> <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none"> </a></object>
Related Materials
Silverlight Mime types in IIS6 and Apache
Run Silverlight with Apache Server (Under linux)
How to: Add Silverlight to a Web Page by Using HTML