I am setting up a mono server using Apache and mod_mono on the Raspberry PI 3 running Raspbian Jesse. I already have mono and mod_mono installed and functioning properly.
This is my desired folder structure
I would like to configure Apache so that I can simply copy a new .NET mvc3 app into a folder directly beneath /var/www/html, (i.e. /var/www/html/App1), and each of those applications will automatically start working as MVC3 apps without having to add an entry to the apache config for each application.
MonoAutoApplication enabled
does not work in this case because I am not serving .aspx pages (or any other .net file), but rather these are MVC applications.
The benefit of this approach is that I can keep this config file with each application in version control. Then when starting a server from scratch, there is less configuration that needs to be done when deploying the apps.
Any ideas on how to handle this?
A few assumptions are made here.
At the end of apache2.conf, add the following:
/etc/apache2/apache2.conf
#define the default mono server
MonoServerPath default /usr/bin/mod-mono-server4
#include all config files from all mono apps
IncludeOptional "/var/www/html/*/mod_mono.con[f]"
#prevent web access to mod_mono.conf files
<Files ~ "mod_mono.conf">
Order allow,deny
Deny from all
</Files>
and then for each application, add this mod_mono.conf, changing the path to the folder accordingly /var/www/html/app1/mod_mono.conf
AddMonoApplications default "/app1:/var/www/html/app1"
<Location /app1>
SetHandler mono
</Location>