After setting setenv.sh and pointing both JAVA_HOME and DHIS2_HOME to their appropriate places, and setting appropriate JAVA_OPTS, but still I cannot still get DHIS to use the postgresql database rather than H2 database.
When I check catalina.out, it says that DHIS2_HOME points to the correct place but in the next line it says Directory /home/dhis/config is not writeable
to give you an idea,
hibernate.properties file is located in /home/dhis/config
and here’s the content of setenv.sh which is located in /usr/share/tomcat7/bin
Hi,
which Ubuntu user are you logged in with when you're starting tomcat?
Olav
···
Den 1. okt. 2013 kl. 23:24 skrev Seid Hussein <seid.hisp@gmail.com>:
Hi all,
After setting setenv.sh and pointing both JAVA_HOME and DHIS2_HOME to their appropriate places, and setting appropriate JAVA_OPTS, but still I cannot still get DHIS to use the postgresql database rather than H2 database.
When I check catalina.out, it says that DHIS2_HOME points to the correct place but in the next line it says Directory /home/dhis/config is not writeable
to give you an idea,
hibernate.properties file is located in /home/dhis/config
and here's the content of setenv.sh which is located in /usr/share/tomcat7/bin
After setting setenv.sh and pointing both JAVA_HOME and DHIS2_HOME to their appropriate places, and setting appropriate JAVA_OPTS, but still I cannot still get DHIS to use the postgresql database rather than H2 database.
When I check catalina.out, it says that DHIS2_HOME points to the correct place but in the next line it says Directory /home/dhis/config is not writeable
to give you an idea,
hibernate.properties file is located in /home/dhis/config
and here’s the content of setenv.sh which is located in /usr/share/tomcat7/bin
After setting setenv.sh and pointing both JAVA_HOME and DHIS2_HOME to their appropriate places, and setting appropriate JAVA_OPTS, but still I cannot still get DHIS to use the postgresql database rather than H2 database.
When I check catalina.out, it says that DHIS2_HOME points to the correct place but in the next line it says Directory /home/dhis/config is not writeable
to give you an idea,
hibernate.properties file is located in /home/dhis/config
and here’s the content of setenv.sh which is located in /usr/share/tomcat7/bin
Not an export on this, but I would guess that if you are running tomcat as user “seid”, the “Directory /home/dhis/config” might not be writable as it belongs to the “dhis” user. So you could either try to start tomcat with user “dhis” instead, or make sure that the /home/dhis/config is writable by the “seid” user. And, like Jason says, make sure the hibernate.properties files is in the right folder.
After setting setenv.sh and pointing both JAVA_HOME and DHIS2_HOME to their appropriate places, and setting appropriate JAVA_OPTS, but still I cannot still get DHIS to use the postgresql database rather than H2 database.
When I check catalina.out, it says that DHIS2_HOME points to the correct place but in the next line it says Directory /home/dhis/config is not writeable
to give you an idea,
hibernate.properties file is located in /home/dhis/config
and here’s the content of setenv.sh which is located in /usr/share/tomcat7/bin
After setting setenv.sh and pointing both JAVA_HOME and DHIS2_HOME to their appropriate places, and setting appropriate JAVA_OPTS, but still I cannot still get DHIS to use the postgresql database rather than H2 database.
When I check catalina.out, it says that DHIS2_HOME points to the correct place but in the next line it says Directory /home/dhis/config is not writeable
to give you an idea,
hibernate.properties file is located in /home/dhis/config
and here’s the content of setenv.sh which is located in /usr/share/tomcat7/bin
Not an export on this, but I would guess that if you are running tomcat as user “seid”, the “Directory /home/dhis/config” might not be writable as it belongs to the “dhis” user. So you could either try to start tomcat with user “dhis” instead, or make sure that the /home/dhis/config is writable by the “seid” user. And, like Jason says, make sure the hibernate.properties files is in the right folder.
After setting setenv.sh and pointing both JAVA_HOME and DHIS2_HOME to their appropriate places, and setting appropriate JAVA_OPTS, but still I cannot still get DHIS to use the postgresql database rather than H2 database.
When I check catalina.out, it says that DHIS2_HOME points to the correct place but in the next line it says Directory /home/dhis/config is not writeable
to give you an idea,
hibernate.properties file is located in /home/dhis/config
and here’s the content of setenv.sh which is located in /usr/share/tomcat7/bin
good it works but its better to follow Olav’s advice and change to the dhis user before starting tomcat ( su dhis ). You might run into trouble later with your approach e.g. when uploading resources which will be saved the filesystem.
Not an export on this, but I would guess that if you are running tomcat as user “seid”, the “Directory /home/dhis/config” might not be writable as it belongs to the “dhis” user. So you could either try to start tomcat with user “dhis” instead, or make sure that the /home/dhis/config is writable by the “seid” user. And, like Jason says, make sure the hibernate.properties files is in the right folder.
After setting setenv.sh and pointing both JAVA_HOME and DHIS2_HOME to their appropriate places, and setting appropriate JAVA_OPTS, but still I cannot still get DHIS to use the postgresql database rather than H2 database.
When I check catalina.out, it says that DHIS2_HOME points to the correct place but in the next line it says Directory /home/dhis/config is not writeable
to give you an idea,
hibernate.properties file is located in /home/dhis/config
and here’s the content of setenv.sh which is located in /usr/share/tomcat7/bin
Now I have started switching to the dhis user while manipulating tomcat
···
On Wed, Oct 2, 2013 at 11:35 AM, Lars Helge Øverland larshelge@gmail.com wrote:
Hi Seid,
good it works but its better to follow Olav’s advice and change to the dhis user before starting tomcat ( su dhis ). You might run into trouble later with your approach e.g. when uploading resources which will be saved the filesystem.
Not an export on this, but I would guess that if you are running tomcat as user “seid”, the “Directory /home/dhis/config” might not be writable as it belongs to the “dhis” user. So you could either try to start tomcat with user “dhis” instead, or make sure that the /home/dhis/config is writable by the “seid” user. And, like Jason says, make sure the hibernate.properties files is in the right folder.
After setting setenv.sh and pointing both JAVA_HOME and DHIS2_HOME to their appropriate places, and setting appropriate JAVA_OPTS, but still I cannot still get DHIS to use the postgresql database rather than H2 database.
When I check catalina.out, it says that DHIS2_HOME points to the correct place but in the next line it says Directory /home/dhis/config is not writeable
to give you an idea,
hibernate.properties file is located in /home/dhis/config
and here’s the content of setenv.sh which is located in /usr/share/tomcat7/bin
This is one of the issues which we have addressed with the dhis2-tools package. It is a common problem that the tomcat gets started by the wrong system user. In your case it wouldn’t start but in many cases I have seen people circumvent the problem by just starting as the root user which is worse. So in the dhis2-tools you always start an instance with ‘dhis2-startup ’ and that ensures that the correct user is running the process. In fact I completely removed the startup and shutdown scripts from the bin directory to try to discourage accidentally starting it incorrectly.
(Having said all of that, there is something a bit simplistic about our use of DHIS2_HOME in that we use it as the base directory for configuration but we also write stuff into it. Not much as most things are now kept in the database, but still a few things which require the directory to be writable. It would probably be neater to separate DHIS2_CONFIG from DHIS2_DATA. Where the former doesn’t need to be writable but the latter does.)
On Wed, Oct 2, 2013 at 11:35 AM, Lars Helge Øverland larshelge@gmail.com wrote:
Hi Seid,
good it works but its better to follow Olav’s advice and change to the dhis user before starting tomcat ( su dhis ). You might run into trouble later with your approach e.g. when uploading resources which will be saved the filesystem.
Not an export on this, but I would guess that if you are running tomcat as user “seid”, the “Directory /home/dhis/config” might not be writable as it belongs to the “dhis” user. So you could either try to start tomcat with user “dhis” instead, or make sure that the /home/dhis/config is writable by the “seid” user. And, like Jason says, make sure the hibernate.properties files is in the right folder.
After setting setenv.sh and pointing both JAVA_HOME and DHIS2_HOME to their appropriate places, and setting appropriate JAVA_OPTS, but still I cannot still get DHIS to use the postgresql database rather than H2 database.
When I check catalina.out, it says that DHIS2_HOME points to the correct place but in the next line it says Directory /home/dhis/config is not writeable
to give you an idea,
hibernate.properties file is located in /home/dhis/config
and here’s the content of setenv.sh which is located in /usr/share/tomcat7/bin
(Having said all of that, there is something a bit simplistic about our
use of DHIS2_HOME in that we use it as the base directory for configuration
but we also write stuff into it. Not much as most things are now kept in
the database, but still a few things which require the directory to be
writable. It would probably be neater to separate DHIS2_CONFIG from
DHIS2_DATA. Where the former doesn't need to be writable but the latter
does.)
Good point. I think it should be fine though as we deliberately don't write
anything into DHIS2_HOME itself, rather DHIS2_HOME/documents for
documents/resources etc.
But that directory must be then created by the installation script, so your
idea is probably simpler.
···
On Wed, Oct 2, 2013 at 11:41 AM, Lars Helge Øverland <larshelge@gmail.com>wrote:
(Having said all of that, there is something a bit simplistic about our
use of DHIS2_HOME in that we use it as the base directory for configuration
but we also write stuff into it. Not much as most things are now kept in
the database, but still a few things which require the directory to be
writable. It would probably be neater to separate DHIS2_CONFIG from
DHIS2_DATA. Where the former doesn't need to be writable but the latter
does.)
Good point. I think it should be fine though as we deliberately don't
write anything into DHIS2_HOME itself, rather DHIS2_HOME/documents for
documents/resources etc.