I ended up attempting to setup ASP with ModMono on Apache2, via following this guide.
It's not working, however: when I click a .aspx file, I end up just downloading it on my localhost.
Here's my asp.webapp file /etc/mono-server2
<apps>
<web-application>
<name>asp</asp>
<vpath>/asp</vpath>
<path>/var/www/asp/</path>
<vhost>127.0.0.1</vhost>
</web-application>
</apps>
and my asp file in /etc/apache2/sites-available/
<Virtualhost 127.0.1.1:80>
ServerName asp
DocumentRoot /var/www/asp/
<Directory /var/www/asp/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow, deny
Allow from all
SetHandler mono
DirectoryIndex index.aspx index.html
</Directory>
</VirtualHost>
Is there anything which I'm doing 开发者_StackOverflow社区wrong here? The only issue I can think of is that I'm trying to reference a directory, rather than a specific page or file.
If you have installed mod_mono and it is configured correctly to work with apache2 then all you will need to do is change your site configuration in /etc/apache2/sites-available/ to something like this:
<Virtualhost 127.0.1.1:80>
ServerName asp
DirectoryIndex index.html index.aspx
DocumentRoot /var/www/asp/
AddMonoApplications asp "/:/var/www/asp"
MonoServerPath asp "/usr/bin/mod-mono-server2"
<Directory /var/www/asp/>
MonoSetServerAlias asp
SetHandler mono
AddHandler mod_mono .aspx .ascx .asax .ashx .config .cs .asmx
<FilesMatch "\.(gif|jp?g|png|css|ico|xsl|wmv|zip)$">
SetHandler None
</FilesMatch>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow, deny
Allow from all
SetHandler mono
DirectoryIndex index.aspx
</Directory>
精彩评论