Page tree
Skip to end of metadata
Go to start of metadata

1.0 创建 sakai.properties 文件 

sakai.properties 是Sakai的配置文件,一般存放在Tomcat安装目录的/sakai目录中,文件已简单的 键/值 方式存储配置,并通过 java.util.properties 进行加载。所有的配置在启动时读取,所以,对于此文件的修改只有在重启Tomcat之后才会生效。

如果通过源代码安装Sakai,默认的 default.sakai.properties 文件在如下位置,其中也包括了对于这些参数的说明:

sakai-src/config/configuration/bundles/src/bundle/org/sakaiproject/config/bundle/default.sakai.properties

(warning) bin和demo版本不包括此文件。

如果您向覆盖默认值,您必须自己创建 sakai.properties 文件,并在其中进行相应设置。

在设置完成后,将这些文件复制到相应的位置。

在Sakai中,可以通过几个配置文件来进行设置,当这些文件中的配置项不同时,将通过下列顺序进行读取(后面文件中的设置会覆盖前面文件的设置)

  1. 源文件中的default.sakai.properties
  2. ${sakai.home}/sakai.properties  (如果环境变量sakai.home没有额外设置,默认为${CATALINA_HOME/sakai}
  3. ${sakai.home}/local.properties
  4. ${sakai.security}/security.properties

如果需要指定sakai.home的值,可以通过下面的JAVA_OPTS参数进行:

-Dsakai.home=/path/to/desired/sakai/home/
 

2.0 为 我的工作空间 配置工具

每种类型站点主页中的工具可以通过下面的方式进行设置。如果相关属性没有设置,那么默认值为:sakai.iframe.sitesakai.summary.calendarsakai.synoptic.announcementsakai.synoptic.chatsakai.synoptic.messagecenter。如果不存在对应工具,相关部分在显示时会被略去。更多信息参考 SAK-15504 - Getting issue details... STATUS  和  SAK-16747 - Getting issue details... STATUS
wsetup.home.toolids.count=5
wsetup.home.toolids.1=sakai.privacy
wsetup.home.toolids.2=sakai.iframe
wsetup.home.toolids.3=sakai.synoptic.announcement
wsetup.home.toolids.4=sakai.synoptic.chat
wsetup.home.toolids.5=sakai.synoptic.messagecenter

3.0 会话过期警告

Sakai有一个属性 inactiveInterval@org.sakaiproject.tool.api.SessionManager,通过这个属性设定当用户在停止操作后多少时间自动结束会话。当用户会话结束时间小于警告时间(例如10分钟)时,会自动弹出提示窗口。当会话过期时,会自动跳转到登出页面。详细信息参考  SAK-13987 - Getting issue details... STATUS   SAK-8152 - Getting issue details... STATUS

此属性默认开启,您可以通过指定下面参数进行进一步设置:

timeoutDialogEnabled=true
timeoutDialogWarningSeconds=600

4.0 配置email 

如果需要让Sakai收发邮件,需要在 sakai.properties 中进行一系列设置。要让Sakai发送邮件,需要设定SMTP服务器地址:
smtp@org.sakaiproject.email.api.EmailService=some.smtp.org

Sakai's SMTP server is Apache James. Most sys admins prefer running a standard mailer like Postfix on port 25 (rather than James directly) and configuring it to forward requests to Sakai. You may also currently have a mailer service running on port 25 (Linux usually has it running by default). So consider setting James to run on a different port (e.g., 8025) in order to avoid conflicts.

To enable Sakai to receive mail you'll need to set the following properties:

# flag to enable or disable James for incoming email (true | false)
#Default=false.
smtp.enabled=true

# dns addresses used by James for incoming email.
smtp.dns.1=255.255.255.1
smtp.dns.2=255.255.255.2

# SMTP port on which James runs.  
# Recommend running on 8025, and using a standard mailer on 25 to forward mail to Sakai.
# Default=25.
smtp.port=8025

Additional settings can be enabled to add support emails for a variety of tasks.

# Email support address used in incoming email rejection messages.
mail.support=address@somedomain

# Email address to send errors caught by the portal, and user bug reports in response.
portal.error.email=address@somedomain

# Email address used as the "from" address for any email sent by Worksite Setup tool or Site Info tool.
setup.request=address@somedomain

# Send an email to the user when the user is added.
notifyNewUserEmail=true

5.0 配置日志 

Once you have Sakai installed, configured and started, you can monitor Sakai by watching the logs. The log level for the standard Sakai source code and the demo is set to show info and warnings only. Watch for the WARN: messages. There are going to be some "normal" ones at startup, and some will likely slip by at runtime, but any warning is potentially something you might want to check out.

Logging levels can be specified in sakai.properties. This augments and overrides the levels set in the default config file. Example:

log.config.count=3
log.config.1 = ALL.org.sakaiproject.log.impl
log.config.2 = OFF.org.sakaiproject
log.config.3 = DEBUG.org.sakaiproject.db.impl

This uses the established (if awkward) method of having a name.count followed by name.1name.2 etc. to form an array of strings for the value "name". In this case, the name is "log.config". The values are of the form LEVEL.logger, and the possible levels are: OFF TRACE DEBUG INFO WARN ERROR FATAL ALL.

Sakai uses log4j for logging. See the official log4j documentation for more information about how to configure it if you have questions, but a few notes are collected here below.

To change the logging for Sakai in the source modify kernel/kernel-common/src/main/config/log4j.properties the following property:

log4j.logger.org.sakaiproject=INFO

To turn on debug logging for all of Sakai, change the value from INFO to DEBUG. In order to enable debug logging for a single Sakai components, add a line such as in the following example, which will leave most of Sakai at INFO, but generate DEBUG level messages for the SQL service:

log4j.logger.org.sakaiproject=INFO
log4j.logger.org.sakaiproject.component.framework.sql.BasicSqlService=DEBUG

The logging controls are part of the LogConfigurationManager, implemented as a component in the Kernel. It can be disabled, if that's desired, with an entry in sakai.properties:

enabled@org.sakaiproject.log.api.LogConfigurationManager = false

For Mac and *nix systems, the most important log is found in Tomcat's logs/catalina.out. It can be instructive to watch this log as Tomcat is starting up, by using a startup command like the following:

bin/startup.sh; tail -f logs/catalina.out

Tomcat on Windows tends to be a little more puzzling about its logs, and it includes more of them, but its default behavior is to open catalina.out in a new window as soon as you start Tomcat. If you need more information about the logs in Windows, we'll refer you to the official Tomcat documentation.

(info) The SMTP server logs from Sakai will be written to the $CATALINA_HOME/sakai/logs directory.

6.0 管理临时文件

根据不同的使用情况,Sakai可能在系统临时目录(例如 /tmp)中创建大量临时文件。建议周期性地删除存在一天以上的文件,这个方法对大量使用email存档功能的部署尤为重要。注意,请不要将所有的文件都移除,因为其中有的文件可能正在使用中。

  • No labels