简体   繁体   English

ServiceStack with mono on linux

[英]ServiceStack with mono on linux

I know nothing about linux or mono. 我对linux或mono一无所知。 I have web app that I am building in WebMatrix. 我有Web应用程序,我正在WebMatrix中构建。 I've set up simple service with ServiceStack and a cshtml test page. 我已经使用ServiceStack和cshtml测试页面设置了简单的服务。 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. 所有在Windows上都运行正常,但是当我将文件移动到linux框时,我的页面可以正常工作,但是RESTful调用ServiceStack服务却没有找到404。 Is there something I'm missing here? 这里有什么我想念的吗? Does mono on linux read the web.config and global.asax the same? linux上的mono是否读取web.config和global.asax相同?

Thanks 谢谢

Yes, it reads them the same. 是的,它读起来是一样的。
But... 但...
Linux uses case-sensitive file-systems. Linux使用区分大小写的文件系统。
So if you type: 所以,如果你输入:
http://localhost.com/whatever.aspx http://localhost.com/whatever.aspx
and your site is actually called whatever.aspx, then it will work. 并且您的网站实际上被称为whatever.aspx,然后它将工作。

However, if you type Whatever.aspx, that will get you a 404. 但是,如果您输入Whatever.aspx,那将获得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. 此外,如果您的站点的代码隐藏被称为Master.cs(使用class Master ),并且您在带有master.cs的aspx文件(例如默认的Visual Studio Web应用程序模板)上引用它,您将收到“未找到”错误。

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 . 另外,如果您使用Apache在mod-mono上运行mono,我认为它默认运行在端口8080或8082上,因此您必须输入http://localhost.com:8080/whatever.aspx

A better idea might be to run servicestack on nginx via fastcgi-mono-server4. 更好的想法可能是通过fastcgi-mono-server4在nginx上运行servicestack。

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 eg I use the following in my service script: 它听起来像套管 - 你应该出于性能原因修复它,但同时你可以通过在开始单声道处理之前设置MONO_IOMAP环境变量来使Mono忽略大小写,例如我在服务脚本中使用以下内容:

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

It's documented here: 它在这里记录:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM