From: Loren C. <lor...@gm...> - 2010-02-09 20:56:54
|
To add the server name to the jetty request logs (tools/jetty/logs/*), you need to add a parameter to the jetty.xml in the trunk branch only: <Ref id="RequestLog"> <Set name="requestLog"> <New id="RequestLogImpl" class="org.eclipse.jetty.server.NCSARequestLog"> <Set name="filename"><SystemProperty name="jetty.home" default="."/>/logs/yyyy_mm_dd.request.log</Set> <Set name="filenameDateFormat">yyyy_MM_dd</Set> <Set name="retainDays">90</Set> <Set name="append">true</Set> <Set name="extended">true</Set> <Set name="logCookies">false</Set> <Set name="LogTimeZone">GMT</Set> <Set name="LogServer">true</Set> </New> </Set> </Ref> This will only work on the trunk, because that parameter can only be set under Jetty7. It adds the server name on the request at the beginning of the logfile entry before the ip address of the requesting computer. I also change the extended parameter to true, because that gives the referring URL and the browser agent information in the log file. This supplies a great deal of information for web statistics such as awstats. On Feb 9, 2010, at 01:56 PM, Loren Cahlander wrote: > There is an option (off of trunk version 11177) now to send web queries to different collections within eXist based on the server name in the URL: > > i.e. > With the following configuration changes in controller-config.xml > > from: > <root pattern=".*" path="/"/> > > to: > <root server-name="site1.example.com" pattern="/*" path="xmldb:exist:///db/org/site1/"/> > <root server-name="site2.example.com" pattern="/*" path="xmldb:exist:///db/org/site2/"/> > <root server-name="site3.example.com" pattern="/*" path="xmldb:exist:///db/org/site3/"/> > <root server-name="localhost" pattern=".*" path="/"/> > <root server-name="site4.example.com" pattern=".*" path="/"/> > > http://site1.example.com/ would be redirected to /db/org/site1 > http://site2.example.com/ would be redirected to /db/org/site2 > http://site3.example.com/ would be redirected to /db/org/site3 > http://localhost/ would be directed to index.xml in the webapp directory as it is normally done. > http://site4.example.com/ would be directed to index.xml > > NOTE: The server-name attribute is optional. If it is omitted, then the behavior operates as normal. > > This will allow for the hosting of multiple websites in one eXist instance. > > I still need to work on the jetty configuration, so that the logs for each individual website can be separated out from the other websites. |