设置ModMono用的Apache2 [英] Setting up ModMono With Apache2

查看:195
本文介绍了设置ModMono用的Apache2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我结束了在尝试安装ASP与ModMono上的Apache2,通过这个指南。

I ended up attempting to setup ASP with ModMono on Apache2, via following this guide.

它不工作然而,:当我点击一个.aspx文件,我最终只是下载它在我的本地

It's not working, however: when I click a .aspx file, I end up just downloading it on my localhost.

下面是我的asp.webapp文件/ etc /单服务器2

Here's my asp.webapp file /etc/mono-server2

<apps>
    <web-application>
        <name>asp</asp>
        <vpath>/asp</vpath>
        <path>/var/www/asp/</path>
        <vhost>127.0.0.1</vhost>
    </web-application>
</apps>

在我的ASP文件/ etc / apache2的/网站的可用/

and my asp file in /etc/apache2/sites-available/

<Virtualhost 127.0.1.1:80>
    ServerName asp

    DocumentRoot /var/www/asp/

    <Directory /var/www/asp/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow, deny
        Allow from all 
        SetHandler mono
        DirectoryIndex index.aspx index.html
    </Directory>
</VirtualHost>

这有什么,我做错了吗?我能想到的唯一的问题是,我想引用一个目录,而不是特定网页或文件。

Is there anything which I'm doing wrong here? The only issue I can think of is that I'm trying to reference a directory, rather than a specific page or file.

推荐答案

如果您已经安装的是mod_mono并且正确配置Apache2的工作,那么所有你需要做的是改变在/ etc / apache2的/站点现场配置 - 可选/的东西是这样的:

If you have installed mod_mono and it is configured correctly to work with apache2 then all you will need to do is change your site configuration in /etc/apache2/sites-available/ to something like this:

<Virtualhost 127.0.1.1:80>
ServerName asp
DirectoryIndex index.html index.aspx
DocumentRoot /var/www/asp/

AddMonoApplications asp "/:/var/www/asp"
MonoServerPath asp "/usr/bin/mod-mono-server2"

<Directory /var/www/asp/>
    MonoSetServerAlias asp
    SetHandler mono
    AddHandler mod_mono .aspx .ascx .asax .ashx .config .cs .asmx
     <FilesMatch "\.(gif|jp?g|png|css|ico|xsl|wmv|zip)$">
        SetHandler None
    </FilesMatch>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow, deny
    Allow from all 
    SetHandler mono
    DirectoryIndex index.aspx
</Directory>

这篇关于设置ModMono用的Apache2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆