fix #583 add tomcat.bindAddress

This commit is contained in:
Shinsuke Sugaya 2016-07-17 23:17:58 +09:00
parent c634edf1ea
commit 2b308e5a50
2 changed files with 14 additions and 1 deletions

View file

@ -6,4 +6,4 @@
# ------
tomcat.URIEncoding = UTF-8
tomcat.useBodyEncodingForURI = true
#tomcat.bindAddress=127.0.0.1

View file

@ -18,7 +18,10 @@ package org.codelibs.fess;
// DO NOT DEPEND OTHER JARs
import java.io.File;
import java.util.Properties;
import org.apache.catalina.connector.Connector;
import org.apache.catalina.startup.Tomcat;
import org.codelibs.core.lang.StringUtil;
import org.dbflute.tomcat.TomcatBoot;
@ -56,6 +59,16 @@ public class FessBoot extends TomcatBoot {
return new File(System.getProperty(JAVA_IO_TMPDIR), "fessboot").getAbsolutePath();
}
@Override
protected void reflectConfigToServer(Tomcat server, Connector connector, Properties props) { // you can override
super.reflectConfigToServer(server, connector, props);
final String bindAddress = props.getProperty("tomcat.bindAddress");
if (bindAddress != null) {
info(" tomcat.bindAddress = " + bindAddress);
connector.setProperty("address", bindAddress);
}
}
// ===================================================================================
// main
// ============