Background
A small tool in the project, is a cron job, every day to collect the server Hadoop job running state, and generate a report sent to the entire team, production reports at the same time the relevant log files saved to a fixed machine, easy to view and analyze later, Because the log on the production environment is only saved for 7 days.
Problem:
The log is saved on a fixed directory, and is on the Linux system, is our local machine. Our email report cannot be accessed through the file schema, so I want to build a Web server through Tomcat to access the file, which can cross the environment, and foreign colleagues can
See the log information.
Solve:
Tomcat version:7.0.55
Update the Server.xml
Autodeploy= "false" name= "localhost" unpackwars= "true"
Xmlnamespaceaware= "false" xmlvalidation= "false" >
<!--Singlesignon valve, share authentication between Web applications
Documentation at:/docs/config/valve.html--
<!--
<valve classname= "Org.apache.catalina.authenticator.SingleSignOn"/>
-
<!--Access log processes all example.
Documentation at:/docs/config/valve.html
Note:the pattern used is equivalent to using pattern= "common"-
<valve classname= "Org.apache.catalina.valves.AccessLogValve" directory= "Logs"
prefix= "Localhost_access_log" suffix= ". txt"
pattern= "%h%l%u%t "%r" %s%b "/>
<context docbase= "/home/hadoop/uc4report" path= "/project/report"/>
</Host>
-----------------------------------------------------------------------------------------------
/home/hadoop/uc4report is the file folder
/project/report is the access path
We can access the file md_run_influencer_prod_586404867:
http://10.**.**.52:8080/project/report/2014-08-04/md_run_influencer_prod_586404867