Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
allow to choose used http server, YaCy-Anomic or Jetty - defaults to Jetty (in this branch) - add server version info & config option -> Admin Console -> Advanced Settings -> Http Networking
regerf46c72339811
diff --git a/defaults/yacy.init b/defaults/yacy.initindex 1398c0697..98a1664fd 100644--- a/defaults/yacy.init+++ b/defaults/yacy.init@@ -8,7 +8,8 @@# ----------------------------------------------------------------------------# the HTTP service configurations-+# choices are jetty or anomic+defaulthttpserver=jetty# port number where the server should bind toport = 8090diff --git a/htroot/Settings_Http.inc b/htroot/Settings_Http.incindex 8a23ace87..72d2f7fcd 100644--- a/htroot/Settings_Http.inc+++ b/htroot/Settings_Http.inc@@ -33,4 +33,23 @@</tr></table></fieldset>+</form><br />+<form>+<fieldset><legend id="httpserver">HTTP Server</legend>+<table border="0" cellspacing="5">+ <tr>+ <td>HTTP Server Version:</td>+ <td><b>#[httpservername]#</b></td>+ </tr>+ <tr>+ <td>set default server to</td>+ <td><select name="defaulthttpserver">+ <option value="jetty">Jetty</optioon>+ <option value="anomic">YaCy Anomic HTTPD</option>+ </select>+ <input type="submit" name="setdefaulthttpserver" value="Submit" /></td>+ <td><em>Changes effective after a restart</em></td>+ </tr>+</table>+</fieldset></form><br />\ No newline at end of filediff --git a/htroot/Settings_p.java b/htroot/Settings_p.javaindex 92bd3929f..91e2c3992 100644--- a/htroot/Settings_p.java+++ b/htroot/Settings_p.java@@ -190,6 +190,11 @@ public final class Settings_p {prop.putHTML("crawler.smb.maxFileSize",sb.getConfig("crawler.smb.maxFileSize", "-1"));prop.putHTML("crawler.file.maxFileSize",sb.getConfig("crawler.file.maxFileSize", "-1"));+ prop.put("httpservername",sb.getHttpServer().getVersion());+ if (post != null && post.containsKey("setdefaulthttpserver")) {+ String server = post.get("defaulthttpserver","jetty");+ sb.setConfig("defaulthttpserver",server);+ }// return rewrite propertiesreturn prop;}diff --git a/source/net/yacy/yacy.java b/source/net/yacy/yacy.javaindex 9eac74edc..f4ac1049b 100644--- a/source/net/yacy/yacy.java+++ b/source/net/yacy/yacy.java@@ -65,6 +65,7 @@ import net.yacy.search.Switchboard;import net.yacy.search.SwitchboardConstants;import com.google.common.io.Files;+import net.yacy.server.http.HTTPDemon;import net.yacy.server.serverCore;@@ -330,27 +331,29 @@ public final class yacy {// start main threadsfinal int port = sb.getConfigInt("port", 8090);try {-- // start jetty http server- YaCyHttpServer httpServer = new Jetty8HttpServerImpl(port);- httpServer.startupServer();+ // start http server+ YaCyHttpServer httpServer;+ // default jetty (alternative "anomichttpd")+ if (sb.getConfig("defaulthttpserver","jetty").equalsIgnoreCase("jetty")) {+ httpServer = new Jetty8HttpServerImpl(port);+ } else {+ final HTTPDemon protocolHandler = new HTTPDemon(sb);+ httpServer = new serverCore(+ timeout /*control socket timeout in milliseconds*/,+ true /* block attacks (wrong protocol) */,+ protocolHandler /*command class*/,+ sb,+ 30000 /*command max length incl. GET args*/);+ ((serverCore) httpServer).setName("httpd:"+port);+ ((serverCore) httpServer).setPriority(Thread.MAX_PRIORITY);+ ((serverCore) httpServer).setObeyIntermission(false);+ // start the server+ //sb.deployThread("10_httpd", "HTTPD Server/Proxy", "the HTTPD, used as web server and proxy", null, server, 0, 0, 0, 0);+ }+ httpServer.startupServer();sb.setHttpServer(httpServer);ConcurrentLog.info("STARTUP",httpServer.getVersion());- //final HTTPDemon protocolHandler = new HTTPDemon(sb);- //final serverCore server = new serverCore(- // timeout /*control socket timeout in milliseconds*/,- // true /* block attacks (wrong protocol) */,- // protocolHandler /*command class*/,- // sb,- // 30000 /*command max length incl. GET args*/);- //server.setName("httpd:"+port);- //server.setPriority(Thread.MAX_PRIORITY);- //server.setObeyIntermission(false);- // start the server- //sb.deployThread("10_httpd", "HTTPD Server/Proxy", "the HTTPD, used as web server and proxy", null, server, 0, 0, 0, 0);- //server.start();-// open the browser windowfinal boolean browserPopUpTrigger = sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_TRIGGER, "true").equals("true");if (browserPopUpTrigger) try {