lua-users home
lua-l archive

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


On Monday 01 August 2005 7:05 am, Mukhsein Johari wrote:
> Hello all,
>
> I sent an earlier email about xavante configuration but it did not
> seem to get into the mailing list. I'm sending another email here.

it did got here, but found me at a busy time, and i think andre is still 
somewhere else.

> My question / request is how do I run another (user) instance of
> xavante running on non-privileged port. There's a configuration option
> to set the [web] dir but not the [conf] dir in server_start.lua

there's no 'config dir'; the start() function in server.lua does a 
pcall(require, "xavante.config").  you can put any lua code in 
xavante/config.lua, for example, it can load another config file anywhere 
else you want.

and for creating several instances, you can choose between running several 
separate processes, or calling xavante.HTTP{} several times:

xavante.HTTP{
    server = {host = "*", port = 4080},
    
    defaultHost = {
    	rules = rulesetA
    },
}

xavante.HTTP{
    server = {host = "*", port = 4082},
    
    defaultHost = {
    	rules = rulesetB
    },
    ["web2"] = {
	rules = rulesetC
    }
}

here, we have three 'instances' one in port 4080, and two in port 4082.  in 
the second port, it uses 'virtual servers' to discriminate, based on the 
server name used in the queries.

BTW, i don't like the 'setwebdir' methodology.  all it does is define what 
xavante.webdir() will return, so it can be used in the config file; but it's 
(for me, at least) just as easy to set baseDir in the rulesets.

-- 
Javier

Attachment: pgp3F2P_ab8kY.pgp
Description: PGP signature