.net Apache中的虚拟主机下载文件而不是显示它
我使用的是apache2 w/mono mod,当我访问本地ip时,它可以正常工作。 192.168.1.210 但是当我尝试转到我的虚拟主机时 www.example.com 它将下载网页而不是显示它。 文件:mod_mono.conf.net Apache中的虚拟主机下载文件而不是显示它,.net,linux,apache,mono,.net,Linux,Apache,Mono,我使用的是apache2 w/mono mod,当我访问本地ip时,它可以正常工作。 192.168.1.210 但是当我尝试转到我的虚拟主机时 www.example.com 它将下载网页而不是显示它。 文件:mod_mono.conf GNU nano 2.2.6 AddTyp
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>
GNU nano 2.2.6
AddType应用程序/x-asp-net.aspx.ashx.asmx.ascx.asax.config.ascx
DirectoryIndex.aspx
#包括mono服务器{2,4}-update生成的web应用程序定义。
#
#如果要使用ASP.NET 2.0(通过mono-apache-server2),请使用:
#包括/etc/mono-server2/mono-server2-hosts.conf
#
#如果要使用ASP.NET 4.0(通过mono-apache-server4),请使用:
#包括/etc/mono-server4/mono-server4-hosts.conf
包括/etc/mono-server4/mono-server4-hosts.conf
ServerName example.com
ServerAlias www.example.com
服务器管理网站-admin@example.com
DocumentRoot/var/www/html
#可以更改MonoServerPath以指定承载哪个版本的ASP.NET
#mod-mono-server1=ASP.NET 1.1/mod-mono-server2=ASP.NET 2.0
#对于SUSE Linux Enterprise Mono Extension,请取消注释以下行:
#MonoServerPath example.com“/opt/novell/mono/bin/mod-mono-server4”
#对于openSUSE上的Mono,请取消注释以下行:
MonoServerPath example.com“/usr/bin/mod-mono-server4”
#要获取堆栈跟踪中的行号,需要做两件事:
#1)使用Debug=“true”在页面中启用调试代码生成
#页面指令,或通过
#应用程序的Web.config
#2)取消注释下面的MonoDebug true指令以启用mod_mono调试
#MonoDebug example.com true
#MONO_IOMAP环境变量可以配置为提供平台抽象
#用于Linux中的文件访问。MONO_IOMAP的有效值为:
#案例
#驱力
#全部
#取消对以下行的注释以更改已配置应用程序的文件访问行为
MonoSetEnv example.com MONO_IOMAP=all
#
#可以使用为该服务器实例设置其他环境变量
#MonoSetEnv指令。MonoSetEnv接受“name=value”对的字符串
#用分号分隔。例如,启用平台抽象*和*
#使用Mono的旧正则表达式解释器(速度较慢,但具有
#设置时间更短),请取消注释以下行:
#MonoSetEnv example.com MONO_IOMAP=all;单声道旧声道RX=1
MonoApplications example.com/:/var/www/html”
通融
命令允许,拒绝
MonoSetServerAlias example.com
SetHandler单声道
SetOutputFilter放气
SetEnvIfNoCase请求\u URI“\(?:gif | jpe?g | png)$”无gzip不变
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript
apache.conf
GNU nano 2.2.6 File: apache2.conf
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.
# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
# /etc/apache2/
# |-- apache2.conf
# | `-- ports.conf
# |-- mods-enabled
# | |-- *.load
# | `-- *.conf
# |-- conf-enabled
# | `-- *.conf
# `-- sites-enabled
# `-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
# together by including all remaining configuration files when starting up the
# web server.
#
# * ports.conf is always included from the main configuration file. It is
# supposed to determine listening ports for incoming connections which can be
# customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
# directories contain particular configuration snippets which manage modules,
# global configuration fragments, or virtual host configurations,
# respectively.
#
# They are activated by symlinking available configuration files from their
# respective *-available/ counterparts. These should be managed by using our
# helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
# their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
# the default configuration, apache2 needs to be started/stopped with
# /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
# work with the default configuration.
# Global configuration
#
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE! If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"
#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
Mutex file:${APACHE_LOCK_DIR} default
#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
GNU nano 2.2.6文件:apache2.conf
#这是主要的Apache服务器配置文件。它包含
#为服务器提供指令的配置指令。
#看http://httpd.apache.org/docs/2.4/ 有关
#关于特定于Debian的指令和/usr/share/doc/apache2/README.Debian
#提示。
#
#
#Apache2配置如何在Debian中工作的摘要:
#Debian中的Apache2Web服务器配置与
#upstream建议的配置web服务器的方法。这是因为Debian的
#默认Apache2安装尝试添加和删除模块,
#虚拟主机,以及尽可能灵活的额外配置指令
#以便尽可能轻松地自动化更改和管理服务器
#可能。
#它被分割成几个文件,形成所概述的配置层次结构
#下面的所有文件都位于/etc/apache2/目录中:
#
#/etc/apache2/
#|--apache2.conf
#|`--ports.conf
#|--mods已启用
#| 124;--*.装载
#|`-*.conf
#|--conf已启用
#|`-*.conf
#`--已启用站点
#`-*.conf
#
#
#*apache2.conf是主配置文件(此文件)。它把碎片
#在启动时包括所有剩余的配置文件
#网络服务器。
#
#*ports.conf始终包含在主配置文件中。它是
#应该确定传入连接的侦听端口,这些端口可以
#随时定制。
#
#*mods enabled/、conf enabled/和sites enabled中的配置文件/
#目录包含管理模块的特定配置代码段,
#全局配置片段或虚拟主机配置,
#分别。
#
#它们通过将其上的可用配置文件符号链接来激活
#相应*-可用/副本。这些应该通过使用我们的
#助手a2enmod/a2dismod、a2ensite/a2disconf和a2enconf/a2disconf。看见
#有关详细信息,请参阅各自的手册页。
#
#*二进制文件称为apache2。由于使用了环境变量,在
#默认配置apache2需要使用启动/停止
#/etc/init.d/apache2或apache2ctl。直接调用/usr/bin/apache2不会
#使用默认配置。
#全局配置
#
#
#ServerRoot:目录树的顶部,服务器的
#保留配置、错误和日志文件。
#
#注意!如果要将其放置在NFS(或其他网络)上
#然后请阅读互斥文件系统文档(可用
#at);
#你会省去很多麻烦。
#
#不要在目录路径的末尾添加斜杠。
#
#ServerRoot“/etc/apache2”
#
#接受序列化锁定文件必须存储在本地磁盘上。
#
互斥文件:${APACHE\u LOCK\u DIR}默认值
#
#PidFile:服务器应在其中记录其进程的文件
#识别麻木