果然已经升级到最新的 mono 2.8.1 版本了。
在 Apache mod_mono configuration tool 网页可以生成运行 ASP.NET 所需要的 Apache 软件的配置文件,如下图所示:
生成的 ben.skyiv.com.conf 文件如下所示:
<virtualhost *:80> ServerName ben.skyiv.com DocumentRoot /home/ben/www # MonoServerPath can be changed to specify which version of ASP.NET is hosted # mod-mono-server1 = ASP.NET 1.1 / mod-mono-server2 = ASP.NET 2.0 # For SUSE Linux Enterprise Mono Extension, uncomment the line below: # MonoServerPath ben.skyiv.com "/opt/novell/mono/bin/mod-mono-server2" # For Mono on openSUSE, uncomment the line below instead: MonoServerPath ben.skyiv.com "/usr/bin/mod-mono-server2" # To obtain line numbers in stack traces you need to do two things: # 1) Enable Debug code generation in your page by using the Debug="true" # page directive, or by setting in the # application's Web.config # 2) Uncomment the MonoDebug true directive below to enable mod_mono debugging MonoDebug ben.skyiv.com true # The MONO_IOMAP environment variable can be configured to provide platform abstraction # for file access in Linux. Valid values for MONO_IOMAP are: # case # drive # all # Uncomment the line below to alter file access behavior for the configured application MonoSetEnv ben.skyiv.com MONO_IOMAP=all # # Additional environtment variables can be set for this server instance using # the MonoSetEnv directive. MonoSetEnv takes a string of 'name=value' pairs # separated by semicolons. For instance, to enable platform abstraction *and* # use Mono's old regular expression interpreter (which is slower, but has a # shorter setup time), uncomment the line below instead: # MonoSetEnv ben.skyiv.com MONO_IOMAP=all;MONO_OLD_RX=1 MonoApplications ben.skyiv.com "/:/home/ben/www" <location "/"> Allow from all Order allow,deny MonoSetServerAlias ben.skyiv.com 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> </virtualhost>