ソースを参照

fix #583 add tomcat.bindAddress

Shinsuke Sugaya 9 年 前
コミット
2b308e5a50

+ 1 - 1
src/main/assemblies/files/tomcat_config.properties

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

+ 13 - 0
src/main/java/org/codelibs/fess/FessBoot.java

@@ -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
     //                                                                        ============