使Apache(Linux)支援Silverlight

來源:互聯網
上載者:User
測試環境

CentOS 5.2,Apache 2.2.3

配置Apache

開啟Apache 設定檔httpd.conf,位置參考:/etc/httpd/conf/httpd.conf

在設定檔中確保mod_write、mod_mime 模組已載入:

LoadModule rewrite_module modules/mod_rewrite.so

LoadModule mime_module modules/mod_mime.so

隨後在設定檔中加入MIME 資訊(經測試不加也能運行SL):

AddType application/xaml+xml .xaml
AddType application/x-silverlight-app .xap
AddType application/x-ms-xbap .xbap

儲存httpd.conf,並退出編輯模式,重啟Apache 服務:

service httpd restart

載入Silverlight

     由於SL 是用戶端運行,所以Server 上其實不用做太多設定,下面將xap 程式載入到HTML即可。建立一個PHP 程式加入下面代碼:

<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&amp;v=3.0.40624.0"        style="text-decoration:none">        <img src="http://go.microsoft.com/fwlink/?LinkId=108181"              alt="Get Microsoft Silverlight" style="border-style:none" />    </a></object>
相關資料

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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.