3

I know nothing about linux or mono. I have web app that I am building in WebMatrix. I've set up simple service with ServiceStack and a cshtml test page. All runs fine on Windows but when I move the files to linux box my pages work but the RESTful calls to ServiceStack service bringing back 404 no found. Is there something I'm missing here? Does mono on linux read the web.config and global.asax the same?

Thanks

Kirby
  • 1,739
  • 1
  • 17
  • 21
  • Instead of moving your files to a linux box, you should not move your files to a linux box :) – VoidKing Apr 26 '13 at 19:57
  • That is funny, and I total agree with you. My friend however had a spot for me on his server. – Kirby Apr 26 '13 at 20:43
  • Update: So what I did is I took the ServiceStack code out of global.asax and got rid of that file. I placed the code into _AppStart.cshtml. Again it works fine on Windows but not when moved to the Linux box. Ideas? – Kirby Apr 26 '13 at 20:44
  • Man, I wish I could help you, but I gave up on Linux a long time ago. You could always research Linux and get about 80 different answers, however, they would, every one of them, be wrong. That is, in a nutshell, what it is like trying to learn how to do anything in any Linux distro. Here is an equation: `(Linux + (∞ * [attempts]) = (Epic + Fail)^∞)` – VoidKing Apr 26 '13 at 20:49
  • 1
    I will, however +1 your post, as it is a good question, obviously – VoidKing Apr 26 '13 at 20:51
  • So I decided the price was right to sign up for hosting using windows os. Everything works. Publishing to and from is a breeze with WebMatrix. ServiceStack just runs! – Kirby Apr 27 '13 at 21:20
  • I would recommend writing your app/service in MonoDevelop [monodevelop.com] and looking this http://stackoverflow.com/questions/12188356/what-is-the-best-way-to-run-servicestack-on-linux-mono over – paaschpa Apr 28 '13 at 02:31
  • I run ServiceStack on Linux without any trouble. If you are more specific on your setup, i.e. what webserver you use (xsp/fastcgi/apache+mod_mono) and maybe post the configuration files and global.asax one might help you out – Dynalon May 07 '13 at 15:10

2 Answers2

1

Yes, it reads them the same.
But...
Linux uses case-sensitive file-systems.
So if you type:
http://localhost.com/whatever.aspx
and your site is actually called whatever.aspx, then it will work.

However, if you type Whatever.aspx, that will get you a 404.

Also, if your site's codebehind is called Master.cs (with class Master), and you reference it on a aspx file with master.cs (such as the default visual Studio web application template), you will get a "not found" error.

Additionally, if you run mono on mod-mono with Apache, i think it runs on port 8080 or 8082 by Default, so you have to type http://localhost.com:8080/whatever.aspx.

A better idea might be to run servicestack on nginx via fastcgi-mono-server4.

Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442
1

It sounds like casing - you should fix that for performance reasons, but in the meantime you can get Mono to ignore-case by setting the MONO_IOMAP environment variable as follows before starting your mono process e.g. I use the following in my service script:

export MONO_IOMAP=all
${MONOSERVER} /applications=${WEBAPPS} /socket=tcp:127.0.0.1:9000 &

It's documented here:

http://www.mono-project.com/IOMap

stephbu
  • 5,072
  • 26
  • 42