Ir al contenido
Otras versiones

Cargando…

Configuring SQL Server

Esta página aún no está disponible en tu idioma.

Start SQL Server Management Studio Express and create a database called okmdb.

Select your appropriate database collate.

Edit the file $TOMCAT_HOME/OpenKM.cfg

hibernate.dialect=org.hibernate.dialect.SQLServerDialect
hibernate.hbm2ddl=create

Edit the file $TOMCAT_HOME/conf/server.xml and enable the resource named jdbc/OpenKMDS

<Resource name="jdbc/OpenKMDS" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000" validationQuery="select 1"
username="sa" password="***" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://localhost:1433;databaseName=okmdb"/>

Edit the file $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>

Go to $TOMCAT_HOME/lib and check for the JDBC sqljdbc4.jar Driver.

If it is not present, download the SQL Server JDBC driver from Microsoft SQL Server Driver Page and move it to $TOMCAT_HOME/lib.

As a process in the OpenKM startup, the application will automatically create an empty database structure. 

Ensure you’ve got TCP protocol enabled (this is disabled by default)

We have observed a new behaviour in some SQL Server editions where the connection is closed after a few hours (This may be some extra configuration parameter in the latest SQL server editions that comes enabled by default or something similar). There’s a new configuration attribute named autoReconnect to solve it.

<Resource name="jdbc/OpenKMDS" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000" validationQuery="select 1"
username="sa" password="***" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://localhost\SQL;databaseName=okmdb;autoReconnect=true"/>

When first-time OpenKM login it fails with the correct username and password (okmAdmin / admin), you should check the database configuration.

Check if the database is configured to be case-sensitive, this may be the reason why you are not able to login.