First of all, all the versions I use in this tutorial can install sakai 2.9.1, sakai 2.7, sakai 2.8 so you won't need to worry about if they work or not with three versions of sakai I list above.
This is my experiment when I install sakai a lot of times (can not count how many times I install Sakai and how many times I reinstall Window 7)
This is my experiment when I install sakai a lot of times (can not count how many times I install Sakai and how many times I reinstall Window 7)
- Install JDK 1.6:
- Run the set up file jdk-6u24-windows-i586.exe for window 32bit or jdk-6u37-windows-x64 for window 64bit.
- Install JDK into folder C:\opt\Java\jdk. Install JRE into the default folder when it asks (no need to change the default directory of JRE).
- Setup the enviroment variables JAVA_HOME to point to the base directory of your JDK installation and also set JDK's /bin directory into PATH enviroment variable:
- Go to Control panel > System > Advanced system settings > Enviroment variables. Choose New in System variables. Then add:
- Variable name: JAVA_HOME
- Variable value: C:\opt\Java\jdk (the jdk directory we've just installed)
- Then find the PATH variables in System variables, EDIT > insert this line:
- ; C:\opt\Java\jdk\bin (becareful with the semicolon)
- To check it success or not. Go to cmd (window + R then type cmd > enter), type java -version > enter.
- If it's successfully: java version "1.6.0_37"
- Notes:
- Do not let the space in the directory of jdk installation
- Install Maven 2.2.1:
- Download apache-maven-2.2.1-bin and extract it into C:\opt then rename as maven
- Set up the enviroment variables MAVEN_HOME
- Go to Control panel > System > Advanced system settings > Enviroment variables. Choose New in System variables. Then add:
- Variable name: MAVEN_HOME
- Variable value: C:\opt\maven (the jdk directory we've just installed)
- Then find the PATH variables in System variables, EDIT > insert in the end of PATH variable this line:
- ; C:\opt\maven\bin (becareful with the semicolon)
- Notes:
- Do not let the space in the directory of maven installation
- For example:
- Should: C:\opt\maven
- Should not: C:\im checker\maven, C:\Program File\maven
- To check it success or not: Go to cmd (window + R then type cmd > enter), type java -version > enter
- If it's successfully:
Apache Maven 2.2.1 (r801777; 2009-08-07 02:16:01+0700)
Java version: 1.6.0_37
Java home: C:\opt\Java\jdk1.6.0_37\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7" version: "6.1" arch: "amd64" Family: "windows" - Continue setup the MAVEN_OPTS:
- Go to Control panel > System > Advanced system settings > Enviroment variables. Choose New in System variables. Then add:
- Variable name: MAVEN_OPTS
- Variable value: -Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=512m
- This variable value is very important, if something wrong, it will make Permgen space error. I will talk about this later.
- Create a local Maven reposity.
- Go to cmd (window + R then type cmd > enter), type:
- mkdir %HOMEDRIVE%%HOMEPATH%\.m2\repository -> enter
- This command will create a folder with directory:
C:\Users\Your username\.m2\repository - Copy setting.xml file in the below content into .m2 folder we just create above:
<profiles>
<profile>
<id>tomcat5x</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<appserver.id>tomcat5x</appserver.id>
<appserver.home>c:\opt\tomcat</appserver.home>
<maven.tomcat.home>c:\opt\tomcat</maven.tomcat.home>
<sakai.appserver.home>c:\opt\tomcat</sakai.appserver.home>
<surefire.reportFormat>plain</surefire.reportFormat>
<surefire.useFile>false</surefire.useFile>
</properties>
</profile>
</profiles>
</settings>
- The directory C:\opt\tomcat is the directory that we will install Tomcat 5.5.33 later.
- Install Tomcat 5.5.33:
- Download apache-tomcat-5.5.33 (bin), extract it, copy to folder C:\opt > rename "tomcat"
- Set up the enviroment variables CATALINA_HOME
- Go to Control panel > System > Advanced system settings > Enviroment variables. Choose New in System variables. Then add:
- Variable name: CATALINA_HOME
- Variable value: C:\opt\tomcat (the tomcat root folder we've just installed)
- Then find the PATH variables in System variables, EDIT > insert in the end of PATH variable this line:
- ; C:\opt\tomcat\bin (becareful with the semicolon)
- Notes:
- Do not let the space in the directory of tomcat installation
- For example:
- Should: C:\opt\tomcat\, C:\sakai\opt\tomcat\
- Should not: C:\im checker\tomcat, C:\Program File\tomcat
- Copy file setenv.bat with the below content into tomcat directory \bin (C:\opt\tomcat\bin):
set JAVA_OPTS=-server -Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=512m -XX:NewSize=192m -XX:MaxNewSize=384m -Djava.awt.headless=true -Dhttp.agent=Sakai -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Dsun.lang.ClassLoader.allowArraySyntax=true - Notes:
- The JAVA_OPTS and MAVEN_OPTS above must have the same value that I mark it as red color.
- Copy MYSQL Java Connector file (*.jar) into Tomcat folder \common\bin (C:\opt\tomcat\common\lib) for install mysql later.
- Copy index.html file with the below content into tomcat folder \webapps\ROOT (C:\opt\tomcat\webapps\ROOT)
<html>
<head>
<title>Redirecting to /portal</title>
<meta http-equiv="Refresh" content="0:URL=/portal">
</head>
<body bgcolor="#ffffff" onLoad="javascript:window.location='/portal';">
<div style="margin:18px;width:288px;background-color:#cccc99;padding:18px;border:thin solid #666600;text-align:justify">
<p style="margin-top:0px">
You are being redirected to the Sakai portal. If you are not automatically redirected, use the link below to continue:<br/>
<a href="/portal">Take me to the Sakai portal</a>
</p>
</body>
</html> - Create sakai folder in tomcat root directory:
C:\opt\tomcat\sakai - Copy default.sakai.properties file from the below directory:
sakai-src/config/configuration/bundles/src/bundle/org/sakaiproject/config/bundle/default.sakai.properties
- Copy that file into sakai folder you have just created (C:\opt\tomcat\sakai)
- Rename it: default.sakai.properties > sakai.properties
- You have to becareful with this file because if you install sakai with a lot version, such as sakai 2.9.1, sakai 2.8.0, sakai 2.7.0, you can make a mistake that you copy the same sakai.properties file from sakai version 2.7.0 into sakai version 2.8.0 > This will make your sakai install wrong version > failure.
- Run service.bat file. Go to cmd (window + R then type cmd > enter), type:
cd C:\opt\tomcat\binC:\opt\tomcat\bin> service.bat install
C:\opt\tomcat\bin> tomcat5 //US//Tomcat5 ++JvmOptions -Xms512m; -Xmx1024m; -XX:PermSize=128m;-XX:MaxPermSize=512m;-Dfile.encoding=UTF-8; -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false"
C:\opt\tomcat\bin> tomcat5w //ES//Tomcat5 - When it appears a new window. In General tab, choose Automatic in the start type: Then click Start
- Change to the Java tab, insert 2 lines below at the end of Java options:
-Dsun.lang.ClassLoader.allowArraySyntax=true
-Dhttp.agent=Sakai - Then clear the Initial memory pool and Maximum memory pool values.
- After all, click Apply.
- Install Sakai source 2.8:
- Download sakai-src-2.8.0. Copy to folder C:\opt. Rename to "sakai"
- Deploy Sakai:
- Go to cmd (window + R then type cmd > enter), type:
cd C:\opt\sakai\master
C:\opt\sakai\master mvn clean install - You have to wait about 3 minutes. Then type,
cd C:\opt\sakai
C:\opt\sakai mvn clean install sakai:deploy -Dmaven.tomcat.home=C:\opt\tomcat - Waiting about 2 or 3 hours depend on your network to finish the installation. (This is my result)
- After all, you just go to cmd: type, startup.bat to run tomcat.
- Go to your browser: http://localhost:8080/ to enjoy the result.
- If you want to close the sakai: go to cmd > shutdown.bat
- This version will work on HSQLDB. If you want to custom database, you have to install Sakai with MYSQL.
- Install Mysql:
- In this tutorial, I install Sakai with Mysql (XAMPP version 6.7)
- Open file sakai.properties in folder C:\opt\tomcat\sakai (we created in number 3).
- Find and comment the below line in the HSQLDB setting part
- ## HSQLDB settings – on by default
- #vendor@org.sakaiproject.service.framework.sql.SqlService=hsqldb
- #driverClassName@javax.sql.BaseDataSource=org.hsqldb.jdbcDriver
- #hibernate.dialect=org.hibernate.dialect.HSQLDialect
- #validationQuery@javax.sql.BaseDataSource=select 1 from SYSTEM_USERS
- # two hsqldb storage options: first for in-memory (no persistence between runs), second for disk based
- #url@javax.sql.BaseDataSource=jdbc:hsqldb:
- #url@javax.sql.BaseDataSource=jdbc:hsqldb:${sakai.home}/db/sakai.db
- Find and edit this below line:
- Set username@javax.sql.BaseDataSource=sakaiuser
- Set password@javax.sql.BaseDataSource=sakaipassword
- sakaiuser is the username, sakaipassword is the password to access the database I will introduce to you later.
- Find and uncomment the below lines:
## 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.MySQLDialect
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 - Set up the enviroment variables MYSQL_HOME
- Go to Control panel > System > Advanced system settings > Enviroment variables. Choose New in System variables. Then add:
- Variable name: MYSQL_HOME
- Variable value: C:\xampp\mysql (folder mysql in XAMPP)
- Then find the PATH variables in System variables, EDIT > insert in the end of PATH variable this line:
- ; C:\xampp\mysql\bin (becareful with the semicolon)
- Go to your phpmyadmin, in my case is http://localhost/phpmyadmin/
- Go to SQL tab in your phpmyadmin and paste the below lines:
create database sakai default character set utf8;
grant all on sakai.* to sakaiuser@'localhost' identified by 'sakaipassword';
grant all on sakai.* to sakaiuser@'127.0.0.1' identified by 'sakaipassword';
flush privileges; - sakaiuser and sakaipassword is the two values that I concern when we change the sakai.properties file.
- Finally, you have to go to cmd. Enter the command shutdown.bat then startup.bat again. Turn your browser on and enter http://localhost:8080/portal
- Enjoy your Sakai.
- Hope this tutorial will help you install Sakai more easier.
Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)
please tell me why there can be such a problem? I can not go to http://localhost:8080/portal
ReplyDeleteHTTP Status 404 - /portal
--------------------------------------------------------------------------------
type Status report
message /portal
description The requested resource is not available.
--------------------------------------------------------------------------------
Apache Tomcat/7.0.37