手机版
你好,游客 登录 注册
背景:
阅读新闻

在 Linux 操作系统中运行 ASP.NET 4

[日期:2011-03-14] 来源:Linux社区  作者:skyivben [字体:大 中 小]

果然已经升级到最新的 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>
linux
本文评论   查看全部评论 (1)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款
第 1 楼
* LIN粉 发表于 2012/5/12 1:25:17
Linux服务器运行ASP.NET,最完美的方案是用Jexus!