当前位置: 首页 > 工具软件 > Sakai > 使用案例 >

编译sakai10.6

徐昊焜
2023-12-01

OS:centos 6.4


1 java1.7

source tomcat/bin/setenv

[root@localhost bin]# pwd
/home/sakai/tomcat7/bin

此处我是用北邮的已经做好的,无需安装的jdk,jre


2 mysql 5.7

/etc/my.cnf

参考附件

3 sakai数据库

创建数据库

use mysql;

CREATE USER 'sakai' IDENTIFIED BY 'sakai';
flush privileges;

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

3修改setenv.sh

参考附件

3.1增加java变量

3.2增加tomcat变量

3.3增加path加入catalina_home

4 maven增加settings.xml

主要指定apphome的位置

5 tomcat7 conf的一些修改

tomcat7使用北邮的版本,不用安装

主要是编译加速,

增加对之前tomcat的兼容

6 svn代码

来自官网版本10.6

7编译

7.1在编译之前先source引入变量

source /home/sakai/tomcat7/bin/setenv.sh

source是不错的构建独立环境的方法

7.2

参考:

https://confluence.sakaiproject.org/display/BOOT/Development+Environment+Setup+Walkthrough


附件setenv.sh

[root@localhost .m2]# cat /home/sakai/tomcat7/bin/setenv.sh
#!/bin/bash
USER_DIR="/home/sakai"

export LANG="zh_CN.UTF-8"
export LC_ALL="zh_CN.UTF-8"

export JAVA_HOME="$USER_DIR"/jdk1.7
export JRE_HOME=$JAVA_HOME/jre

export MAVEN_OPTS='-Xms128m -Xmx796m -XX:PermSize=64m -XX:MaxPermSize=172m'
export CATALINA_HOME="$USER_DIR"/tomcat7

export PATH=$JAVA_HOME/bin:$CATALINA_HOME/bin:$PATH:$HOME/bin

#export CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib:/usr/local/apr/lib:$CLASSPATH
#export CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$CLASSPATH
export CLASSPATH=.:${JAVA_HOME}/lib/tools.jar:${JAVA_HOME}/lib/dt.jar

export CATALINA_PID="$CATALINA_HOME"/pid/tomcat.pid

export JAVA_OPTS='-server -Xms1024m -Xmx2048m -XX:PermSize=256m -XX:MaxPermSize=512m -Dhttp.agent=Sakai -XX:NewSize=512m -XX:MaxNewSize=512m -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Djava.awt.headless=true -Dcom.sun.management.jmxremote -Dsun.lang.ClassLoader.allowArraySyntax=true -Dfile.encoding=utf-8 -Dsun.jnu.encoding=utf-8 -Duser.language=zh -Djava.util.Arrays.useLegacyMergeSort=true -Dsakai.demo=true'
#export JAVA_OPTS="-server -Xmx1028m -XX:MaxPermSize=320m -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Djava.awt.headless=true -Dcom.sun.management.jmxremote"
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$CATALINA_HOME:$PATH

[root@localhost .m2]#
注意官网说-Dsakai.demo=true只是初始化时用一次就可以了。


附件my.cnf

[root@localhost bin]# mvn --version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-15T01:29:23+08:00)
Maven home: /usr/share/apache-maven
Java version: 1.8.0_05, vendor: Oracle Corporation
Java home: /usr/java/jdk1.8.0_05/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-504.8.1.el6.x86_64", arch: "amd64", family: "unix"
[root@localhost bin]# cat /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html

[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
default-storage-engine = InnoDB
innodb_file_per_table
character-set-server=utf8
collation-server=utf8_general_ci
lower_case_table_names = 1
slow-query-log=1
long_query_time=1
slow_query_log_file=/tmp/mysql-slow-query.log
expire_logs_days=5
[root@localhost bin]#


 类似资料: