paperclips-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Paperclips-discuss] configuring the server


From: Nic Ferrier
Subject: [Paperclips-discuss] configuring the server
Date: 13 Feb 2002 01:05:14 +0000

It's easy and convieniant to start Paperclips from the command line
but there is still a need to have a configuration file for starting
the server.

A configuration file can express a lot more than a command line,
which is really only good at expressing the most usual setups.

I'm just working out how I want to express a server configuration. On
one hand I'm thinking of things that would be nice to have
and on the other hand I'm thinking of how I'd implement it with
Paperclips.

This is a rough draft of what I've got:


<server>

    <!-- only a server can have a tcp port setup.
         More than one can be declared though. -->
    <tcp port="80"/>

    <!-- specify the path where all wars will be found -->
    <warpath path="/var/local/wars:/home/nferrier/wars" />

    <!-- define the host for www.tapsellferrier.co.uk -->
    <host>

        <!-- logging of host stuff will go to stdout -->
        <log>
            <file name="1"/>
        </log>


        <!-- this maps the root webapp to a FileServer serving file
             from the specified directory. -->
        <mapping pattern="/">
            <file-dir "/var/local/www" />
        </mapping>


        <!-- this maps a real webapp to the /accounting context path -->
        <mapping pattern="/accounting">
            <web-app name="accounts.war" unpack>

                <!-- over ride the jdbc context parameter for the web app -->
                <context-param>
                    <param-name>jdbc-source</param-name>
                    
<param-value>jdbc:postgres:acc-db.tapsellferrier.co.uk:6100</param-value>
                </context-param>

            </web-app>
        </mapping>         

    </host>


    <!-- define a virtual host webapp.
         The virtual host will recieve only the http requests
         addressed to that host (ie: the ones with the HTTP "host"
         header). -->
    <host name="www.alphamail.com">

        <!-- the class nic.SpecialLogger will be wrapped around
             stdout. 
             If the class is not a PrintWriter the host won't start. -->
        <log>
            <file name="1"/>
            <class name="nic.SpecialLogger"/>
        </log>

        <!-- map the root context to a webapp -->
        <mapping pattern="/">
            <web-app name="alpha-mail.war" unpack>
                <context-param>
                    <param-name>mail-host</param-name>
                    <param-value>imap01.tapsellferrier.co.uk</param-value>
                </context-param>
            </web-app>
        </mapping>

    </host>
        
</server>


This would require a substantial change to the HTTPHost class because
currently it is not capable of expressing virtual hosts in a
heirarchial way.

However, I think the change is necessary so I'm prepared to make it.

Does anybody else have any thoughts?



Nic



reply via email to

[Prev in Thread] Current Thread [Next in Thread]