Apache中的虚拟主机下载文件而不是显示它

时间:2016-01-28 09:17:56

标签: .net linux apache mono

我使用apache2 w / mono mod,当我转到我的本地ip时它工作正常。 192.168.1.210

但是当我尝试去我的虚拟主机时

www.example.com

它将下载网页而不是显示它。 文件:mod_mono.conf

for...$...

的apache.conf

  GNU nano 2.2.6                                                                                                          

AddType application/x-asp-net .aspx .ashx .asmx .ascx .asax .config .ascx
DirectoryIndex index.aspx

# Include the web application definitions generated by mono-server{2,4}-update.
#
# If you want to use ASP.NET 2.0 (via mono-apache-server2), use:
# Include /etc/mono-server2/mono-server2-hosts.conf
#
# If you want to use ASP.NET 4.0 (via mono-apache-server4), use:
# Include /etc/mono-server4/mono-server4-hosts.conf

Include /etc/mono-server4/mono-server4-hosts.conf


<VirtualHost *:80>
  ServerName example.com
  ServerAlias www.example.com
  ServerAdmin web-admin@example.com
  DocumentRoot /var/www/html
  # 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 example.com "/opt/novell/mono/bin/mod-mono-server4"
  # For Mono on openSUSE, uncomment the line below instead:
  MonoServerPath example.com "/usr/bin/mod-mono-server4"

  # 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 example.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 example.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 example.com MONO_IOMAP=all;MONO_OLD_RX=1

  MonoApplications example.com "/:/var/www/html"
  <Location "/">
    Allow from all
    Order allow,deny
    MonoSetServerAlias example.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>

0 个答案:

没有答案