Setting up Sakai involves several steps, ranging from installing the software on a server to configuring it for use by instructors and students. Below is a general guide for setting up Sakai:
Before you start the installation, ensure that you have the necessary environment and dependencies in place:
git clone https://github.com/sakaiproject/sakai.git
Install the appropriate JDK if it’s not already installed:
sudo apt update
sudo apt install openjdk-11-jdk
Confirm Java is installed:
java -version
Install and configure MySQL or MariaDB:
sudo apt update
sudo apt install mysql-server
Once installed, set up the Sakai database:
mysql -u root -p
CREATE DATABASE sakaidb DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'sakaiuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON sakaidb.* TO 'sakaiuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Install Apache Maven, which is used to build Sakai:
sudo apt install maven
Navigate to the cloned Sakai directory and build the application using Maven:
cd sakai
mvn clean install
Before deployment, configure Sakai’s settings:
sakai/config folder.sakai.properties file to set your database connection, server URL, and other settings.cd sakai/config
nano sakai.properties
Add the following database configuration (modify as needed):
url@javax.sql.BaseDataSource=jdbc:mysql://localhost/sakaidb?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username@javax.sql.BaseDataSource=sakaiuser
password@javax.sql.BaseDataSource=password
Install Apache Tomcat, which will serve the Sakai application:
sudo apt install tomcat9
Copy the Sakai webapps into the Tomcat directory:
cp sakai/pack/target/sakai /var/lib/tomcat9/webapps/
After copying the Sakai webapps folder to Tomcat, make sure Tomcat can properly serve Sakai. You can check the configuration and permissions to ensure everything is in place.
Set the proper file permissions for Tomcat to run Sakai. For example, on Linux, you might need to do:
sudo chown -R tomcat:tomcat /var/lib/tomcat9/webapps/sakai
Start or restart the Tomcat service to deploy Sakai:
sudo systemctl restart tomcat9
Check that Tomcat is running and that Sakai is being served by visiting your server’s IP or domain name followed by the port (if necessary):
http://your-server-ip:8080/
If everything was set up correctly, you should see the Sakai login screen.
When Sakai first runs, it will automatically create the necessary database tables if you’ve properly configured your sakai.properties file. Ensure that the database connection is working by checking the logs located in:
/var/lib/tomcat9/logs/catalina.out
If there are any issues connecting to the database, double-check your database configuration and sakai.properties settings.
If you are running Sakai in a production environment, consider applying the following additional configurations:
Set Environment Variables: In your sakai.properties, specify important settings such as the server URL, mail configuration (if you’re using it), etc.
Configure Email: If your Sakai instance will be sending emails (e.g., for notifications), configure the SMTP settings in sakai.properties:
smtp@org.sakaiproject.email.api.EmailService=smtp.yourdomain.com
smtpFrom@org.sakaiproject.email.api.EmailService=your-email@yourdomain.com
Enable SSL (HTTPS): It is highly recommended to configure HTTPS for a production deployment. You can do this by setting up a reverse proxy server like Nginx or using Tomcat’s built-in SSL features.
Increase Memory Limits: Modify the memory settings for Tomcat to handle more significant loads by editing the Tomcat service file or setenv.sh:
CATALINA_OPTS="-Xms2g -Xmx4g -XX:+UseG1GC"
Once the installation is complete, you can log in to Sakai using the default administrator credentials:
adminadminUpon logging in, you’ll be prompted to change the password for security reasons.
webapps directory.mysqldump for backing up the MySQL database:mysqldump -u sakaiuser -p sakaidb > /path/to/backup/sakai-backup.sql