Wie kann ich ASP.NET unter CentOS 7 auf Apache ausführen lassen?

4937
Jürgen Bayer

Ich habe erfolgreich Apache, Mono, XSP Server und MonoDevelop auf einem CentOS 7-Rechner installiert. Grundsätzlich folge ich http://www.mono-project.com/docs/getting-started/install/linux/#centos-fedora-and-derivatives ( mit hinzugefügtem yum install -y xspund yum install -y monodevelopMono Develop funktioniert und ich kann damit ASP.NET-Websites erstellen und ausführen (über XSP-Server).

Aber ich muss Mono mit Apache integrieren. Dazu habe ich installiert mod_mono( yum install -y mod_mono) und eine Konfiguration für eine Testanwendung über http://go-mono.com/config-mod-mono/ erstellt . Ich habe die Mono-Server-Version auf 4 geändert und die Erlaubnis zum offenen Zugriff hinzugefügt:

Alias /mono-test "/srv/www/mono-test" MonoServerPath mono-test "/usr/bin/mod-mono-server4" MonoDebug mono-test true MonoApplications mono-test "/mono-test:/srv/www/mono-test" <Location "/mono-test"> Allow from all Order allow,deny MonoSetServerAlias mono-test SetHandler mono SetOutputFilter DEFLATE SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip dont-vary # Allow open access: Require all granted </Location>  <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript </IfModule> 

Ich habe die Datei /etc/httpd/confdmit dem Namen x-mono-test.confeingefügt, um sicherzustellen, dass sie nach der Standardeinstellung geladen wird mod_mono.conf(Inhalt siehe am Ende dieser Frage).

Das Problem ist, dass der Zugriff auf eine Test-Aspx-Datei in der Apache-Anwendung ( http: //localhost/mono-test/test.aspx ) zu einem HTTP 503-Dienst führt, der nicht verfügbar ist. Das Apache-Fehlerprotokoll bleibt leer.

Ich würde gerne wissen, was falsch sein könnte oder wie ich die Ursache dieses Problems finden könnte.

Inhalt von mod_mono.conf:

<IfModule !mod_mono.c> LoadModule mono_module /usr/lib64/httpd/modules/mod_mono.so </IfModule>  <IfModule mod_headers.c> Header set X-Powered-By "Mono" </IfModule>  AddType application/x-asp-net .aspx AddType application/x-asp-net .asmx AddType application/x-asp-net .ashx AddType application/x-asp-net .asax AddType application/x-asp-net .ascx AddType application/x-asp-net .soap AddType application/x-asp-net .rem AddType application/x-asp-net .axd AddType application/x-asp-net .cs AddType application/x-asp-net .vb AddType application/x-asp-net .master AddType application/x-asp-net .sitemap AddType application/x-asp-net .resources AddType application/x-asp-net .skin AddType application/x-asp-net .browser AddType application/x-asp-net .webinfo AddType application/x-asp-net .resx AddType application/x-asp-net .licx AddType application/x-asp-net .csproj AddType application/x-asp-net .vbproj AddType application/x-asp-net .config AddType application/x-asp-net .Config AddType application/x-asp-net .dll DirectoryIndex index.aspx DirectoryIndex Default.aspx DirectoryIndex default.aspx 
0

1 Antwort auf die Frage

1
Juan Acosta

Ich denke, du vermisst einen Satz in der Konfiguration von Apache mit Mono. Ich empfehle Ihnen dringend, diese Anleitung für Ubuntu zu prüfen. Ich habe es versucht und es funktioniert gut mit Xsp und Apache. Ich teste einige Beispiele und arbeite gut für alles außer WCF (svc). Anscheinend unterstützt das immer noch mit vielen Problemen in Mono 2.10.

http://www.bgsoftfactory.net/run-asp-net-mvc-4-with-mysql-on-linux/

Ich denke, das Problem könnte sein, dass der virtuelle Host nicht aktiv ist. Aber das ist eine einfache Vermutung.

Dies ist wirklich ein Kommentar und keine Antwort auf die ursprüngliche Frage. Hinterlassen Sie einen Kommentar oder Kommentar zu einem Autor, und hinterlassen Sie einen Kommentar unter dem Beitrag. Sie können jederzeit Ihre eigenen Beiträge kommentieren. Sobald Sie über ausreichend [Ruf] (http://superuser.com/help/whats-reputation) verfügen, werden Sie dies tun [kommentieren Sie jeden Beitrag] (http://superuser.com/help/privileges/comment). Bitte lesen Sie [Warum brauche ich 50 Reputation, um einen Kommentar abzugeben? Was kann ich stattdessen tun?] (Https://meta.stackexchange.com/a/214174) DavidPostill vor 7 Jahren 0
Wenn jemand an WCF in Linux arbeitet. Ich empfehle nachdrücklich, dieses Projekt zu überprüfen. Https://github.com/dotnet/wcf Es befindet sich derzeit in der Entwicklung und es arbeiten ständig mehrere Personen zusammen. Juan Acosta vor 7 Jahren 0