Advertisement

silverlight hosting and linux hosting

UPDATE: visit rob relyea's post on more mime types for all xaml supported apps including xaml browser apps as well.

i've been seeing some discussion lately about hosting .  maybe i can take a moment here to help clarify some things and show some options.

there are hosters out there that are promoting as silverlight hosters.  while i think that is great, i think some of the messaging has confused others.  for example, if you go to a hoster that doesn't list silverlight support, are they incapable of hosting silverlight?  no.

in fact, a windows server isn't even required for straight-up silverlight hosting.  of course the caveat here being if your silverlight application is embedded within an asp.net application, then yes, of course, windows would be needed.  but lets assume simple lame examples here.  i took 10 minutes (longer to find a good rated one) and setup a free linux host account.  the particular host i selected is running apache 1.3.37 on some unix blend (read: no windows).  i created a silverlight 1.0 application and a silverlight 1.1 application.  i logged in to my free account, uploaded the files, and voila.

so there you have it, no windows and still silverlight.  why?  well the server just needs to deliver the assets to the browser (where the plugin is) -- as silverlight is a client technology.  apache is even just serving up the windows media file as a progressive download.

so in 10-15 minutes i created 3 lame applications, a totally free *nix/apache host and put up some silverlight.  proof enough?

now what about windows you ask?  some of you may have listen to the most excellent .NET Rocks! podcast.  some of you may have even heard the recent silverlight discussion with shawn wildermuth.  in that show carl mentioned to shawn that he had to install .net 3.0 on his windows server to get silverlight to work.  as i was listening to this (as i'm sure shawn was) i was confused.  it was a time i wish .NET Rocks! was live so i could call in talk some smack.  but carl's not a dumb guy and although they didn't debug the situation on his show, he did bring out a point.

you see, your typicall windows server installation these days with iis6 is pretty locked down.  so much to the point that unknown file types are served 404 style from the server (which i believe what was happening to carl).  it's been pointed out a few times in the forums as well.  what is going on you ask?  well, likely it is the .xaml file.  iis6 doesn't know this file type and there is no wildcard mime types set up to just allow freestyle.  if you find yourself in this situation, don't panic.  simply add the mime type (file: .xaml; type: application/xaml+xml -- or you can even use text/xml -- there are reasons you might want xaml+xml for XAML browser apps, etc.) and you are fine.  in fact if you are in a shared host environment and they don't have that setup, you can't get to it, whatever then guess what: just rename your xaml files to .xml -- or heck .txt.  now this may pose some annoyances in your dev toolset, but it is a workaround.  where do you change MIME types you ask?  when you start the iis manager, you can right click on the server name, choose properties and you'll see a mime types button -- go there.  this will change it globally.  you can also just add on a per site basis if desired, just look in the site properties.

so why did carl think .net 3 was required and it was working after he installed it?  well, .net 3 supports XAML browser apps (xbaps).  the installation of the framework adds the supported types for you if iis exists.

what about other hosting options.  well, there is also silverlight streaming services, a free service from microsoft enabling you (currently) 4GB of space and will essentially host your silverlight application for you and enable various ways of streaming it out via code or through simple iframe calls as well.  this requires no server on your part :-).

so let's replay our options here for silverlight hosting:

    • windows required: no
    • must be silverlight enabled: depends on how locked down the server was, possible mime type change is all that is needed
    • *nix/osx/pick-your-os: yes as long as a web server can respond to HTTP GET
    • silverlight streaming services

i hope this helps clear things up and at least not make them more murky waters for you.  if so, drop a comment and lets clear it up.  i think it is great hosters are recognizing silverlight and are noting it as a feature for their customers to look for, but just remember that any web server can serve up silverlight content.

  1. 8/25/2007 12:46 PM | # re: silverlight hosting and Linux hosting
    Hi Tim
    can you publish the [ 3 ] sample code of this article ?
  2. 8/25/2007 1:08 PM | # re: silverlight hosting and linux hosting
    guy: done. link updated -- it is just an output from expression media encoder however...i can't take any credit :-)
  3. 8/26/2007 12:52 PM | # re: silverlight hosting and linux hosting
    I’m glad you declared this Tim, IMHO, I think you can almost compare SilverLight to HTML in the portability as the XAML is almost a markup language like HTML so you can host on any web server
  4. 9/3/2007 11:07 PM | # re: silverlight hosting and linux hosting
    Hi Tim,

    Building on your sample #3, I am trying to make an index page with links to the WMVs on an Apache server. Clicking a link would open up the particular WMV. Is there a way to pass filename as arguments to the service (such as the StartPlayer_0 routine)? Thanks in advance.
  5. 9/4/2007 10:45 AM | # re: silverlight hosting and linux hosting
    tim horton: in theory yes. in the code provided by the output of the media player template(which is the template i used), that code is not in there. you could use any server language of course to provide a variable to the javascript that it would then read, or also implement some type of query string logic to implement using javascript to get the playback URL or something -- bottom line, sure you could do it, just in the code sample i provided that model is not included explicitly.
  6. 9/4/2007 11:28 AM | # re: silverlight hosting and linux hosting
    thanks for the quick reply, Tim.
  7. 9/12/2007 1:53 AM | # re: silverlight hosting and linux hosting
    Hi Tim,

    Thanks for posting this for us.

    My webhost is non-windows and so I followed your suggestions regarding MIME types and added XAML, with no success.

    I've tried renaming the .xaml to both .xml and .txt, both without success.

    Any other suggestions/ideas?

    Many thanks in advance.

    Nigel.
  8. 9/12/2007 11:46 AM | # re: silverlight hosting and linux hosting
    Hi Tim,
    In my browser your sample 2: silverlight 1.1 lame application served via apache with c# code doesn't work, just show the install silverlight button,sample 1 and 2 work fine. I've tried a few lame samples on my sites and the same thing happens on my pages,just the install silverlight button. It's installed and runs fine on test sites, your samples 1 and 3, but not the pages I build using encoder. Any ideas what I might be doing wrong?
  9. 9/12/2007 9:19 PM | # re: silverlight hosting and linux hosting
    hey tom, i just went to those links and it works for me. perhaps you don't
    have the latest silverlight? for the c# ones to work you must have

    the 1.1alpha plugin installed on your machine which you must

    explicitly get since
    it is still in alpha.
  10. 9/13/2007 11:08 AM | # re: silverlight hosting and linux hosting
    Tim,

    I had 1.1 installed hen I tried it. I still got the install silverlight button and installation failed becasue I had a more recent version installed. So thinking 1.1 was the problem, I uninstalled it and installed 1.0, anyway w/ 1.1 I couldn't see any of your samples at least with 1.0 I get to see samples 1 and 3. BTW, I've tried on 2 different computers same thing, next i'll try with Firefox. Since the demo I made was with encoder, I'll see if I can do an option in encoder w/ js. I just downloaded the August release of Blend since my studio version of blend didn't have the option of creating a js silverlight app. I'll keep banging away at it.
  11. 9/18/2007 9:23 PM | # re: silverlight hosting and linux hosting
    Awesome article, this should do very well to educate the masses on hosting silverlight. I'll be giving this link to anyone that asks. ( :


    Cheers,

    Corey
  12. 1/5/2008 6:53 AM | # re: silverlight hosting and linux hosting
    Quote: "of course the caveat here being if your silverlight application is embedded within an asp.net application, then yes, of course, windows would be needed. "

    Actually, you can host ASP.NET 1.x and 2.x applications with Apache on Linux , using Mono.

    (Even some parts of .NET 3.0 and 3.5 can be used)
  13. 1/30/2008 10:05 AM | # re: silverlight hosting and linux hosting
    The sample:
    http://www.zendurl.com/t/timheuer/v1_1/Default.html

    Doesn't seem to work.

    The same goes for my own application which worked when hosted on IIS but not with Apache:

    http://www.itcrowd.be/silverlight/netrissilver.html

    As you can see the same exception occurs.
  14. 5/5/2009 9:51 AM | # re: silverlight hosting and linux hosting
    I've tried a few lame samples on my sites and the same thing happens on my pages,just the install silverlight button. It's installed and runs fine on test sites, your samples 1 and 3, but not the pages I build using encoder.
  15. 5/5/2009 9:59 AM | # re: silverlight hosting and linux hosting
    Make sure you are using the latest Silverlight.js file which is likely blocking you (I'm guessing it is Firefox you're seeing this on: timheuer.com/.../...ight-javascript-detection.aspx)

 
Please add 1 and 7 and type the answer here:
First time here? You are looking at the most recent posts. You may also want to check out older archives. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS or email. Thank you for visiting! (hide this)