...
Install/Verify you have Java 1.7
Include Page Install Java 1.67+ Install Java 1.67+ Install/Verify you have MySQL 5.1 or later
Include Page Install MySQL 5.1 Install MySQL 5.1 Setup Sakai DB (schema) and user
- Create the sakai database and sakai user (password=ironchef)
Run the following from a command line prompt:
No Format mysql -urootu root -pmysqlpwd1p
- Note: You can also do the following if you prefer to be prompted for the password: mysql -uroot -p
Then run these commands from the mysql prompt (one command per line):
No Format create database sakai default character set utf8; grant all privileges on sakai.* to 'sakai'@'localhost' identified by 'ironchef'; grant all privileges on sakai.* to 'sakai'@'127.0.0.1' identified by 'ironchef'; flush privileges; quit
- [Optional] Download and install mysql query browser
- http://dev.mysql.com/downloads/query-browser/1.1.html
- You do not have to do anything with query browser now
Download and setup Maven 2.2.x+ stable package
Include Page Install Maven 2.2+ Install Maven 2.2+ Install/Verify you have Subversion
Include Page Install Subversion Install Subversion Download and setup tomcat 7.0.21+ (stable only)
Include Page Install Tomcat 7 / 8 Install Tomcat 7 / 8 Download and setup MySQL Connector/J stable
Include Page Install Mysql Connector 5+ Install Mysql Connector 5+ Use Subversion to download sakai code (Sakai 10 and earlier) or use Git/Github to download sakai code (Sakai 11 and later)
- Change to the /opt directory
- Checkout source from trunk (absolute latest stuff) or a release branch or tag:
- Trunk: svn checkout https://source.sakaiproject.org/svn/sakai/trunk/ sakai-trunk
2.9.x Branch: svn checkout https://source.sakaiproject.org/svn/sakai/branches/sakai-2.9.x/
Tip title Alternative Sakai 2.9.x repository Should you run into errors related to missing dependencies when building source from the above repository with Maven (Step 11 below), attempt to checkout from https://source.sakaiproject.org/svn/sakai/branches/sakai-2.9.x-all instead
- If you want a version other than these, browse the tags and branches at https://source.sakaiproject.org/svn/sakai/
- Checkout will take about 5-10 minutes
- The directory created by subversion will be referred to as <sakai-src> directory (this could be whatever you want; above examples use 'sakai-trunk' and 'sakai-2.9.x')
Setup sakai.properties file
- Create sakaidirectory in $CATALINA_HOME
- $CATALINA_HOME should be /opt/tomcat if you have been following these instructions
- Copy the default config from default.sakai.properties to $CATALINA_HOME/sakai/sakai.properties
- The default configuration template is at https://source.sakaiproject.org/svn/config/trunk/configuration/bundles/src/bundle/org/sakaiproject/config/bundle/default.sakai.properties.
- Edit the sakai.properties file for a MySQL dev environment. Starting at the section marked # DATABASE:
- Set BaseDataSource username
- Set username@javax.sql.BaseDataSource=sakai
- Set BaseDataSource password
- Set password@javax.sql.BaseDataSource=ironchef
Find the section: # HSQLDB settings and verify following lines are commented out
No Format # HSQLDB settings (DEFAULT) #vendor@org.sakaiproject.db.api.SqlService=hsqldb #driverClassName@javax.sql.BaseDataSource=org.hsqldb.jdbcDriver #hibernate.dialect=org.hibernate.dialect.HSQLDialect #validationQuery@javax.sql.BaseDataSource=select 1 from INFORMATION_SCHEMA.SYSTEM_USERS # Two hsqldb storage options: first for in-memory (no persistence between runs), second for disk based. #url@javax.sql.BaseDataSource=jdbc:hsqldb:mem:sakai #url@javax.sql.BaseDataSource=jdbc:hsqldb:file:${sakai.home}db/sakai.db
Find the section: # MySQL settings and uncomment the 6+ lines in it
No Format # MySQL settings vendor@org.sakaiproject.db.api.SqlService=mysql driverClassName@javax.sql.BaseDataSource=com.mysql.jdbc.Driver hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect 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 BaseDataSource username
Save the changes to the sakai.properties file
- Create sakaidirectory in $CATALINA_HOME
Create maven settings.xml file
Include Page Maven 2.x settings.xml file Maven 2.x settings.xml file Use Maven to build Sakai
- Open a command line shell
- Change directory to /opt/<sakai-src>
- Execute mvn clean install to build Sakai using maven
- Note: The build will take an extra 5-10 minutes to download dependencies the first time
- Execute mvn sakai:deploy to deploy Sakai to your tomcat using maven
- Partial builds are supported by the maven2 build system
You can now do a "mvn clean install sakai:deploy" from any subdirectory and build just that code - Once you have downloded the jars you can run maven off-line with mvn -o clean install sakai:deploy
Start Tomcat and check to make sure Sakai runs
Start tomcat using $CATALINA_HOME/bin/startup
Tip title Viewing an active launch log in Linux If you are in Linux you can view the activity log as its generated by using "# ./catalina.sh run" from Tomcat's bin directory instead of startup.sh. This is helpful for viewing potential errors as they happen or to know if Tomcat has locked-up during a launch. A launch will have completed when "INFO: Server startup in xxxx ms" is displayed in the terminal.
- Allow 1 minute+ for tomcat to start up
- Open http://localhost:8080/ to verify tomcat is running
- Open http://localhost:8080/portal to verify sakai is running
- Login to sakai as username:admin, password:admin
- Shutdown Tomcat using $CATALINA_HOME/bin/shutdown
Install Eclipse 3.2+ stable
Include Page Install Eclipse 3.2+ Install Eclipse 3.2+ Add subclipse to Eclipse
Include Page Install Subclipse Install Subclipse Add Maven Eclipse Plugin to Eclipse
Include Page Install Maven Eclipse Plugin Install Maven Eclipse Plugin Add Lombok plugin to Eclipse [OPTIONAL]
- Lombok Library - http://projectlombok.org/download.html
- Shutdown eclipse
- Follow the steps on the page linked above
- Restart eclipse
- NOTE: this is only required for certain parts of the code that use the lombok library (a limited set)
Import Sakai source code into Eclipse
Include Page Import Sakai source into Eclipse Import Sakai source into Eclipse