diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index ce17de4ec8..4853959b27 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -428,6 +428,9 @@ Branch-2 ( Unreleased changes ) HADOOP-8632. Configuration leaking class-loaders (Costin Leau via bobby) + HADOOP-4572. Can not access user logs - Jetty is not configured by default + to serve aliases/symlinks (ahmed via tucu) + BREAKDOWN OF HDFS-3042 SUBTASKS HADOOP-8220. ZKFailoverController doesn't handle failure to become active diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/CommonConfigurationKeys.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/CommonConfigurationKeys.java index fbcc3ed7fe..28f8dd0532 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/CommonConfigurationKeys.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/CommonConfigurationKeys.java @@ -172,6 +172,12 @@ public class CommonConfigurationKeys extends CommonConfigurationKeysPublic { public static final String DEFAULT_HADOOP_HTTP_STATIC_USER = "dr.who"; + /** Enable/Disable aliases serving from jetty */ + public static final String HADOOP_JETTY_LOGS_SERVE_ALIASES = + "hadoop.jetty.logs.serve.aliases"; + public static final boolean DEFAULT_HADOOP_JETTY_LOGS_SERVE_ALIASES = + true; + /* Path to the Kerberos ticket cache. Setting this will force * UserGroupInformation to use only this ticket cache file when creating a * FileSystem instance. diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer.java index de265725c0..7bf3c16e8c 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer.java @@ -330,6 +330,12 @@ protected void addDefaultApps(ContextHandlerCollection parent, Context logContext = new Context(parent, "/logs"); logContext.setResourceBase(logDir); logContext.addServlet(AdminAuthorizedServlet.class, "/*"); + if (conf.getBoolean( + CommonConfigurationKeys.HADOOP_JETTY_LOGS_SERVE_ALIASES, + CommonConfigurationKeys.DEFAULT_HADOOP_JETTY_LOGS_SERVE_ALIASES)) { + logContext.getInitParams().put( + "org.mortbay.jetty.servlet.Default.aliases", "true"); + } logContext.setDisplayName("logs"); setContextAttributes(logContext, conf); defaultContexts.put(logContext, true); diff --git a/hadoop-common-project/hadoop-common/src/main/resources/core-default.xml b/hadoop-common-project/hadoop-common/src/main/resources/core-default.xml index ca9210b619..8866739b3c 100644 --- a/hadoop-common-project/hadoop-common/src/main/resources/core-default.xml +++ b/hadoop-common-project/hadoop-common/src/main/resources/core-default.xml @@ -1088,4 +1088,13 @@ + + hadoop.jetty.logs.serve.aliases + true + + Enable/Disable aliases serving from jetty + + + +