Skip to content

Instantly share code, notes, and snippets.

@winse
Last active August 29, 2015 14:07
Show Gist options
  • Save winse/7ca5a4a1750ef9251eaf to your computer and use it in GitHub Desktop.
Save winse/7ca5a4a1750ef9251eaf to your computer and use it in GitHub Desktop.
file explorer server on tomcat
[root@docker apache-tomcat-7.0.37]# git diff --cached
diff --git a/bin/catalina.sh b/bin/catalina.sh
old mode 100644
new mode 100755
diff --git a/bin/configtest.sh b/bin/configtest.sh
old mode 100644
new mode 100755
diff --git a/bin/daemon.sh b/bin/daemon.sh
old mode 100644
new mode 100755
diff --git a/bin/digest.sh b/bin/digest.sh
old mode 100644
new mode 100755
diff --git a/bin/setclasspath.sh b/bin/setclasspath.sh
old mode 100644
new mode 100755
diff --git a/bin/shutdown.sh b/bin/shutdown.sh
old mode 100644
new mode 100755
diff --git a/bin/startup.sh b/bin/startup.sh
old mode 100644
new mode 100755
diff --git a/bin/tool-wrapper.sh b/bin/tool-wrapper.sh
old mode 100644
new mode 100755
diff --git a/bin/version.sh b/bin/version.sh
old mode 100644
new mode 100755
diff --git a/conf/Catalina/localhost/hadoop.xml b/conf/Catalina/localhost/hadoop.xml
new file mode 100644
index 0000000..9eb111f
--- /dev/null
+++ b/conf/Catalina/localhost/hadoop.xml
@@ -0,0 +1,4 @@
+<?xml version='1.0' encoding='utf-8'?>
+
+<Context path="/hadoop" docBase="/root/hadoop">
+</Context>
diff --git a/conf/web.xml b/conf/web.xml
index f9a506b..f822d40 100644
--- a/conf/web.xml
+++ b/conf/web.xml
@@ -102,7 +102,7 @@
</init-param>
<init-param>
<param-name>listings</param-name>
- <param-value>false</param-value>
+ <param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
  • 目录添加WEB-INF
cd ~/apache-tomcat-7.0.37
cd conf/Catalina/localhost/
vi hadoop.xml

  <?xml version='1.0' encoding='utf-8'?>
  
  <Context path="/hadoop" docBase="/root/hadoop">
  </Context>

cd ~/apache-tomcat-7.0.37/webapps/ROOT/
cp -r WEB-INF ~/hadoop/
  • 配置目录浏览选项
cd ~/apache-tomcat-7.0.37
vi conf/web.xml 

         <init-param>
             <param-name>listings</param-name>
             <param-value>true</param-value>
         </init-param>
  • 启动
chmod +x bin/*.sh
./bin/startup.sh 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment