[Mono-list] mod_mono and userdir

Eran Sandler Eran.Sandler@smarteam.com
Thu, 13 Mar 2003 12:36:34 +0200


Actually there are keys in the machine.config at the part of the =
configuration section definition that says what the scope for a key is.

Http Modules and Http Handlers can only be defined in a web.config =
(according to the .NET documentation), meaning, per application.

I wanted the URL rewrite configuration will be more than just a find =
regular expression and replacing it with another.=20

Perhaps it will require other things as well. That is why I think that =
we should have a hook that a developer can put his own logic in there. =
In addition to that we can implement a standard configurable =
implementation for that hook that searches for a regular expression and =
return some kind of a formula on it.

Eran

-----Original Message-----
From: Steinar Herland [mailto:steinar.herland@gecko.no]=20
Sent: Thursday, March 13, 2003 12:04 PM
To: Eran Sandler; Daniel Lopez; mono-list@ximian.com
Subject: SV: [Mono-list] mod_mono and userdir

Web.Config settings are resolved in a interesting way:=20
If a folder contains a Web.Config file with the requested parameter, =
that setting is used. If the file or setting is missing, its trying the =
parent folder, and so on. If the setting is not found in any Web.Config =
files, the setting is loaded from (I think) Machine.Config. This means =
it should be possible to just update Machine.Config or the "top-level" =
Web.Config.

Also, if the url-rewriting-logic should be configurable, where is the =
most natural place to put it?  I would say... Web.Config. :-)

Steinar


-----Opprinnelig melding-----
Fra: Eran Sandler [mailto:Eran.Sandler@smarteam.com]=20
Sendt: 13. mars 2003 07:01
Til: Steinar Herland; Daniel Lopez; mono-list@ximian.com
Emne: RE: [Mono-list] mod_mono and userdir

An apache module will hide this kind of functionality from the user. An =
HttpModule must be registered in the web.config file, thus forcing every =
application that needs to handle this to add that line.

Putting this code at the Apache module level removes the need to add the =
configuration to the web.config file.
After all, it seems logical that in Windows almost no one will use it =
and if they do it will be in a very different way.

Why make them some extra job of removing lines from the web.config?
After all, it is not imperative to have such functionality in Windows =
(even on Apache on Windows).

Regarding the path parser, it is a good idea to use a regular expression =
and perhaps even allow writing a 3rd party add-on to enable very smart =
parsing of the URL (if it will be needed).

I think that it is important to implement multiple paths per Application =
Host. This kind of behavior will probably be required by users that will =
be familiar with IIS 6.=20

It might also be necessary to allow the host to run on a different user =
(if this it is possible). For enhanced security we will need to run the =
host on different credentials so the Application Host we have very =
limited access to resources.

Eran


-----Original Message-----
From: Steinar Herland [mailto:steinar.herland@gecko.no]=20
Sent: Wednesday, March 12, 2003 9:33 PM
To: Eran Sandler; Daniel Lopez; mono-list@ximian.com
Subject: SV: [Mono-list] mod_mono and userdir

If it's HttpModule or an Apache module "doesn't matter". The request =
will have to be handled / rewritten on every request anyway.

I believe a HttpModule is preferred because it's a pure C# solution, and =
because of the simplicity:

if(Request.Path.IndexOf("~")>0){  //Use a RegEx here?
	//Do something
	HttpContext.Current.RewritePath("MyNewPath");
}
//Done...

Steinar

-----Opprinnelig melding-----
Fra: Eran Sandler [mailto:Eran.Sandler@smarteam.com]=20
Sendt: 12. mars 2003 16:17
Til: Daniel Lopez; mono-list@ximian.com
Emne: RE: [Mono-list] mod_mono and userdir

Hi Daniel,
=A0
You can write an HttpModule that upon initalization hooks to the =
BeginRequest event and it can parse the request URL and perform server =
redirect or directly write to the response.
=A0
I've done such things for different reasons (not the ones that you want) =
but you should bare in mind that on EVERY request that comes to that =
application it will pass through your module so except a decrease in =
performance.
=A0
I think you should try to resolve it at the apache module level. Perhaps =
by doing what I have suggested in my previous post (I'm not sure how to =
do that since I don't know Apache that well).
=A0
If you can redirect a request at the Apache=A0module level it seems like =
the most reasonable place to do that.
=A0
Eran
-----Original Message-----=20
From: Daniel Lopez [mailto:daniel@rawbyte.com]=20
Sent: =E3 12/03/2003 14:55=20
To: mono-list@ximian.com=20
Cc:=20
Subject: Re: [Mono-list] mod_mono and userdir

Yes, I already looked at the HttpApplication events and in the =
System.Web
namespace and could not find a path resolve event? Should I be looking
somwehre else?
The current place I am thinking on hooking is in BeginRequest

> There is a event that is called during path resolve, that could =
resolve that
> path into another physical path (just change it). I don't have time to =
make
> a poc now but take a look in MSDN.
>
> Cheers,
>=A0 Patrik
>
> > -----Original Message-----
> > From: Daniel Lopez [mailto:daniel@rawbyte.com]
> > Sent: Wednesday, March 12, 2003 12:35 PM
> > To: mono-list@ximian.com
> > Subject: [Mono-list] mod_mono and userdir
> >
> >
> >
> > I believe part of what I want can be accomplished with
> >
> > HttpContext.RewritePath()
> >
> > Not currently implemented in Mono, I=B4ll look into implementing it.
> > This can then be called from an HttpModule
> >
> > Cheers
> >
> > Daniel
> > _______________________________________________
> > Mono-list maillist=A0 -=A0 Mono-list@lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-list
> >
_______________________________________________
Mono-list maillist=A0 -=A0 Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list
_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list