HSQLDB 2.2.9: understanding server.properties file - hsqldb

I am running hsqlddb 2.2.9 on ubuntu Linux but I am struggling to understand the server.properties file. With hsqldb installed under /usr/local, when I start the server with java org.hsqldb.server.Server from the place I put the server.properties file, suppose server.properties is:
server.database.0=file:/usr/local/hsqldb-2.2.9/hsqldb/hibernate/hiberdb
server.dbname.0=hiberdb
Then I get a subdirectory hibdernate with everthing in it labeled
hibderdb.{log,script,properties,tmp}
with hibderdb.tmp an empty directory. So far so good.
However I cannot understand hyper sql db's logic in the following cases:
Suppose server.properties is:
server.database.0=file:/usr/local/hsqldb-2.2.9/hsqldb/hibernate
server.dbname.0=hiberdb
then the hibderdb alias is ignode and I get files
hibernate.{log,properties,script,tmp}
in the same directory as the server.properties file (i.e. in the current directory).
or even the following:
server.database.0=file:/usr/local/hsqldb-2.2.9/hsqldb/hibernate/
server.dbname.0=hiberdb
then all I get is a hibernate subdirectory with no hibderdb.* files and instead I have files
hibernate/{.log,.properties,.script,.tmp}
(these are hidden Unix files, and again the alias property dbname is ignored).
The HSQLDB documentation has an example:
http://hsqldb.org/doc/2.0/guide/listeners-chapt.html#lsc_server_props
server.database.1=file:/opt/db/mydb
server.dbname.1=enrolments
Is this example outdated or wrong?
Thanks,
Jason Posit

The server.dbname.0=hiberdb is totally unrelated to the other line in the properties file.
This 'alias' is used when accessing the server from a client.
The example in the documentation is correct. The external database client is dealing with a database alias it knows as 'enrolments', and does not need to know where you store the files on your server.
Access to your 'hiberdb' client is always via the URL such as jdbc:hsqldb:hsql://localhost/hiberdb no matter where you put the files.

Related

How can I setup Apache Mina to save uploaded files to a database?

I'm looking for example or any documentation that would help me get files to go into the database instead of the file system.
I tried setting it up like so:
val sshd = SshServer.setUpDefaultServer();
sshd.setPort(config.getSftpPort());
sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider(new File(config.getHostFile())));
sshd.setSubsystemFactories(Collections.singletonList(new SftpSubsystemFactory()));
sshd.setPublickeyAuthenticator(new AuthorizedKeysAuthenticator(new File(config.getAuthKeysPath())));
sshd.setFileSystemFactory(new VirtualFileSystemFactory());
sshd.start();
log.info("SFTP server started");
Which works, it just saves it to the root directory. In the documentation it says that there's a way to get it to save to a database instead. No examples or docs on how to do this are provided. The documentation for this project is complete garbage. :(

(MacOS Server) Apache File Extension Questions

I am running into some sort of issue when trying to access my local website:
Forbidden
You don't have permission to access /index.html on this server.
Apache Server at ffghost.local Port 34580
I'm using macOS X Server 5.2 with Apache 2.4.18. OS X Server automatically creates two default websites (one on port 80 and one on port 443). I created a new website. It was my understanding that Apache would redirect from the default site to the created site automatically once created. This didn't happen. So, in an attempt to begin de-conflicting I replaced the files where the default site was located with the new website files and all of the sudden am getting the above 404 message.
I have read a lot of possibilities as to why this may be happening. I've run a syntax checker for Apache in terminal and terminal says syntax is ok. So from there I was going to check into the config files, but there are several, and I just want to know the gist behind them.
There seem to be about 4 file extension types. I don't know what they all mean or if they are active.
.config (I'm assuming this is the active file)
.config.prev (I'm assuming this is a previous version or copy of an active config file and is no longer active)
.config.orig (original file? and is no longer active)
.config.default (???)
Also, OS X Server and Apache seem to have the same files in two different places and I'm a little confused on which one to change. If I change one of them will it be reflected in the other? Do I need to change both of them? Additionally, I don't have DNS set up and am unsure if that was the original issue of not pulling up the new website over the default site.
You are mixing several aspects in your question which makes it complicated to give a helpful answer. For example, you say you get Forbidden when accessing your site, but later you mention a status 404. The former might be due to configuring a user group being allowed to access the site, while the latter just means Not found.
As to your actual question about the config files:
The file just ending in .conf is the one that is being used.
However, the Server app uses a lot of of different config files which might be relevant:
Path /Library/Server/Web/Config/apache2 contains the general config files
httpd.conf - general Apache configuration
httpd_server_app.conf - more general configuration
the other files contain configurations for specific applications or webapps (the latter being defined in plist files in /Library/Server/Web/Config/apache2/webapps)
Path /Library/Server/Web/Config/apache2/sites contains config files specific to your websites. They are named something like 0000_127.0.0.1_34543_your.domain.name.conf where 34543 is the configuration for the https (SSL) port, while 35480 would indicate the http port. There is also a file like 0000_127.0.0.1_34543_.conf (no domain name in the file name) which defines the default site.
In addition to these, there are two more configuration file in /Library/Server/Web/Config/proxy which configure the proxy services.
It is not recommended to manually adjust the config files, except for those in the sites subdirectory, because they may get overwritten by the Server app or when updating the Server app.
Important: If you change the files manually, you must re-start the Apache server in order to make the changes effective. Use sudo serveradmin stop/start web to do so.
However, I do not know of a detailed documentation of of all these files, so I try to stay on the safe side and possibly not edit the general config files (only those in sites). I also recommend to write down any manual changes, so they can be reapplied if necessary.
Without exactly knowing what you configured in the Server app and which files you changed how, I'm afraid it is impossible to say what might have gone wrong. I recommend to start all over by removing and re-adding the web sites.

JBoss 7.2.0 Final creating server.log file in unexpected places

I am trying to set up JBoss 7.2.0 Final on CentOS 6.5 to handle 4 different deployments of our software. I'm not sure if I have set things up correctly or not, but everything seems to work except that server.log is not ending up where I think I am telling it to be saved in 3 of 4 deployments.
There are 4 HTTP ports being used for the deployments. They are :8080, :8180, :9876, and :9976. I don't know if that is relevant information or not, but I bring it up because in each standalone.xml file I am using the jboss.socket.binding.port-offset option to assign the ports. The only deployment that seems to work flawlessly is :8080, which has jboss.socket.binding.port-offset:0. :8180 has jboss.socket.binding.port-offset:100, etc.
Each deployment lives in its own directory, for example
/opt/jboss-eap-6.1/target/standalone8080/
and
/opt/jboss-eap-6.1/target/standalone9876/
In the standalone.xml file for each deployment (/opt/jboss-eap-6.1/target/standalone9876/configuration/standalone.xml, for example), the server log is specified in the same way:
<file relative-to="jboss.server.log.dir" path="server.log"/>
This should result in the server.log being saved in, for example,
/opt/jboss-eap-6.1/target/standalone9876/log,
and when redeploying the software on each port, I have echoed out the $JBOSS_LOG_DIR variable and it seems on the surface to be set correctly in each case.
However, as mentioned above, only port :8080 creates the server.log file in the expected location (/opt/jboss-eap-6.1/target/standalone8080/log).
The incorrect locations:
--Port :8180 puts its server.log file in the :8080 location. I.e., :8180 overwrites the server.log file at /opt/jboss-eap-6.1/target/standalone8080/log.
--Port :9876 puts its server.log file in /opt/jboss-eap-6.1/target/standalone/log. I.e., it creates a new folder simply called standalone and puts the file there. I will add that in a former time, the entire port :9876 deployment lived in a folder at that path (/opt/jboss-eap-6.1/target/standalone). This apparent clue makes me think there is some other place where there is a setting for the server.log file path. I could be quite wrong.
--Finally, port :9976 is putting its server.log file one level above the desired log directory, in other words, at /opt/jboss-eap-6.1/target/standalone9976.
I don't know if the way these 4 deployments are being handled is fundamentally incorrect or if there is a setting hiding somewhere that is overriding my desired paths.
I saw one poster with a similar problem say they made a change to domain.xml to fix the issue. I don't think I can do that, since I only have one domain.xml file (located in /opt/jboss-eap-6.1/domain/configuration) that is associated with all 4 deployments.
Another post recommended removing the "relative-to" bit in the <file> tag in the standalone.xml file. I tried that with port :9876 as follows:
<file path="/opt/jboss-eap-6.1/target/standalone9876/log/server.log"/>
This did not work for me. The server.log file still ended up in
<file path="/opt/jboss-eap-6.1/target/standalone/log/server.log"/>
Any ideas what I am doing wrong? Is there simply another place I need to declare my log path, or is the way these 4 servers are set up just plain incorrect?
Have a look at each logging.properties file in each configuration directory. You might just need to update those, once, to change the path to {jboss.server.log.dir}/server.log. Then when you start each server you'll need to specify the jboss.server.log.dir directory.
./bin/standalone.sh -Djboss.server.log.dir=$JBOSS_HOME/target/standalone8080/log
There might be a clever way to handle it in the $JBOSS_HOME/bin/standalone.conf file.

Python and WSGI - Where is the default output folder? (CentOS/Apache)

I am running Python under WSGI on an Apache server using CentOS 6. The python script uses a wrapper for the NCAR library called PyNGL. The purpose of this library is to generate graphics from supplied data.
I am attempting to use my python script as a web service by hooking it up to web.py, but it has an entry point for direct execution as well.
Here is the weird thing:
When I run the script directly it works as intended and produces an output image in the directory of the script. However, when I attempt to invoke it through the web.py controller (with the exact same parameters) it fails.
My apache error log contains this:
warning:GKS:GCLRWK: -- cairo driver error: error opening output file
I'm guessing that this is probably a permissions problem, but I haven't the slightest idea where its trying to output.
Edit: I think I have confirmed that it is indeed a permissions error.
I attempted to create file using relative paths and got a similar error:
<type 'exceptions.IOError'> at /plot
[Errno 13] Permission denied: 'Output.txt'
This error refers to this line here:
with open("Output.txt", "w") as text_file:
text_file.write(str(self.__dict__))
Now of course I can specify an absolute path for that text file, but not for the graphical output from PyNGL. Is there a way to determine where it is trying to output, or to change the default output directory?
Usually your application would be running with the current working directory as '/'. The Apache user will not be able to write to that directory.
In any web application you should in general never rely on it being run in a specific directory as different web servers behave differently as to what the current working directory would be. If you assume it always runs in a specific directory, your application would be inherently unportable. Changing the working directory of an application to get around this is also in general bad practice because in a hosting mechanism that allows multiple application to run in the same process, they would all interfere with each other if they each tried to set their own working directory.
What you should do is always use absolute paths when reading and write files and not use relative paths. Why do you say you can't use absolute paths?
Also be aware that your application will run as a special user which would not have access to directories to create files. You would therefore need to open up access to the Apache user. Best practice would be to limit though what the Apache user can write to.
Now since you are using mod_wsgi, one viable option is to make sure you are using mod_wsgi daemon mode and when using the WSGIDaemonProcess directive set the 'home' option to override the current working directory for the single WSGI application delegated to that process. You can also set 'user' and 'group' options to have the process run as a different user that does have access to the directory.

Changing the WebLogic Domain location

I am currently setting up a new dev environment, and have come to the final stage where I am trying to run a build.
However, one of the ANT targets is trying to create a directory, which is currently set to "C:\workspace\domains\Online" however for security reasons (they say anyway...) we do not have full access to the C: drive, so I have my domain setup in an alternate location. Where is this Domain Home/Root variable kept?
Well in my own domain there is in file <domain>/bin/setDomainEnv.bat the following line:
set DOMAIN_HOME=D:\Oracle\Middleware\user_projects\domains\domain_name
However since you are using some Ant build file to create your domain, maybe something is hardcoded in them or is one of the properties passed to this file.
An ANT build file that had been supplied by somebody else had been hardcoded! Not sure why they couldn't follow the convention! It just so happened that the location that had been hardcoded was the same as my old workspace, thus the confusion.
Thanks all.