# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # LibreSource Installation notes # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Copyright (C) 2004-2007 Artenum SARL / INRIA # http://www.libresource.org - contact@libresource.org # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Thank you for using LibreSource # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Sommaire # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Prerequisites - Postgres operations - Customisation of JONAS - Customisation of the properties files - Starting/Stoping Jonas/Libresource - Optimization # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Prerequisites # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You must install the following components on the server - JOnAS Application Server with Tomcat (http://jonas.objectweb.org/) [this version is released for JOnAS 4.7.6 and Tomcat 5.5.15] - JDK 1.5.x or 1.6.x versions (http://java.sun.com/j2se/) [the JDK 1.6 is mandatory for the installation of tigase the Jabber Server] - PostgreSQL Database server (version 8.x or more recent) (http://www.postgresql.org/) You must have the libresource PROPERTIES files and the libresource EAR file. - You can directly download them on (http://www.libresource.org) - You can generate them from the source code which can be downloaded on (http://www.libresource.org). A BUILD.txt explain how to generate those files. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Postgres operations # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - create the libresource database in PostgreSQL - create the libresource user in PostgreSQL - allow this user to be a superuser : ALTER USER libresource WITH superuser; # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Customisation of JONAS # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1) Security configuration - Edit the file JONAS_ROOT/conf/jaas.config and add those text lines => if you are using the local database for authentication (default) libresource { org.libresource.security.InternalBaseLoginModule requisite; org.objectweb.jonas.security.auth.spi.ClientLoginModule requisite globalCtx="false"; }; => if you are using a CAS server for the authentication libresource { org.libresource.security.CASLoginModule requisite; org.objectweb.jonas.security.auth.spi.ClientLoginModule requisite globalCtx="false"; }; 2) Database access After install postgres on the server, configure JOnAS to access database - Database driver + Download from http://jdbc.postgresql.org/download.html the right JDBC driver and copy the jar file to JONAS_ROOT/lib/ext/ - Datasource for JOnAS + Edit the folowing line in the file $JONAS_ROOT/conf/jonas.properties jonas.service.dbm.datasources libresourceDS 3) Service activation - Edit the following line in the file $JONAS_ROOT/conf/jonas.properties + Remove "db" (hsql db service) + Add "mail" at the end jonas.services registry,jmx,jtm,dbm,security,resource,ejb,web,ear,mail 4) LibreSource configuration and mail notification - Edit the folowing line in $JONAS_ROOT/conf/jonas.properties + libresourceMail : for the mail notification [OPTIONAL] + libresourceConfig: is for the dynamic configuration of libresource [MANDATORY] jonas.service.mail.factories libresourceMail, libresourceConfig 5) Remove default deployed application used for demonstration - Move the administration console + JONAS_ROOT/webapps/autoload/jonasAdmin.war to JONAS_ROOT/webapps/jonasAdmin.war - Remove the applications deploy by default : + JONAS_ROOT/apps/autoload/*.ear ++ NOTE : keep the JONAS_ROOT/apps/autoload/LibreSource-XXXX.ear + JONAS_ROOT/ejbjars/autoload/*.jar + JONAS_ROOT/webapps/autoload/*.war + JONAS_ROOT/webapps/autoload/jonas-doc-en + JONAS_ROOT/webapps/autoload/jonas-javadoc 6) RMI configuration - For better performance it's recommended to use the jeremie protocol as default RMI protocol. + Edit the following line in the file JONAS_ROOT/conf/carol.properties carol.protocols=jeremie 7) Extend the transaction timeout + Edit the folowing line in $JONAS_ROOT/conf/jonas.properties jonas.service.jtm.timeout 3000 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Customisation of the properties files # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1) LibreSource config file (libresourceConfig.properties) - If you did not generate the configuration file from the build process edit the file in order to configure the following properties. libresource.log.dir : specify where libresource will write its log files. This directory must exist and the user who is running jonas must have the right to write into it. notification.default.type : specify which protocol of notification will be checked by default on the web when a user click on the Watch Event of a resource. (The clue or by the menu) [mail or jabber] jabber.server : Specify the libresource jabber user host that will notify the libresource users of an event. [http://localhost:9000] jabber.username : Name of the jabber user that will be used for the Jabber notification. This Jabber user must already exist on the specified jabber server. jabber.password : Password of the libresource jabber user. kernel.serverUrl : Url given as base path for the web part. The protocol should be provided too as the port if you are not using the default port (80). kernel.indexationDataDir : Directory used by the indexation engine to read and write its index for quick search. This directory should exist. libresource.distributedFilesystem : Directory used to write temporary files between the application server and the database. Both libresource and postgres user should have access in read write. The point (c) explain how to do it. subversion.authz.file.path : File path to the file used in subversion to define the security rights between repositories and users. [PATH/authz.txt] subversion.repository.base.path : Directory that contains all the subversion repository. subversion.create.repository.cmd : Command line that will be executed by the application server (The user that is running the application server) to create a new repository. At the end of that line will be added the name of this repository. subversion.rename.repository.cmd : Command line that will be executed by the application server (The user that is running the application server) to rename an existing repository. At the end of that line will be added the name of the old repository and the new name. a) create a directory for the LibreSource indexation (kernel.indexationDataDir) b) create a directory for the LibreSource file exchange (libresource.distributedFilesystem) c) give to the postgres group the right to use these folders sudo chgrp postgres tmp/files tmp/index sudo chmod g+rwx tmp/files tmp/index - Copy this file to the directory JONAS_ROOT/conf/ 2) Database access (libresourceDS.properties) - If you did not generate the datasource from the build process, edit the file in order to configure the url, user and password to access to your Postgres database. datasource.url jdbc:postgresql://localhost:5432/libresource datasource.username libresource datasource.password XXXXXXXXXX - The other parameters which are given bellow as information shouldn't be changed datasource.name libresourceDS datasource.classname org.postgresql.Driver datasource.mapper rdb.postgres jdbc.connchecklevel 0 jdbc.connmaxage 1440 jdbc.maxopentime 60 jdbc.connteststmt select 1 jdbc.minconpool 2 jdbc.maxconpool 30 jdbc.samplingperiod 30 jdbc.maxwaittime 5 jdbc.maxwaiters 100 - Copy this file to the directory JONAS_ROOT/conf/ 3) Mail Notifications (libresourceMail.properties) [OPTIONAL] - If you did not generate the MailSession from the build process, edit the file in order to configure the mail.from and your smtp host to send mail. mail.from notification@dev.libresource.org mail.smtp.host smtp.XXXXX.XX # The following parameter shouldn't be changed and are given as information mail.factory.name libresourceMail mail.factory.type javax.mail.Session mail.smtp.port 25 - If you want mail notification, copy this file to the directory JONAS_ROOT/conf/ 4) Deployement of the ear - Copy the file LibreSource-VERSION.ear in the directory JONAS_ROOT/apps/autoload/ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Starting/Stoping Jonas/Libresource # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Under Windows: - To start: JONAS_ROOT/bin/nt/jonas.bat start - To stop: JONAS_ROOT/bin/nt/jonas.bat stop Under Linux: - To start: JONAS_ROOT/bin/unix/jonas.sh start - To stop: JONAS_ROOT/bin/unix/jonas.sh stop Default URL used: - http://localhost:9000/ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Optimization # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Depending the amount of memory you have : export JAVA_OPTS="$JAVA_OPTS -server -Xms768m -Xmx768m" - For long execution of the server, we recommand you to execute these commands periodically : + vacuumdb -f libresource ++ you can, for example, use the cron daemon with the following crontab : 1 1 * * * vacuumdb -f -a