Saturday, August 2, 2014

Install Libreplan on MySql


Install Libreplan on MySql


This instructions assume that you have already installed MySql, Tomcat is installed at <TOMCAT_HOME> and is the first libreplan installation.
Stop Tomcat:

$ sudo launchctl unload /Library/LaunchDaemons/org.apache.tomcat.plist
Download libreplan mysql version from https://sourceforge.net/projects/libreplan/files/LibrePlan/:

install_mysql_1.4.0.sql
libreplan_mysql_1.4.0.war

Download MySql JDBC driver from here - MySQL JDBC Driver Download Here.
Move the mysql-connector-java-5.1.31-bin.jar (or newer version) to <TOMCAT_HOME>/lib folder.

Open a terminal on the folder where you downloaded the install_mysql_1.4.0.sql and libreplan_mysql_1.4.0.war files.

Log on MySql and create a user and a database for libreplan. Then switch to the new database and run the install_mysql_1.4.0 script:

$ mysql mysql -u root
mysql>
mysql> CREATE USER 'libreplan'@'localhost' IDENTIFIED BY 'libreplan';
Query OK, 0 rows affected (0.23 sec)

mysql> CREATE DATABASE libreplan;
Query OK, 1 row affected (0.09 sec)

mysql> GRANT ALL ON libreplan.* TO 'libreplan'@'localhost';
Query OK, 0 rows affected (0.23 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.23 sec)

mysql> connect libreplan;
Connection id:    91
Current database: libreplan

mysql> \. install_mysql_1.4.0.sql
Query OK, 1 row affected (0.00 sec)

Query OK, 0 rows affected (0.12 sec)

...(a lot of this until the end of the script)...

Query OK, 0 rows affected (0.19 sec)
Records: 0  Duplicates: 0  Warnings: 0

Query OK, 1 row affected (0.01 sec)

mysql> exit

Edit the context xml file: <TOMCAT_HOME>/conf/context.xml and add the following content after <Context> tag:

<Resource name="jdbc/libreplan-ds" auth="Container"
         type="javax.sql.DataSource"
         driverClassName="com.mysql.jdbc.Driver"
         url="jdbc:mysql://localhost:3306/libreplan"
         username="libreplan"
         password="libreplan"
         maxActive="100"
         maxIdle="30"
         maxWait="10000"
         validationQuery="Select 1" />


Copy the libreplan war file renaming it to libreplan.war. This is important or your url will be: http://localhost:8080/libreplan_mysql_1.4.0/
$ cp libreplan_mysql_1.4.0.war <TOMCAT_HOME>/webapps/libreplan.war

Start Tomcat:

$ sudo launchctl load /Library/LaunchDaemons/org.apache.tomcat.plist

You will find LibrePlan at:

http://localhost:8080/libreplan

No comments:

Post a Comment