Difference between revisions of "PostgreSQL - OpenKM 6.2"
From OpenKM Documentation
(Created page with '{{TOCright}} __TOC__ {{Note|These instructions are also valid for OpenKM 6.1.}} In this OpenKM release you can create the databases automatically configuring the '''hibernate.di…') |
m (→Database creation) |
||
(12 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{TOCright}} __TOC__ | {{TOCright}} __TOC__ | ||
− | |||
In this OpenKM release you can create the databases automatically configuring the '''hibernate.dialect''' and '''hibernate.hbm2ddl''' properties in [[OpenKM.cfg]]. | In this OpenKM release you can create the databases automatically configuring the '''hibernate.dialect''' and '''hibernate.hbm2ddl''' properties in [[OpenKM.cfg]]. | ||
Line 14: | Line 13: | ||
More info about this at: | More info about this at: | ||
− | * [http://docs.jboss.org/hibernate/ | + | * [http://docs.jboss.org/hibernate/orm/3.6/reference/en-US/html/session-configuration.html#configuration-optional-dialects Hibernate: SQL Dialects] |
== Database creation == | == Database creation == | ||
Line 20: | Line 19: | ||
<source lang="sql"> | <source lang="sql"> | ||
− | DROP DATABASE IF EXISTS | + | DROP DATABASE IF EXISTS okmdb; |
+ | CREATE USER openkm WITH PASSWORD '*secret*'; | ||
+ | CREATE DATABASE okmdb WITH OWNER openkm ENCODING 'UTF8'; | ||
+ | </source> | ||
− | + | or from command line: | |
− | + | <source lang="bash"> | |
+ | $ createuser --pwprompt openkm | ||
+ | $ createdb --owner=openkm --encoding=UTF8 okmdb | ||
</source> | </source> | ||
More info at: | More info at: | ||
− | * [http://www.postgresql.org/docs/ | + | * [http://www.postgresql.org/docs/9.1/static/index.html PostgreSQL 9.1 Documentation] |
+ | * [http://www.guia-ubuntu.com/index.php?title=PostgreSQL Guía Ubuntu: PostgreSQL] | ||
== Tomcat datasources == | == Tomcat datasources == | ||
Line 38: | Line 43: | ||
maxActive="100" maxIdle="30" maxWait="10000" validationQuery="select 1" | maxActive="100" maxIdle="30" maxWait="10000" validationQuery="select 1" | ||
username="openkm" password="*****" driverClassName="org.postgresql.Driver" | username="openkm" password="*****" driverClassName="org.postgresql.Driver" | ||
− | url="jdbc:postgresql://localhost:5432/ | + | url="jdbc:postgresql://localhost:5432/okmdb"/> |
</source> | </source> | ||
Line 57: | Line 62: | ||
[[Category: Installation Guide]] | [[Category: Installation Guide]] | ||
− |
Latest revision as of 17:29, 29 October 2013
In this OpenKM release you can create the databases automatically configuring the hibernate.dialect and hibernate.hbm2ddl properties in OpenKM.cfg.
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.hbm2ddl=create
Once the tables are created, OpenKM will automatically change the hibernate.hbm2ddl property from create to none.
More info about this at:
Database creation
Starting with OpenKM 6.0, only one database is needed:
DROP DATABASE IF EXISTS okmdb;
CREATE USER openkm WITH PASSWORD '*secret*';
CREATE DATABASE okmdb WITH OWNER openkm ENCODING 'UTF8';
or from command line:
$ createuser --pwprompt openkm
$ createdb --owner=openkm --encoding=UTF8 okmdb
More info at:
Tomcat datasources
$ vim $TOMCAT_HOME/conf/server.xml
<Resource name="jdbc/OpenKMDS" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000" validationQuery="select 1"
username="openkm" password="*****" driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/okmdb"/>
Login configuration
$ vim $TOMCAT_HOME/OpenKM.xml
<security:authentication-manager alias="authenticationManager">
<security:authentication-provider>
<security:password-encoder hash="md5"/>
<security:jdbc-user-service
data-source-ref="dataSource"
users-by-username-query="select usr_id, usr_password, 1 from OKM_USER where usr_id=? and usr_active='T'"
authorities-by-username-query="select ur_user, ur_role from OKM_USER_ROLE where ur_user=?"/>
</security:authentication-provider>
</security:authentication-manager>