Mostrando las entradas con la etiqueta Java. Mostrar todas las entradas
Mostrando las entradas con la etiqueta Java. Mostrar todas las entradas

domingo, febrero 22, 2009

Installation of Sakai 2.5 under Solaris 10u6 using MySQL 5.1 CS

Sakai is a great virtual collaboration and learning environment designed mainly for research activities. It' s written in Java using a several open source componets such that: apache maven, apache tomcat, hibernate and others. Sakai is published under terms of Educational Community License v. 1.0., which is certified for OSI Initiative. More information about Sakai:
Enlace

Well, and now, i'm going to describe the installation process of Sakai from the sources under Solaris 10 OS (update 6), using the MySQL Server version 5.1 (Community Server). I think, this same instructions can be usefull for OpenSolaris (and Linux distros, with some changes !)

The summary of installation process:
  1. Download the Sakai sources and other components as the servlet container, the Java SDK, etc,,
  2. Install the database server (in this case MySQL) and create the Sakai's database.
  3. Create the environment to compile and deploy Sakai.
  4. Compile and deploy Sakai
  5. Connect Sakai with database Server.
  6. Start the Tomcat Server

Step 1: Download the necessary software:

To compile an deploy Sakai, with MySQL support, we need:

All this software may be downloaded on /opt directory, although you can choose another location.

Remark: The shell used for installation process is Bash. If you use another shell, for instance KSH or C-Shell, consult the documentation for export environment variables and execute files.

Step 2: Install the MySQL Server

Before to install the MySQL server, you must to create the mysql user and group:

# groupadd mysql
# useradd -d /var/lib/mysql -s /bin/bash mysql
# usermod -G mysql mysql

And now, we can to install and start the MySQL server:

# cd /opt
# gunzip mysql-5.1.31-solaris10-i386.pkg.gz
# pkgadd -d mysql-5.1.31-solaris10-i386.pkg all
# /etc/init.d/mysql start

Add the mysql commands to the PATH:

# export PATH=$PATH:/opt/mysql/mysql/bin

Verify the connection: (The root user has an empty password )

# mysql -u root -p

Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.31 MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

Create the Sakai database:

mysql> create database sakai default character set utf8;
Query OK, 1 row affected (0.00 sec)

Note: If you want, you can to add the mySQL service as part of SMF. See: http://pastebin.com/f2c7200bd

For step 3 and 4, the main reference is the install guide of Sakai 2.4.5, however it can be summarized:

Step 3: Create the environment to compile and deploy Sakai:


# cd /opt
# tar xzf apache-tomcat-5.5.26.tar.gz
# tar xzf apache-maven-2.0.10-bin.tar.gz
# ln -s apache-tomcat-5.5.26 tomcat
# ./jdk-1_5_0_17-solaris-i586.sh
# export JAVA_HOME=/opt/jdk1.5.0_17
# export PATH=$PATH:$JAVA_HOME/bin
#export JAVA_OPTS="-server -Xms768m -Xmx768m -XX:PermSize=128m -XX:MaxPermSize=256m -XX:NewSize=192m -XX:MaxNewSize=384m"
# export CATALINA_HOME=/opt/tomcat
# export PATH=$PATH:/opt/tomcat/bin
# export MAVEN_HOME=/opt/apache-maven-2.0.10/
# export PATH=$PATH:/opt/apache-maven-2.0.10/bin
#export MAVEN_OPTS='-Xms256m -Xmx512m -XX:PermSize=64m -XX:MaxPermSize=128m'Enlace# cd $HOME
# mkdir -p .m2/repository
# vi .m2/settings.xml /* with this content: See: Install Guide of Saka 2.5.4. section Maven; subsection: create a maven settings.xml file. */



After, create the setenv.sh file in /opt/tomcat/bin, with this content:

export JAVA_OPTS="-server -XX:+UseParallelGC -Xmx768m -XX:MaxPermSize=160m -Djava.awt.headless=true"


Note: You can save the environment variables declared above in your .bashrc file.

Modify the /opt/tomcat/bin/catalina.sh file and change the shell binary:

#!/bin/sh for:
#!/bin/bash

Step 4: Compile and deploy Sakai:

# cd /opt
# tar xzf sakai-src-2.5.4.tar.gz
# cd sakai-src-2.5.4/master
# mvn clean install
(outpur truncated ...)
# cd ..
# mvn clean install sakai:deploy -Dmaven.tomcat.home=/opt/tomcat
(meanwhile you can drink a coffee! )

If the Build is successfull, you can to go a the next step ....

Step 5: Connect Sakai with database Server.

# tar xvzf mysql-connector-java-5.1.7.tar.gz
# cp mysql-connector-java-5.1.7/*.jar /opt/tomcat/common/lib

Copy the sakai.properties file located at:

/opt/sakai-src-2.5.4/component/component-api/component/src/config/org/sakaiproject/config/sakai.properties

to /opt/tomcat/sakai

To add the information about the database vendor (MySQL), change for the
appropriate values:

# Usser and password to database access:

username@javax.sql.BaseDataSource=root
password@javax.sql.BaseDataSource=123456

# MySQL settings - make sure to alter as appropriate
vendor@org.sakaiproject.db.api.SqlService=mysql
driverClassName@javax.sql.BaseDataSource=com.mysql.jdbc.Driver
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
url@javax.sql.BaseDataSource=jdbc:mysql://127.0.0.1:3306/sakai?useUnicode=true&characterEncoding=UTF-8
validationQuery@javax.sql.BaseDataSource=select 1 from DUAL
defaultTransactionIsolationString@javax.sql.BaseDataSource=TRANSACTION_READ_COMMITTED

Step 6: Start the tomcat server:

To finish:

# startup.sh

Ready, Sakai is installed !. To access it: http://{server-name}:8080/portal


domingo, octubre 07, 2007

Release de sFourier 0.3a

Como lo dije aqui, hace algo de tiempo estaba junto con otros compañeros escribiendo un programa para aprendizaje de Series de Fourier. Las primeras versiones del programa permitian simular la vibración de una cuerda que estaba fija en sus extremos, como se explica aqui [PDF, PS] y para ello utilizamos Python como lenguaje junto con otros módulos, como VPython y wxPython. Así lucía sFourier (aunque para ese entonces el programa no estaba bautizado) hace unos meses:


Después de algunas discusiones y luego de apegarnos a un modelo de desarrollo mucho más estructurado y funcional que el que veniamos utiizando, se decidió cambiar a Java como lenguaje, debido a que la experiencia de los programadores era mucho mejor que la que se tenía en Python y se generó una segunda perspectiva de aplicación:




que permitía además de simular la vibración de la cuerda, calcular series de Fourier de funciones lineales continuas a trozos y comparar la vibración de dos cuerdas. Esta versión sirvió de base afinar muchos aspectos de lógica de la aplicación, así como de interfaz. Sin embargo, debido a un problema con la presentación de algunas gráficas, se buscaron mejores formas de llevar a cabo los métodos de simulación de la cuerda y presentación de espectros de amplitudes y se generó una última versión:


que después de varios ajustes se convirtió en la versión 0.3a (alpha) de sFourier y la primera que se encuentra lista para el usuario. sFourier 0.3a cuenta con las siguientes funcionalidades:

  • Simulación del fenómeno de la cuerda vibrante, permitiendo observar modos normales de vibración individuales y en suma, además de los espectros de amplitud.
  • Módulo de comparación entre cuerdas, que permite simular simultáneamente dos cuerdas vibrantes con parámetros de tensión y densidad diferentes.
  • Aproximación por Series de Fourier de funciones lineales contínuas a trozos, permitiendo observar las gráficas de la aproximación, términos individuales de la Serie de Fourier o sumados y el espectro de amplitudes.
La página oficial del proyecto es:

http://sfourier.sourceforge.net

El proyecto como pueden darse cuenta (versión 0.3a !) aún es muy jóven, pero esperamos poder liberar más versiones con muchas más funcionalidades y mejoras. Lo que esperamos para la próximas versiones es:

  • Corregir todos los bugs conocidos
  • Permitir definir funciones polinómicas y trigonométricas
  • Mejorar el algoritmo de verificación de funciones
  • Añadir una interfaz más cómoda para el ingreso de funciones
  • Presentar los coeficientes de Fourier después de calcular la serie de Fourier correspondiente
  • Añadir otros fenómenos físicos como la membrana vibrante.
  • Mostrar el espectro de fase
y todo aquello que se nos siga ocurriendo. Desde luego que sFourier es software libre !!!.