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

jueves, mayo 21, 2009

Bloqueo de cuentas de usuario en Solaris/OpenSolaris y Linux

En el siguiente artículo expongo una corta descripción acerca del bloqueo de cuentas de usuario tanto en Solaris/OpenSolaris como en Linux. El artículo completo se puede descargar de:

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