A work-around which we use is to set the user.home property. This can be done via -Duser.home= on the JVM command line when starting the BaseX server.
For the library implementation, it can be done before the first access to any basex class, like shown in this example, which instructs BaseX to use a .basex directory in a Webapp container.
public static void initialize(ServletContext servletContext) { // trick BaseX into reading its configuration from the WEB-INF directory // by temporarily redirecting user.home property. String basexdir = servletContext.getRealPath("WEB-INF"); String oldUserHome = System.getProperty("user.home"); System.setProperty("user.home", basexdir); if (!org.basex.core.Prop.HOME.startsWith(basexdir)) throw new java.lang.Error("BaseX property initialization failed"); System.setProperty("user.home", oldUserHome); }
On Mon, Dec 13, 2010 at 10:32 AM, Huib Verweij Huib.Verwey@mpi.nl wrote:
Hi,
I would like to install BaseX on a server. So far I've installed it on my dev machine and on a test server under my account, but now we are moving to a server where BaseX will just be started by a script or something and run in a folder which is not anyones home folder. The problem I think there will be is that BaseX takes it's configuration information always from ~/.basex, which will not work in our server setup I assume.
Am I correct in assuming this will cause headaches for our sysadmin or am I missing something?
Will 6.5 change this situation where the config file is always read from Util.homeDir()? Ideally we would just like to pass the location of the config file to the server when it starts, I suppose. In the config file we can then specify the location of the data folder etc.
Kind regards,
Huib. _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk