[Pkg-mono-devel] What mono-hostmanager is

Pablo Fischer pablo@pablo.com.mx
Sun, 22 Feb 2004 15:15:31 -0600


Hi!

Sorry to don't tell anybody about mono-hostmanager, I was going to tell
this after the mono-hostmanger package be ready, but damn..

Ok, mono-hostmanager is a very little app to manage a 'host file' for
the XSP (or Mod-mono-server). 

What mono-hostmanger do, is add hosts (with their alias and path) and
remove them. The way that the config file is, is in XML format:

<VirtualHosts>
 <Hosts>
  <Host>
   <path>/path/of/my/foo/bar/aspapp</path>
   <alias>/mialias</alias>
  </Host>
 </Hosts>
</VirtualHosts>

I wrote the app in C#, it uses Serialize and Deserializer methods to
work with the XML struct.

An example of it:

mono-hostmanager add --config-file=/etc/xsp/virtual.conf
--alias=/monodoc --path=/usr/share/monodoc

This will add a Host to the virtual.conf file with the alias monodoc
that is pointing to /usr/share/monodoc.

To remove it, you just need to change the 'add' action to 'del'.

Also, to print the content of the file in the 'format' that
xsp/mod-mono-server understands is: 

mono-hostmanager print

Why this?, I think that the previous virtual.conf was uglier and with
lot of bugs.

Does xsp or mod-mono-server already do this?

Yes and no. Today no, today you need to write in the command line the
hosts (path and alias) that xsp (for example) needs to read:

xsp --applications
/monodoc:/usr/share/monodoc,/aspexamples:/usr/share/asp.net-examples/asp, etc,etc..

I also talked with Gonzalo (the main developer of xps and
mod-mono-server) and he told me that it (the idea and script) will be
available in the future, and the file will be mod-mono-server.conf
(google can give and idea of the file), but today we need to write ALL
the hosts in the command line.

That is the reason of why I wrote mono-hostmanager. 

Before the 'new concept' of mono-hostmanger I was working with a stupid
file in bash, that takes values from a virtual.conf in the format:

/alias:/path
/alias2:/path2

But I was also having problems adding/removing hosts.

I also wrote it cause I don't need that there will be just one host
package (asp.net-examples) in all the live of the Debian Mono Packages,
if somebody thinks it... no comments.

And as I said, I wrote it cause I thought it was usefull for me to
manage the hosts of xsp and mod-mono-server, so, if most somebody thinks
this is not necesary I could remove it, but don't lame if in the future
we need to maintain 10 hosts.

See ya!
Pablo
-- 
Pablo Fischer Sandoval (pablo [arroba/at] pablo.com.mx)
http://www.pablo.com.mx
http://www.debianmexico.org