[Building Sakai] My Notes for Installing Sakai 2.7.0 on Debian
Warwick Chapman
warwickchapman at gmail.com
Tue Aug 10 04:05:58 PDT 2010
*Installing Sakai Application Server (app01.example.com)*
Add "non-free" to /etc/apt/sources.list:
deb http://ftp.de.debian.org/debian lenny main
deb http://ftp.de.debian.org/debian lenny non-free
deb http://security.debian.org/
lenny/updates<http://security.debian.org/lenny/updates>
main
deb http://security.debian.org/
lenny/updates<http://security.debian.org/lenny/updates>
non-free
Update aptitude and install Java 6 (
http://library.linode.com/development/frameworks/java/apache-tomcat/debian-5-lenny
):
aptitude update
aptitude install sun-java6-jdk
Install Tomcat from Apache package, Debian package doesn't play nice:
cd /opt
wget
http://ftp-stud.hs-esslingen.de/pub/Mirrors/ftp.apache.org/dist/tomcat/tomcat-5/v5.5.28/bin/apache-tomcat-5.5.28.tar.gz
tar xzf apache-tomcat-5.5.28.tar.gz
mv apache-tomcat-5.5.28 tomcat
Install Maven from Apache package, Debian package (2.0.9) is too old:
cd /opt
wget
http://ftp-stud.hs-esslingen.de/pub/Mirrors/ftp.apache.org/dist/maven/binaries/apache-maven-2.2.1-bin.tar.bz2
tar xjf apache-maven-2.2.1-bin.tar.bz2
mv apache-maven-2.2.1 maven2
Set Java environment variables in /etc/profile:
...
export PATH
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export JAVA_OPTS='-Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=512m
-XX:NewSize=192m -XX:MaxNewSize=384m -verbose:gc -XX:+PrintGCDetails
-XX:+PrintGCTimeStamps -Djava.awt.headless=true -Dhttp.agent=Sakai
-Dsakai.demo=true
-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false
-Dsun.lang.ClassLoader.allowArraySyntax=true'
export CATALINA_HOME=/opt/tomcat
export MAVEN_HOME=/opt/maven2
export MAVEN_OPTS='-Xms256m -Xmx512m -XX:PermSize=64m -XX:MaxPermSize=128m'
export PATH=$PATH:$JAVA_HOME/bin:$CATALINA_HOME/bin:$MAVEN_HOME/bin
umask 022
Logout, log back in and check variables are set:
set | grep PATH && set | grep CATA && set | grep MAVEN
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-6-sun/bin:/opt/tomcat/bin:/opt/maven2/bin
CATALINA_HOME=/opt/tomcat
MAVEN_HOME=/opt/maven2
MAVEN_OPTS='-Xms256m -Xmx512m -XX:PermSize=64m -XX:MaxPermSize=128m'
Create Maven repository:
mkdir -p .m2/repository
Create Maven config file in ~/.m2/settings.xml:
<settings xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>tomcat5x</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<appserver.id>tomcat5x</appserver.id>
<appserver.home>/opt/tomcat</appserver.home>
<maven.tomcat.home>/opt/tomcat</maven.tomcat.home>
<sakai.appserver.home>/opt/tomcat</sakai.appserver.home>
<surefire.reportFormat>plain</surefire.reportFormat>
<surefire.useFile>false</surefire.useFile>
</properties>
</profile>
</profiles>
</settings>
Install Subversion:
aptitude install subversion
Get Sakai source code (below is the 2.7.x branch, you probably want to check
out a stable tag: current 2.7.0):
svn co https://source.sakaiproject.org/svn/sakai/branches/sakai-2.7.x/
sakai-2.7.x
[
Current 2.7.0 tag:
svn co https://source.sakaiproject.org/svn/sakai/tags/sakai-2.7.0
]
Compile Sakai:
cd sakai-2.7.x/master/
mvn clean install
cd ..
mvn clean install sakai:deploy
Configure Sakai:
cp
/root/sakai-2.7.x/config/configuration/bundles/src/bundle/org/sakaiproject/config/bundle/default.sakai.properties
$CATALINA_HOME/sakai/sakai.properties
Once completed /opt/tomcat/webapps should be populated with Sakai module
directories and their corresponding .war files.
Edit $CATALINA_HOME/sakai/sakai.properties:
serverId=app01
serverUrl=http://app01.example.com:8080
serverName=app01.example.com
smtp at org.sakaiproject.email.api.EmailService=localhost
msgcntr.notification.user.real.from = true
msgcntr.notification.from.address = noreply at example.com
display.users.present=true
ui.institution = Example, Inc
ui.service = LocalSakaiName
bottomnav.count=3
bottomnav.1=<a href="/portal/site/!gateway">Gateway</a>
bottomnav.2=<a href="http://www.example.com">Example, Inc </a>
bottomnav.3=<a href="http://www.sakaiproject.org/" target="_blank">The Sakai
Project</a>
username at javax.sql.BaseDataSource=sakai
password at javax.sql.BaseDataSource=dbpass
auto.ddl=true
vendor at org.sakaiproject.db.api.SqlService=mysql
driverClassName at javax.sql.BaseDataSource=com.mysql.jdbc.Driver
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
url at javax.sql.BaseDataSource
=jdbc:mysql://db01:3306/sakai?useUnicode=true&characterEncoding=UTF-8
validationQuery at javax.sql.BaseDataSource=select 1 from DUAL
defaultTransactionIsolationString at javax.sql.BaseDataSource
=TRANSACTION_READ_COMMITTED
portal.use.dhtml.more = true
content.html.forcedownload = false
Install MySQL J Connector:
wget
http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.12.tar.gz/from/http://ftp.gwdg.de/pub/misc/mysql/<http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.12.tar.gz/from/http:/ftp.gwdg.de/pub/misc/mysql/>
tar xzf mysql-connector-java-5.1.12.tar.gz
cp /root/mysql-connector-java-5.1.12/mysql-connector-java-5.1.12-bin.jar
$CATALINA_HOME/common/lib
Configure default redirect in $CATALINA_HOME/webapps/ROOT/index.html:
<html>
<head>
<title>Redirecting to /portal</title>
<meta http-equiv="Refresh" content="0:URL=/portal">
</head>
<body bgcolor="#ffffff" onLoad="javascript:window.location='/portal';">
</body>
</html>
Start Tomcat:
$CATALINA_HOME/bin/startup.sh
Watch catalina.out until you (hopefully) see:
tail -f $CATALINA_HOME/logs/catalina.out
...
INFO main org.apache.catalina.startup.Catalina - Server startup in 167026 ms
(Or, hopefully not, watch for errors during startup)
Test the application is running and serving pages:
http://app01.example.com:8080/portal/<http://opportunity.da.org.za:8080/portal/>
TODO Set Tomcat to start on boot:
*Install MySQL Server (db01.example.com)*
Note: Install of MySQL server will not complete successfully if /tmp is not
writeable by non-root user. Ensure permissions are 1777 (chmod 1777 /tmp).
Install MySQL and set password when prompted to same as the one configured
with password at javax.sql.BaseDataSource in sakai.properties above:
aptitude install mysql-server
Create Sakai DB:
mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 51 to server version: 4.1.5-gamma-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database sakai default character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on sakai.* to sakai@'localhost' identified by '<password>';
Query OK, 0 rows affected (0.00 sec
mysql> grant all on sakai.* to sakai@'127.0.0.1' identified by '<password>';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Configure Connector in tomcat/conf/server.xmk for UTF-8:
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"*
URIEncoding="UTF-8"*/>
*Configure Mail Service (app01.example.com)*
dpkg-reconfigure exim4-config
1. General type of mail configuration: internet site
2. System name: app01.example.com
3. IP Addresses: 127.0.0.1
4. Other domains for which to receive mail: localhost.localdomain
5. Domains to relay mail for: blank
6. Machines to relay mail for: blank
7. Dial-on-Demand: No
8. Delivery method: Maildir
9. Split configuration into small files: No
-- Warwick Bruce Chapman | +27 83 7797 094 | http://warwickchapman.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20100810/ccbfabfe/attachment.html
More information about the sakai-dev
mailing list