在 Apache2.2 下设置 Mono 的 ASP。Net
在 Yast2控制中心里选 系统 -> 磁盘分区管理 , 点开左边的树,选择分区,编辑,挂载 /mnt/Music (Music 是自己起的名字)。然后在 FSTAB 选项中,把 fmask 和 dmask 的值改为 000 ,完成。 就可以自动挂载并可读写了。经本人实验, 在OpenSUSE11.2 x64 系统下,Apache2.2 建虚拟目录总出现 403 无权限错误,与此有关。
在 /etc/apache2/config.d/ 下新建虚拟目录的配置文件: MyTrade.conf (MyTrade 替换成你自己的虚拟目录名,文件名需以 conf 结尾)
Alias /MyTrade "/mnt/App/MonoApp/MyWebTradeSln/MyTrade"
# 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 MyTrade "/opt/novell/mono/bin/mod-mono-server2"
# For Mono on openSUSE, uncomment the line below instead:
MonoServerPath MyTrade "/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 MyTrade 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 MyTrade 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 MyTrade MONO_IOMAP=all;MONO_OLD_RX=1
MonoApplications MyTrade "/MyTrade:/mnt/App/MonoApp/MyWebTradeSln/MyTrade"
<Location "/MyTrade">
Options Indexes MultiViews
Allow from all
Order allow,deny
MonoSetServerAlias MyTrade
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>
这样就行了。