簡體   English   中英

在Mono Linux下運行ASP.net

[英]Running ASP.net under Mono Linux

我目前正在研究將Web服務器從Windows更改為Linux。 我目前在我的網站上運行一個asp.net程序,我想嘗試使其在Linux下以單聲道運行。

我已將所有文件從Windows服務器復制到測試Linux服務器,但是當我嘗試訪問該頁面時,出現以下錯誤:

無法識別的屬性'requestValidationMode'(/srv/www/htdocs/mywebsitedirectory/web.config

以下是web.config文件的副本

<?xml version="1.0" encoding="UTF-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>

    <connectionStrings>
  <add name="DownloadManagerDB" connectionString="Server=localhost;Port=3306;Database=downloads;Uid=public;Pwd=54mCuw90;pooling=false;" providerName="MySql.Data.MySqlClient" />
 </connectionStrings>
    <system.web>
    <customErrors mode="Off" />
    <httpRuntime requestValidationMode="2.0" maxRequestLength="16384" />
        <compilation debug="true" targetFramework="4.0">
            <assemblies>
                <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
                <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /></assemblies></compilation>
        <authentication mode="Forms">
            <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
        </authentication>
        <membership>
            <providers>
                <clear />
                <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
            </providers>
        </membership>
        <profile>
            <providers>
                <clear />
                <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
            </providers>
        </profile>
        <roleManager enabled="false">
            <providers>
                <clear />
                <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
                <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
            </providers>
        </roleManager>
    </system.web>
    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true" />
        <defaultDocument>
            <files>
                <clear />
                <add value="index.aspx" />
                <add value="Default.htm" />
                <add value="Default.asp" />
                <add value="index.htm" />
                <add value="default.aspx" />
                <add value="index.html" />
                <add value="iisstart.htm" />
                <add value="index.php" />
            </files>
        </defaultDocument>
    </system.webServer>
</configuration>

似乎在錯誤頁面上,當Mono實際設置為.net 4時,Mono認為其asp.net版本2。我使用的是Mono版本2.10.6,它表示它支持.net 4。

感謝您的任何幫助,您可以提供。

更新:運行ps auxwww | grep mono輸出ps auxwww | grep mono ps auxwww | grep mono

wwwrun 12029 0.0 0.8 48800 8100? Ssl 19:55 0:00 / usr / bin / mono /usr/lib/mono/2.0/mod-mono-server2.exe --filename / tmp / mod_mono_server_global --onstop --master根目錄12177 0.0 0.0 2524 768 pts / 1 S + 20:04 0:00 grep --color =自動單色

就像@Eugen Rieck指出的那樣,您需要配置mod-mono-server4而不是server2。

在這篇文章之后,

http://docs.orchardproject.net/Documentation/Running-Orchard-on-Mono?Code=1

您應該轉到Apache設置,並將MonoServerPath更改為/ usr / bin / mod-mono-server4(或包裝盒上的有效路徑),然后可以再次測試以查看是否可以正確處理此屬性。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM