title: How to implement working web server with Mono WebAPI application
body: <p>Mono 3.2 MVC4 WebAPI application is running in Debian x64 VPS server. Mono is compiled from source and 4.5 subtree is used.
  Application requires Chrome or Safari browser.</p>
  
  <p>After refreshing browser window several times server does not work properly. I tried all known free possibilites:</p>
  
  <p><strong>Apache + mod_mono</strong></p>
  
  <p>After pressing browser refresh button several times server randomly returns 500 error for some pages
  and apache error log contains "failed to map path" exception.</p>
  
  <p>I posted it in </p>
  
  <p><a href="https://stackoverflow.com/questions/20356779/how-to-fix-failed-to-map-path-errors-in-mono-mvc4-application">https://stackoverflow.com/questions/20356779/how-to-fix-failed-to-map-path-errors-in-mono-mvc4-application</a></p>
  
  <p>and in </p>
  
  <p>Mono ASP.NET mailing list without any response.</p>
  
  <p>There are number of mono applications in server, maybe mod_mono selects wrong thread or is there some bug in webapi mapping implementation in mono.</p>
  
  <p><strong>Nginx + mono-fastcgi-server4.exe</strong></p>
  
  <p>Holding down F5 key causes 200% CPU usage forever in  mono-fastcgi-server4.exe</p>
  
  <p>I posted it in </p>
  
  <p><a href="https://stackoverflow.com/questions/20512978/how-to-limit-mono-197-cpu-usage-in-mono-fastcgi-server">https://stackoverflow.com/questions/20512978/how-to-limit-mono-197-cpu-usage-in-mono-fastcgi-server</a></p>
  
  <p>and in </p>
  
  <p>Mono ASP.NET mailing list without any solution.</p>
  
  <p>Is looks like there is bug in mono fastcgi server or it is not compatible with mono 3.2</p>
  
  <p><strong>Using xsp4.exe directly</strong> </p>
  
  <p>It causes "server does not return data" in Chrome if browser window is refreshed several times.</p>
  
  <p>I posted this in</p>
  
  <p><a href="https://code.google.com/p/chromium/issues/detail?id=329311" rel="nofollow noreferrer">https://code.google.com/p/chromium/issues/detail?id=329311</a></p>
  
  <p>without response.</p>
  
  <p>Maybe xsp4 does not implement http protocol properly.</p>
  
  <p>Havent tried ServiceStack since it cannot used for closed source development which is required. Also application uses also images, css, js files and MVC views which needs also served.</p>
  
  <p>How to create proper server for mono which returns correct data ?</p>