[Mono-aspnet-list] How to run MVC5 app on apache2+mod_mono

Gonzalo Paniagua Javier gonzalo.mono at gmail.com
Wed Mar 2 05:46:44 UTC 2016


Add .cshtml to the list of extensions handled (AddHandler).

-Gonzalo

On Mon, Feb 29, 2016 at 2:04 PM, Shrimpy WU <shrimpywu at hotmail.com> wrote:

> Hi Everyone,
>
> I have a mvc5 application (NOT asp.net 5), runs fine on XSP (cd into
> directory and run "xsp" with admin permission)
> However struggling to have it run on apache2+mod_mono.
> When i visit "http://127.0.0.1/myapp", it list all the files/folders
> under myapp. if i visit "http://127.0.0.1/myapp/Default.cshtml", it
> display the raw content.
>
> Will be good if anyone can help and point out what did i do wrong.
>
> Try to follow document that i think is right, but didn`t get any success
> "http://www.mono-project.com/docs/web/mod_mono/"
> "http://r2d2.cc/2014/03/25/asp-net-mvc-under-linux-with-mono/"
>
> Below is my config settings:
>
> /etc/apache2#
> ├── sites-available
> │   ├── 000-default.conf
> │   ├── default-ssl.conf
> │   └── myapp.conf
> └── sites-enabled
>     ├── 000-default.conf -> ../sites-available/000-default.conf
>     └── myapp.conf -> ../sites-available/myapp.conf
>
>
> Content from myapp.conf:
>
>   Alias /myapp "/var/www/html/myapp"
>   MonoServerPath myapp "/usr/bin/mod-mono-server4"
>   MonoDebug myapp true
>   MonoSetEnv myapp MONO_IOMAP=all
>
>   MonoAutoApplication disabled
>   AddHandler mono .aspx .ascx .asax .ashx .config .cs .asmx .axd
>   MonoApplications myapp "/myapp:/var/www/html/myapp"
>   <Location "/myapp">
>     Allow from all
>     Order allow,deny
>     MonoSetServerAlias myapp
>     SetHandler mono
>     SetOutputFilter DEFLATE
>     SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip dont-vary
>   </Location>
>   <IfModule mod_deflate.c>
>     AddOutputFilterByType DEFLATE text/html text/plain text/xml
> text/javascript
>   </IfModule>
>
> _______________________________________________
> Mono-aspnet-list mailing list
> Mono-aspnet-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-aspnet-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-aspnet-list/attachments/20160301/d5a65600/attachment.html>


More information about the Mono-aspnet-list mailing list