[Mono-devel-list] [PATCH] Virtual hosts with mod_mono_server

Adam Chester achester at bigpond.com
Fri Feb 6 04:14:52 EST 2004

RE: 1

Try HybridDictionary

As MSDN states:
"Implements IDictionary by using a ListDictionary while the collection is
small, and then switching to a Hashtable when the collection gets large."


-----Original Message-----
From: mono-devel-list-admin at lists.ximian.com
[mailto:mono-devel-list-admin at lists.ximian.com] On Behalf Of Jaroslaw
Sent: Friday, 6 February 2004 9:00 AM
To: Jaroslaw Kowalski; mono-devel mailing list
Cc: gonzalo at ximian.com
Subject: [Mono-devel-list] [PATCH] Virtual hosts with mod_mono_server

Answering to myself: I've made some research and looks like virtual hosts
can be implemented entirely on the "mod_mono_server" level. I've attached a
patch that does this.

Basically it extends the application specification so that you can include
your vhost parameters.


I've completely rewritten "GetApplicationForPath()" method:

1. I've replaced the hashtable lookup with a linear scan of an array (in
most cases you have only a small number of applications and the performance
of hashtable is poor in this case). For larger installations (e.g. hosting
providers) it may be useful to do something more advanced (hashing or binary
search) so that the method scales better, but I'm not sure if it's worth it.

2. I've eliminated all allocations from this method (there were actually a
lot of them in String.Join() and String.Split()). Instead of splitting and
re-joining strings I'm simply looking for an entry with the longest matching
prefix. This is easily done with StartsWith() which afaik doesn't allocate

3. My patch allows two "vpaths" to point to a single physical directory and
run two different applicationhosts there.

4. There are some TODOs - basically related to retrieving information from
the HTTP headers (port and host) but I don't have time and knowledge to dig
into it as it looks to be apache-dependent.

Can someone verify the patch, fix the TODOs and commit if it's ok? I've got
only anoncvs access and this patch was made against today's fresh copy.


----- Original Message -----
From: "Jaroslaw Kowalski" <jaak at zd.com.pl>
To: "mono-devel mailing list" <mono-devel-list at lists.ximian.com>
Sent: Thursday, February 05, 2004 10:01 PM
Subject: [Mono-devel-list] Virtual hosts with mod_mono_server

> Is it possible to run multiple ASP.NET applications with mod_mono when
> apache is configured for name-based virtual hosts? The applications are to
> be located the vhost root.
> http://sitea.net/index.aspx
> http://siteb.net/index.aspx
> Do I need multiple mod_mono_server.exe's?
> Jarek
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list

More information about the Mono-devel-list mailing list