modify env properties

This commit is contained in:
Shinsuke Sugaya 2015-12-16 22:56:24 +09:00
parent 0161dc07f6
commit 1fd598e0ea
11 changed files with 39 additions and 15 deletions

View file

@ -42,7 +42,7 @@
<!-- Main Framework -->
<dbflute.version>1.1.0-sp9</dbflute.version>
<lastaflute.version>0.7.0-RC1</lastaflute.version>
<lasta.taglib.version>0.6.5-RC2</lasta.taglib.version>
<lasta.taglib.version>0.6.6-RC2</lasta.taglib.version>
<servlet.version>3.1.0</servlet.version>
<jsp.version>2.3.1</jsp.version>
<mailflute.version>0.4.3-RC2</mailflute.version>
@ -69,7 +69,7 @@
<cluster.runner.version>2.1.0.0</cluster.runner.version>
<!-- Tomcat -->
<tomcat.boot.version>0.4.0-RC2</tomcat.boot.version>
<tomcat.boot.version>0.4.1-RC1</tomcat.boot.version>
<!-- TODO: RPM build -->
<packaging.fess.home.dir>/usr/share/fess</packaging.fess.home.dir>
@ -446,7 +446,9 @@
<location>${project.build.directory}/fess/WEB-INF/classes</location>
<includes>
<include>fess_config.properties</include>
<include>fess_env_production.properties</include>
<include>fess_env_web.properties</include>
<include>fess_env_crawler.properties</include>
<include>fess_env_suggest.properties</include>
</includes>
</source>
</sources>

View file

@ -51,7 +51,7 @@ set FESS_JAVA_OPTS=%FESS_JAVA_OPTS% -Dfess.temp.path=%FESS_HOME%\temp
set FESS_JAVA_OPTS=%FESS_JAVA_OPTS% -Dfess.log.name=%APP_NAME%
set FESS_JAVA_OPTS=%FESS_JAVA_OPTS% -Dfess.log.path=%FESS_HOME%\logs
set FESS_JAVA_OPTS=%FESS_JAVA_OPTS% -Dfess.log.level=warn
set FESS_JAVA_OPTS=%FESS_JAVA_OPTS% -Dlasta.env=production
set FESS_JAVA_OPTS=%FESS_JAVA_OPTS% -Dlasta.env=web
set FESS_JAVA_OPTS=%FESS_JAVA_OPTS% -Dtomcat.config.path=tomcat_config.properties
"%JAVA_HOME%\bin\java" %JAVA_OPTS% %FESS_JAVA_OPTS% %FESS_PARAMS% !newparams! -cp "%FESS_CLASSPATH%" "org.codelibs.fess.FessBoot"

View file

@ -83,8 +83,11 @@ FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.temp.path=$FESS_TEMP_PATH"
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.log.name=$APP_NAME"
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.log.path=$FESS_LOG_PATH"
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.log.level=warn"
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dlasta.env=production"
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dlasta.env=web"
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dtomcat.config.path=tomcat_config.properties"
if [ "x$FESS_CONF_PATH" != "x" ]; then
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.conf.path=$FESS_CONF_PATH"
fi
if [ "x$ES_HTTP_URL" != "x" ]; then
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.es.http_address=$ES_HTTP_URL"
fi

View file

@ -125,7 +125,7 @@ CALL "%FESS_HOME%\bin\fess.in.bat"
rem thread stack size
set JVM_SS=256
set FESS_PARAMS=-Dfess;-Dfess.home="%FESS_HOME%";-Dfess.es.dir="%ES_HOME%";-Dfess.home="%FESS_HOME%";-Dfess.context.path="/";-Dfess.port=8080;-Dfess.webapp.path="%FESS_HOME%\app";-Dfess.temp.path="%FESS_HOME%\temp";-Dfess.log.name="%APP_NAME%";-Dfess.log.path="%FESS_HOME%\logs";-Dfess.log.level=warn;-Dlasta.env=production;-Dtomcat.config.path=tomcat_config.properties
set FESS_PARAMS=-Dfess;-Dfess.home="%FESS_HOME%";-Dfess.es.dir="%ES_HOME%";-Dfess.home="%FESS_HOME%";-Dfess.context.path="/";-Dfess.port=8080;-Dfess.webapp.path="%FESS_HOME%\app";-Dfess.temp.path="%FESS_HOME%\temp";-Dfess.log.name="%APP_NAME%";-Dfess.log.path="%FESS_HOME%\logs";-Dfess.log.level=warn;-Dlasta.env=web;-Dtomcat.config.path=tomcat_config.properties
set JVM_OPTS=%JAVA_OPTS: =;%

View file

@ -59,14 +59,17 @@ public class FessBoot extends TomcatBoot {
public static void main(final String[] args) {
// update java.io.tmpdir
final String value = System.getProperty(FESS_TEMP_PATH);
if (value != null) {
System.setProperty(JAVA_IO_TMPDIR, value);
final String tempPath = System.getProperty(FESS_TEMP_PATH);
if (tempPath != null) {
System.setProperty(JAVA_IO_TMPDIR, tempPath);
}
final String tomcatConfigPath = getTomcatConfigPath();
final TomcatBoot tomcatBoot = new FessBoot(getPort(), getContextPath()) //
.useTldDetect(); // for JSP
if (tempPath != null) {
tomcatBoot.atBaseDir(new File(tempPath, "webapp").getAbsolutePath());
}
final String tomcatConfigPath = getTomcatConfigPath();
if (tomcatConfigPath != null) {
tomcatBoot.configure(tomcatConfigPath); // e.g. URIEncoding
}

View file

@ -234,6 +234,11 @@ public class CrawlJob {
// -cp
crawlerCmdList.add("-cp");
final StringBuilder buf = new StringBuilder();
final String confPath = System.getProperty("fess.conf.path");
if (StringUtil.isNotBlank(confPath)) {
buf.append(confPath);
buf.append(cpSeparator);
}
// WEB-INF/crawler/resources
buf.append("WEB-INF");
buf.append(File.separator);
@ -277,12 +282,15 @@ public class CrawlJob {
final String lastaEnv = System.getProperty("lasta.env");
if (StringUtil.isNotBlank(lastaEnv)) {
crawlerCmdList.add("-Dlasta.env=" + lastaEnv);
if (lastaEnv.equals("web")) {
crawlerCmdList.add("-Dlasta.env=crawler");
} else {
crawlerCmdList.add("-Dlasta.env=" + lastaEnv);
}
}
crawlerCmdList.add("-Dfess.crawler.process=true");
crawlerCmdList.add("-Dfess.log.path=" + (logFilePath != null ? logFilePath : systemHelper.getLogFilePath()));
addSystemProperty(crawlerCmdList, "lasta.env", null, null);
addSystemProperty(crawlerCmdList, "fess.log.name", "fess-crawler", "-crawler");
if (logLevel == null) {
addSystemProperty(crawlerCmdList, "fess.log.level", null, null);

View file

@ -104,6 +104,11 @@ public class SuggestJob {
// -cp
suggestCreatorCmdList.add("-cp");
final StringBuilder buf = new StringBuilder();
final String confPath = System.getProperty("fess.conf.path");
if (StringUtil.isNotBlank(confPath)) {
buf.append(confPath);
buf.append(cpSeparator);
}
// WEB-INF/suggest/resources
buf.append("WEB-INF");
buf.append(File.separator);
@ -147,7 +152,11 @@ public class SuggestJob {
final String lastaEnv = System.getProperty("lasta.env");
if (StringUtil.isNotBlank(lastaEnv)) {
suggestCreatorCmdList.add("-Dlasta.env=" + lastaEnv);
if (lastaEnv.equals("web")) {
suggestCreatorCmdList.add("-Dlasta.env=suggest");
} else {
suggestCreatorCmdList.add("-Dlasta.env=" + lastaEnv);
}
}
suggestCreatorCmdList.add("-Dfess.suggest.process=true");
@ -156,7 +165,6 @@ public class SuggestJob {
logFilePath = value != null ? value : new File(targetDir, "logs").getAbsolutePath();
}
suggestCreatorCmdList.add("-Dfess.log.path=" + logFilePath);
addSystemProperty(suggestCreatorCmdList, "lasta.env", null, null);
addSystemProperty(suggestCreatorCmdList, "fess.log.name", "fess-suggest", "-suggest");
addSystemProperty(suggestCreatorCmdList, "fess.log.level", null, null);
if (systemHelper.getCrawlerJavaOptions() != null) {

View file

@ -1,5 +1,5 @@
[Unit]
Description=Fess
Description=Fess is very powerful and easily deployable Enterprise Search Server.
Documentation=http://fess.codelibs.org/
Wants=network-online.target
After=network-online.target