Hi,
When I start a BaseXServer in Java, it creates a config file ~/.basex and a data directory ~/BaseXData. Is there any way to ask BaseX not to create the config file, and to use a specific another data directory?
Or at least to tell it where to look for the config file (instead of going to ~/.basex)? I couldn't find either in the documentation.
Regards,
On 03/24/2013 12:15 PM, Florent Georges wrote:
Hi,
When I start a BaseXServer in Java, it creates a config file ~/.basex and a data directory ~/BaseXData. Is there any way to ask BaseX not to create the config file, and to use a specific another data directory?
Or at least to tell it where to look for the config file (instead of going to ~/.basex)? I couldn't find either in the documentation.
If you look at org.basex.test.SandboxTest.java you can see the location of the data directory being specified. BaseXServer has a constructor that takes a Context. Presumably, you could use a context initialized as it is in SandboxTest to change the location.
So far, I am using LocalSession and the data directory is created where I specify, and ~/.basex and ~/BaseXData are not created.
Kendall
Hi Florent, thanks Kendall,
you can explicitly speciy a BaseX home directory via the "org.basex.path" system property, or place a .basex file in the directory you are starting BaseX from (i.e., in the “current working directory”). You’ll find some information on the page “Configuration” in our Wiki [1], which hopefully includes all relevant information. If something is missing, feel free to ask again.
Best, Christian
[1] http://docs.basex.org/wiki/Configuration ___________________________
On Sun, Mar 24, 2013 at 8:15 PM, Florent Georges lists@fgeorges.org wrote:
Hi,
When I start a BaseXServer in Java, it creates a config file ~/.basex and a data directory ~/BaseXData. Is there any way to ask BaseX not to create the config file, and to use a specific another data directory?
Or at least to tell it where to look for the config file (instead of going to ~/.basex)? I couldn't find either in the documentation.
Regards,
--
Florent Georges http://fgeorges.org/ http://h2oconsulting.be/ _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Hi Christian, thanks Kendall,
The org.basex.path property is indeed doing the job here. Thanks!
One thing I noticed though (and it is not specific to Java, but related to calling the server and client from the command line), is that when using a new home directory (containing no .basex file), the server will always write PORT = 1984, even when passed the option -p12345:
# variables home=`pwd`/basex-home jar=/Library/Java/org/basex/basex-7.6.jar prop=-Dorg.basex.path=$home class=org.basex.BaseXServer
# create a new dir mkdir $home
# start and stop the server java -cp $jar $prop $class -p12345 & sleep 2 java -cp $jar $prop $class -p12345 stop
# look into .basex grep PORT $home/.basex
The last command return the following, showing the default values:
PORT = 1984 SERVERPORT = 1984 EVENTPORT = 1985 PROXYPORT = 80 STOPPORT = 8985
Shouldn't it save the port number passed on the command line?
Regards,
Hi Florent,
please note that the existing .basex configuration file will never be overwritten, except for the case that some options are invalid (which may occur when new options are added in a new version of BaseX.
Best, Christian ___________________________
On Mon, Mar 25, 2013 at 12:46 PM, Florent Georges lists@fgeorges.org wrote:
Hi Christian, thanks Kendall,
The org.basex.path property is indeed doing the job here. Thanks!
One thing I noticed though (and it is not specific to Java, but related to calling the server and client from the command line), is that when using a new home directory (containing no .basex file), the server will always write PORT = 1984, even when passed the option -p12345:
# variables home=`pwd`/basex-home jar=/Library/Java/org/basex/basex-7.6.jar prop=-Dorg.basex.path=$home class=org.basex.BaseXServer # create a new dir mkdir $home # start and stop the server java -cp $jar $prop $class -p12345 & sleep 2 java -cp $jar $prop $class -p12345 stop # look into .basex grep PORT $home/.basex
The last command return the following, showing the default values:
PORT = 1984 SERVERPORT = 1984 EVENTPORT = 1985 PROXYPORT = 80 STOPPORT = 8985
Shouldn't it save the port number passed on the command line?
Regards,
--
Florent Georges http://fgeorges.org/ http://h2oconsulting.be/
On 25 mars 2013 10h18, Christian Grün wrote:
Hi Florent, thanks Kendall,
you can explicitly speciy a BaseX home directory via the "org.basex.path" system property, or place a .basex file in the directory you are starting BaseX from (i.e., in the “current working directory”). You’ll find some information on the page “Configuration” in our Wiki [1], which hopefully includes all relevant information. If something is missing, feel free to ask again.
Best, Christian
[1] http://docs.basex.org/wiki/Configuration ___________________________
On Sun, Mar 24, 2013 at 8:15 PM, Florent Georges lists@fgeorges.org wrote:
Hi,
When I start a BaseXServer in Java, it creates a config file ~/.basex and a data directory ~/BaseXData. Is there any way to ask BaseX not to create the config file, and to use a specific another data directory?
Or at least to tell it where to look for the config file (instead of going to ~/.basex)? I couldn't find either in the documentation.
Regards,
--
Florent Georges http://fgeorges.org/ http://h2oconsulting.be/ _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
That makes perfect sense indeed.
But here the directory itself does not exist, I create it then start and stop the server with the newly create home dir and the overriden port numbers. Since the .basex file is created, I would expect it to contain the overriden values, but that might be just me.
Regards,
In this case, you can specify the hidden -W flag (if I remember correctly, though, it’s only available for org.basex.Base). ___________________________
On Mon, Mar 25, 2013 at 2:31 PM, Florent Georges lists@fgeorges.org wrote:
That makes perfect sense indeed.
But here the directory itself does not exist, I create it then start and stop the server with the newly create home dir and the overriden port numbers. Since the .basex file is created, I would expect it to contain the overriden values, but that might be just me.
Regards,
--
Florent Georges http://fgeorges.org/ http://h2oconsulting.be/
On Lundi 25 mars 2013 14h11, Christian Grün wrote: Hi Florent,
please note that the existing .basex configuration file will never be overwritten, except for the case that some options are invalid (which may occur when new options are added in a new version of BaseX.
Best, Christian ___________________________
On Mon, Mar 25, 2013 at 12:46 PM, Florent Georges lists@fgeorges.org wrote:
Hi Christian, thanks Kendall,
The org.basex.path property is indeed doing the job here. Thanks!
One thing I noticed though (and it is not specific to Java, but related
to calling the server and client from the command line), is that when using a new home directory (containing no .basex file), the server will always write PORT = 1984, even when passed the option -p12345:
# variables home=`pwd`/basex-home jar=/Library/Java/org/basex/basex-7.6.jar prop=-Dorg.basex.path=$home class=org.basex.BaseXServer # create a new dir mkdir $home # start and stop the server java -cp $jar $prop $class -p12345 & sleep 2 java -cp $jar $prop $class -p12345 stop # look into .basex grep PORT $home/.basex
The last command return the following, showing the default values:
PORT = 1984 SERVERPORT = 1984 EVENTPORT = 1985 PROXYPORT = 80 STOPPORT = 8985
Shouldn't it save the port number passed on the command line?
Regards,
--
Florent Georges http://fgeorges.org/ http://h2oconsulting.be/
On 25 mars 2013 10h18, Christian Grün wrote:
Hi Florent, thanks Kendall,
you can explicitly speciy a BaseX home directory via the "org.basex.path" system property, or place a .basex file in
the
directory you are starting BaseX from (i.e., in the “current working directory”). You’ll find some information on the page “Configuration” in our Wiki [1], which hopefully includes all relevant information. If something is missing, feel free to ask again.
Best, Christian
[1] http://docs.basex.org/wiki/Configuration ___________________________
On Sun, Mar 24, 2013 at 8:15 PM, Florent Georges
wrote:
Hi, When I start a BaseXServer in Java, it creates a config file
~/.basex and a data directory ~/BaseXData. Is there any way to ask BaseX not to create the config file, and to use a specific another data directory?
Or at least to tell it where to look for the config file
(instead of going to ~/.basex)? I couldn't find either in the documentation.
Regards,
--
Florent Georges http://fgeorges.org/ http://h2oconsulting.be/ _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
On Mon, 2013-03-25 at 10:18 +0100, Christian Grün wrote:
[...] or place a .basex file in the directory you are starting BaseX from (i.e., in the “current working directory”).
Use extreme caution if you do this. Ideally the two files - ~/.basex and .basex - would be merged, both would be used.
The caution is that if you upgrade to a newer BaseX version, presumably in a new directory, your password and port will get reset to defaults, opening up your site for remote access! The default from a security perspective should obviously be that BaseX listens only on "localhost" and no other network interface, or doesn't listen to any port at all, without a configuration, but I don't think it is shipped that way.
Liam
The caution is that if you upgrade to a newer BaseX version, presumably in a new directory, your password and port will get reset to defaults, opening up your site for remote access! The default from a security perspective should obviously be that BaseX listens only on "localhost" and no other network interface, or doesn't listen to any port at all, without a configuration, but I don't think it is shipped that way.
True; if you want to adopt users and passwords from another BaseX installation, you’ll also have to copy the .basexperm file.
Christian
basex-talk@mailman.uni-konstanz.de