Pages : 1
#1 Le 04/10/2006, à 11:10
- maximusperchus
Problème Apache 2 et mod_mono
Avant toute chose, je sais bien que c'est marrant mais pas la peine de venir troller sur ASP.Net je suis conscient que .Net sous linux c'est pas top mais je fais au mieux.
Etant nouvellement converti a ubuntu, je me suis dis qu'il serais temps de me mettre a apache 2 (pasque bon le 1.3 est pas top) et pourquoi pas de faire fonctionner quelques pages asp.net ^^.
(il faut dire que le tuto https://help.ubuntu.com/community/ModMono m'a un peu poussé a le faire )
donc j'ai suivit le tuto, chargé le mod_mono sur apache 2 , mis un SetHandler mono dans la balise directory de mon default virtual host etc....
enfin bref voila mon drame :
http://blog-mp.mp-foundry.com/ au passage on remarque sur le 404 que le module apache est bien chargé
et puis
http://blog-mp.mp-foundry.com/index.aspx
et pourtant le mod_mono.conf renseigne bien les ajouts du nouveau type mime
A mon avis le pb viens plus d'apache quautre chose .... mais j'ai pas trop envie de me retapper une install complete donc si qqun sait d'ou ca pourrais venir ....
Hors ligne
#2 Le 05/10/2006, à 16:23
- maitredede
Re : Problème Apache 2 et mod_mono
Salut
Je te poste cette réponse car je suis arrivé à quelque chose d'un peu mieux, mais qui n'est toujours pas fonctionnel :
Je cherche à mettre en place sous ubuntu server (6.06) un apache2 avec mono pour faire tourner de l'asp.net2.
Installation :
J'ai suivi le même tuto que toi : https://help.ubuntu.com/community/ModMono
Voici comment ça c'est passé pour moi :
Etape 1 : installation des packages sans soucis
Etape 2 : activation du module OK (erreur : module déjà activé)
Etape 3 : choix de la version d'asp.net => activation d'asp.net2
/etc/apache2/mods-available/mod_mono.conf
#Include /etc/mono-server/mono-server-hosts.conf
Include /etc/mono-server2/mono-server2-hosts.conf
Etape 4 : sautée, je passe par les directives apache
Etape 5 : Redémarrage de la machine
J'ai installé le module mono-xsp2 pour tester mon site sans passer par Apache.
Le site
J'ai testé avec un fichier index.aspx tout simple : un click sur un bouton rempli un textbox avec la date actuelle.
Deux versions de mon site : une avec le code source, une avec le code compilé.
J'ai développé et compilé sous Visual Studio 2005.
La version source est située dans /var/aspsrc
La version compilée est dans /var/aspbin
Les tests
En ligne de commande, en lançant xsp2, les deux versions fonctionnent :
xsp2 --port 82 --root /var/aspsrc/
xsp2 --port 82 --root /var/aspbin/
Voici les morceaux de ma config apache que j'ai ajouté :
Alias /aspsrc "/var/aspsrc"
AddMonoApplications aspsrc "/aspsrc:/var/aspsrc"
<Location /aspsrc>
MonoSetServerAlias aspsrc
SetHandler mono
</Location>
Alias /aspbin "/var/aspbin"
AddMonoApplications aspbin "/aspbin:/var/aspbin"
<Location /aspbin>
MonoSetServerAlias aspbin
SetHandler mono
</Location>
Après redémarrage de la machine (chuis pas à ça près ), j'appelle les différentes url suivantes (sous Firefox 2, WinXP) :
http://130.1.201.129/aspsrc/index.aspx
Server Error in '/aspsrc' Application
Parser Error
Description: Error parsing a resource required to service this request. Review your source file and modify it to fix this error.
Error message: Cannot find type index
File name: /var/aspsrc/index.aspx Line: 1
Source Error:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="index" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
http://130.1.201.129/aspsrc
Me propose de télécharger le fichier du type 'application/x-asp-net' (sans plus d'infos)
http://130.1.201.129/aspbin/ ou http://130.1.201.129/aspbin/index.aspx
Server error in '/aspbin' application
File not found
Description: Error processing request.
Error Message: HTTP 404. File not found
Stack Trace:
System.IO.FileNotFoundException: /tmp/www-data-temp-aspnet-0/c4e902f5/7c1bc45d.dll : /tmp/www-data-temp-aspnet-0/c4e902f5/7c1bc45d.dll
in <0x00000> <unknown method>
in (wrapper managed-to-native) System.Reflection.Assembly:LoadFrom (string,bool)
in <0x0000c> System.Reflection.Assembly:LoadFrom (System.String assemblyFile)
in <0x003c0> Mono.CSharp.CSharpCodeCompiler:CompileFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames)
in <0x00022> Mono.CSharp.CSharpCodeCompiler:CompileAssemblyFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames)
in <0x00305> Mono.CSharp.CSharpCodeCompiler:CompileFromDomBatch (System.CodeDom.Compiler.CompilerParameters options, System.CodeDom.CodeCompileUnit[] ea)
in <0x00022> Mono.CSharp.CSharpCodeCompiler:CompileAssemblyFromDomBatch (System.CodeDom.Compiler.CompilerParameters options, System.CodeDom.CodeCompileUnit[] ea)
in <0x0003c> Mono.CSharp.CSharpCodeCompiler:CompileAssemblyFromDom (System.CodeDom.Compiler.CompilerParameters options, System.CodeDom.CodeCompileUnit e)
in <0x00121> System.Web.Compilation.CachingCompiler:Compile (System.Web.Compilation.BaseCompiler compiler)
in <0x00259> System.Web.Compilation.BaseCompiler:GetCompiledType ()
in <0x000fa> System.Web.Compilation.AspGenerator:GetCompiledType ()
in <0x00029> System.Web.UI.PageParser:CompileIntoType ()
in <0x00011> System.Web.UI.TemplateControlParser:GetCompiledInstance ()
in <0x00035> System.Web.UI.PageParser:GetCompiledPageInstance (System.String virtualPath, System.String inputFile, System.Web.HttpContext context)
in <0x00010> System.Web.UI.PageHandlerFactory:GetHandler (System.Web.HttpContext context, System.String requestType, System.String url, System.String path)
in <0x001e3> System.Web.HttpApplication:GetHandler (System.Web.HttpContext context)
in <0x00894> System.Web.HttpApplication+<Pipeline>__1:MoveNext ()
Voilà
Le module server-info me donne quelques précisions. Pour l'activer dans apache2 :
<Location /server-info>
SetHandler server-info
Order deny,allow
Deny from all
Allow from all
</Location>
Les infos relatives à mod_mono :
Module Name: mod_mono.c
Content handlers: yes
Configuration Phase Participation: Create Directory Config, Create Server Config, Merge Server Configs
Request Phase Participation: none
Module Directives:
MonoUnixSocket - Named pipe file name. Mutually exclusive with MonoListenPort. Default: /tmp/mod_mono_server
MonoListenPort - TCP port on which mod-mono-server should listen/is listening on. Mutually exclusive with MonoUnixSocket. When this options is specified, mod-mono-server and mod_mono will use a TCP socket for communication. Default: none
MonoListenAddress - IP address where mod-mono-server should listen/is listening on. Can only be used when MonoListenPort is specified.Default: "127.0.0.1"
MonoRunXSP - It can be False or True. If it is True, asks the module to start mod-mono-server.exe if it's not already there. Default: True
MonoExecutablePath - If MonoRunXSP is True, this is the full path where mono is located. Default: /usr/bin/mono
MonoPath - If MonoRunXSP is True, this will be the content of MONO_PATH environment variable. Default: ""
MonoServerPath - If MonoRunXSP is True, this is the full path to mod-mono-server.exe. Default: /usr/lib/pkgconfig/../../lib/xsp/1.0/mod-mono-server.exe
MonoApplications - Comma separated list with virtual directories and real directories. One ASP.NET application will be created for each pair. Default: ""
MonoWapiDir - The directory where mono runtime will create the '.wapi' directory used to emulate windows I/O. It's used to set MONO_SHARED_DIR. Default value: "/tmp"
MonoDocumentRootDir - The argument passed in --root argument to mod-mono-server. This tells mod-mono-server to change the directory to the value specified before doing anything else. Default: /
MonoApplicationsConfigFile - Adds application definitions from the XML configuration file. See Appendix C for details on the file format. Default value: ""
MonoApplicationsConfigDir - Adds application definitions from all XML files found in the specified directory DIR. Files must have '.webapp' extension. Default value: ""
MonoMaxMemory - If MonoRunXSP is True, the maximum size of the process's data segment (data size) in bytes allowed for the spawned mono process. It will be restarted when the limit is reached. Default value: system default
MonoMaxCPUTime - If MonoRunXSP is True, CPU time limit in seconds allowed for the spawned mono process. Beyond that, it will be restarted. Default value: system default
MonoDebug - If MonoDebug is true, mono will be run in debug mode. Default value: False
MonoSetEnv - A string of name=value pairs separated by semicolons.For each pair, setenv(name, value) is called before running mod-mono-server. Default value: Default: ""
AddMonoApplications - Appends an application.
MonoSetServerAlias - Uses the server named by this alias inside this Directory/Location.
MonoAutoApplication - Disables automatic creation of applications. Default value: 'Disabled' if there's any other application for the server. 'Enabled' otherwise.
Current Configuration:
MonoUnixSocket /tmp/.mod_mono_server2
MonoServerPath /usr/lib/xsp/2.0/mod-mono-server2.exe
MonoApplicationsConfigDir /etc/mono-server2
MonoPath /usr/lib/mono/2.0:/usr/lib:/usr/lib/mono/2.0
AddMonoApplications default "/samples:/usr/share/asp.net2-demos"
AddMonoApplications aspsrc "/aspsrc:/var/aspsrc"
<Location /aspsrc>
MonoSetServerAlias aspsrc
</Location>
AddMonoApplications aspbin "/aspbin:/var/aspbin"
<Location /aspbin>
MonoSetServerAlias aspbin
</Location>
Si quelqu'un a une idée...
Hors ligne
#3 Le 06/10/2006, à 15:44
- maximusperchus
Re : Problème Apache 2 et mod_mono
merci pour ton poste ca me montre qu'au moins je ne suis pas le seul a lutter ....
en plus je suis dégouté .... j'ai cru avoir reussit mon install un moment
mais en fait c'etais soit un bug de vista(l'os sur lequel je taffe) , soit de la WINSDK soit de c#.Net 3.... toujours est il que le fichier aspx de mon serveur était non pas interprété par mon serveur web mais par le client (Internet explorer 7)
Enfin bref je suis completement blasé là.
Du coup je vais tenter une nouvelle installation de ma 6.06
Hors ligne
#4 Le 09/10/2006, à 11:08
- maitredede
Re : Problème Apache 2 et mod_mono
Arf la vieille méthode Windows : quand ça marche pu, format + install...
Perso, j'ai trouvé une bonne solution : vmware... Vive les snapshots !!!
Ca m'a permis de jouer avec la config et de facilement revenir en arrière.
Bon, une solution serai de faire tourner un XSP2 en arrière-plan, et en utilisant le mod_proxy d'Apache. La FAQ Mono ASP.NET :
- http://mono-project.com/FAQ:_ASP.NET#Sh … _or_XSP.3F
- http://mono-project.com/FAQ:_ASP.NET#mo … _mod_proxy
La doc de mod_proxy :
- http://httpd.apache.org/docs/2.0/mod/mod_proxy.html
C'est pas propre, c'est pas top, c'est pas rapide, mais ça marche...
Hors ligne
Pages : 1