这一条就是要求你配置的mono的2.0.50727方式运行,否则默认会以1.1的方式运行。
[root@goosns conf.d]# cat mod_mono.conf
# mod_mono.conf
# Acthung! This file may be overwritten
# Use 'include mod_mono.conf' from other configuration file
# to load mod_mono module.
<IfModule !mod_mono.c>
LoadModule mono_module /usr/lib/httpd/modules/mod_mono.so
AddType application/x-asp-net .aspx
AddType application/x-asp-net .asmx
AddType application/x-asp-net .ashx
AddType application/x-asp-net .asax
AddType application/x-asp-net .ascx
AddType application/x-asp-net .soap
AddType application/x-asp-net .rem
AddType application/x-asp-net .axd
AddType application/x-asp-net .cs
AddType application/x-asp-net .config
AddType application/x-asp-net .Config
AddType application/x-asp-net .dll
DirectoryIndex index.aspx
DirectoryIndex Default.aspx
DirectoryIndex default.aspx
</IfModule>
Alias /mono "/usr/lib/xsp/test"
# 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 mono "/opt/novell/mono/bin/mod-mono-server2"
# For Mono on openSUSE, uncomment the line below instead:
MonoServerPath mono "/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 <compilation debug="true" /> in the
# application's Web.config
# 2) Uncomment the MonoDebug true directive below to enable mod_mono debugging
MonoDebug mono 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 mono 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 mono MONO_IOMAP=all;MONO_OLD_RX=1
MonoApplications mono "/mono:/usr/lib/xsp/test"
<Location "/mono">
Allow from all
Order allow,deny
MonoSetServerAlias mono
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>
重启httpd服务器:
service httpd restart
或
/etc/init.d/httpd restart
测试页面:
rpm安装的XSP的目录结构
/usr/bin/xsp
/usr/lib/mono/gac/xsp
/usr/lib/xsp
/usr/share/doc/packages/xsp
rpm 安装 mono 的目录结构
/etc/mono
/usr/bin/mono
/usr/lib/mono
/usr/share/mono-1.0/mono
/usr/include/mono-1.0/mono
/usr/lib/xsp/test测试目录