hostflag236.white flag中文歌词怎么说

问题已关闭
与已有问题相似
问题已重定向至
你最常用的 Chrome 扩展程序或 Web Apps 有哪些?
按投票排序
在看下面内容之前首先建议安装“One-Click Extensions Manager”,相比你的chrome里已经装了很多extensions了吧,但是有一个最大的问题就是由于装了太多扩展以至于chrome占用内存很大导致速度变慢了(除非你电脑内存极大),但是这些扩展又不是时时刻刻都用,但又舍不得卸载掉,怎么办呢?所以建议你先装一个“One-Click Extensions Manager”,简而言之就是可以达到达到速度和功能之间的平衡作用。One-Click Extensions Manager:一键禁用所有扩展-,当然安装这么多extension,因此很占内存,而同时并不是所以的扩展功能在同一时间点都在使用,因此这个扩展就非常有用,平时可以使用它暂时关掉不用的扩展,当使用时再打开,这样可以降低内存的占用,同时并不影响自己使用extension,因此就更加优化了chrome的使用,达到速度和功能之间的平衡作用。以下是自己经过反复使用,装了又删,删了又装,最后优胜劣汰后,目前正在使用的插件:chrome extensions搜索相关功能增强AutoPager Chrome:自动翻页,浏览网页时,可以自动翻页并将每一页的内容接在现有内容的末尾,这款插件几乎可以作用于搜索引擎、普通网页、论坛帖子……甚 至,某些你想象不到的页面哦。word highlight:高亮google search关键词Search the current site:为您提供当前浏览网站的站内搜索功能Universal Search & IE8 Accelerators:右键关键词查询百度百科或者其他搜索工具,非常方便,好像还有更复杂的功能,但我觉得仅此一个功能已经让我很满足了Proxy Switchy!:自动代理切换,主要是翻墙用(主要用于被GFW屏蔽的网站,例如:
youtube,facebook,twitter等)+S:主要是使用https:// ,比如以前在google里搜索 屏蔽 胡萝卜、学习时,会被重置,点击一下这个插件就没问题了,但是现在好像不可以了Wikipedia Companion - Mini Wiki Browser:查询维基百科(wekipedia),关键是中英文都有,而且还有目录 !很方便HashPlug - Add Twitter Search to Google:,所以如今在使用Google搜索服务的同时,无法在网页上实时查看搜索对象在Twitter上的消息更新了,印度班加罗尔的创业公司Fenopix推出的HashPlug Chrome插件可以帮你在Google搜索页面的右边添加一个实时搜索twitter结果的窗口,而且从Twitter得到的搜索结果还可以自动更新,用户还可以对内容进行转发、回复或点击喜欢按钮来表明你的态度,所有这一切在右边的窗口内都可完成,不必登陆Twitter网站。浏览网页功能增强AdBlock:广告屏蔽,自己体会最深的是屏蔽youtube广告很厉害优酷杀手:去优酷视频播放的前几十秒的广告,没有等待时间.解除仅限内地播放限制,提供视频快捷下载链接,可无须下载优酷客户端直接下载。比修改hosts等方法好.安装这个插件, 点优酷的视频的时候直接播放.Auto-Translate:自动翻译,ctrl+要翻译的关键词,基于google translate,另外一个类似的extension是:bubble translate(这个貌似更快一点),两个都基于google Translate,曾经两个同时用Google Similar Pages beta (by Google):查询当前网页的类似网页Ultimate Chrome Flag:可以查询当前网页网站的国家(IP地址),尤其是翻墙是给自己使用哪个国家代理提供帮助,还有其他指标,但我仅仅用这个Google Translate:google官方推出的按你所选择的语言翻译整个网页Remove Google Redirects:习惯用google搜索的同学们,都知道google搜索出来的链接,在访问的时候会通过google的很长的地址做跳转吧,有时就卡在跳转这儿了,或者很慢,体验很不好,“Remove Google Redirects”,装上后会掠过跳转,直接访问真实地址,立马变快了Clip to Evernote:erernote大家应该都知道,做笔记的软件,这个方便自己随时记录网络看到的好东西!有道云笔记网页剪报:一键保存精彩网页,多终端同步,永久珍藏。有道云笔记网页剪报Chrome插件帮助您轻松地将任意网页内容保存到有道云笔记中,云端存储,永不丢失。支持右键划选部分网页,也可以自动提取正文进行保存。同时,还能方便地同步到有道云笔记桌面版、手机版,随时随地查看。
消息速递:电脑和手机之间的信息快递传输工具,能很简单的把电脑上的文件发到手机上,word、excel...常见文件都支持,还能发3000字的长文本,挺方便!Thunder,QQDownload,FlashGet Files:迅雷、快车、旋风专用链自动破解(自动转换迅雷/快车/旋风专用链为真实地址),提供迅雷下载支持,地址解密.自动把页面里的迅雷,快车Flashget,旋风链接替换为真实地址,使用你自己喜欢的下载方式来下载.让chrome支持专用链下载,是一款特实用的下载助手.Docs PDF/PowerPoint Viewer (by Google):当打开pdf,ppt,doc文件时,默认浏览器打开RSS订阅功能增强RSS Subscription Extension (by Google) 和 Page2RSS:这两个extension配合使用可以订阅所有的网页(Page2RSS主要负责哪些没有RSS输出的网页)google reader功能增强Reader Plus:google reader的增强插件Super Google Reader:可以让google reader订阅到全文图片搜索(以图搜图,相似图片搜索)TinEye Reverse Image Search:反向图片搜索,以图搜图ChromeEye:可以同时搜索TinEye、google、 Cydral 、Yandex 和百度的图片搜索(相似图片查询)分享和提醒功能增强分享家:Addthis中文版:分享当前网页的好工具,我主要是分享到新浪微博(围脖),和校内网FaWave:新浪微博(围脖)One Number:gmail和google reader未读条目提醒淘宝隐藏折扣查询淘宝折扣实时查询:在浏览淘宝网是显示隐藏折扣购物助手: 多站点比价,淘宝分成(折扣):在浏览淘宝网时显示隐藏折扣
Proxy Switchy!(代理)Smooth Gestures(鼠标手势)Yet Another Drag and Go(拖动打开链接 / 搜索)InstapaperiReader(更好的阅读体验)
IE tab:可以切换到IE内核,对付那些不支持chrome的网银Sexy Undo Close Tab:可以恢复最近关闭的标签页Neat Bookmarks:把书签放到扩展区域,方便打开RSS Subscription Extension:在地址栏上添加一键订阅的rss按钮Speed Dial:优化chrome的新建标签页,可以放一堆自己常去的站点Proxy Switchy!:翻墙神器,设置比较复杂,请自行搜索教程Ultimate Chrome Flag:在地址栏显示网站所在地区的国旗,还可以显示RP值和alexa排名Fawave:最好的微博客户端,支持当前所有微博,一件发推到各微博Diigo:一个有名的书签应用,三大功能:bookmark,highlight,note。第一个是将该页添加书签不用多说,第二个是可以将页面上部分文字标记高亮,也会被当作书签存储下来,适合收集名言和小段碎片的文字。第三个是给页面加上标注,下次再次访问还能看到网页设计必备:Firebug,EyeDroper,MeasureIt:第一个不用多介绍了吧,第二个是取色,第三个是测距PageMonitor:页面监控,如果内容有更新就通知你,我就是用这个插件在苹果官方商店上抢到了iphone4,可用的地方很多,比容用来监控竞争对手的改版……
Adblock Plus for Google Chrome(TM) (Beta) - 版本: 1.1.2使用Firefox AdBlock Plus过滤广告。使您告别广告,舒心浏览网页!Google SSL Web Search beta (by Google) - 版本: 1.3Use Google Web Search and Suggest protected by SSL.One Number - 版本: 1.5.2.14Check GMail, Google Reader, Google Voice, and Google Wave. Many sources, one number.Ultimate Chrome Flag - 版本: 0.3.7This extension displays country or region name, Geo, Google PageRank, Alexa Rank and WOT info for the websites you're visiting.快捷工具(由Google提供) - 版本: 1.0.18支持自定义快速访问菜单,保存未提交表单数据,快捷键,网址一键通,原始图片查看,图片放大镜,设置图片为桌面背景,独立视频腾讯微博提醒 - 版本: 1.9腾讯微博提醒购物助手: 多站点比价,淘宝客分成 - 版本: 2.2.2在购物页面底部自动显示商品在其他网站的价格,便于比较;在淘宝帮你轻松生成淘宝客连接,自己买等于是折扣,发给别人买就能获得额外收入
1.Pocket 。保存稍后阅读,可以将保存的内容同步到手机、平板或其它电脑2.印象笔记的扩展。印象笔记悦读和印象笔记剪藏3.页面平滑滚动的扩展——SmoothScroll。摸起来,不对,滚起来滑溜溜的!4.网页截图 - Webpage Screenshot。目前最好用多个一个网页截图插件。5.Adblock Plus屏蔽广告的。不用多说哈!6.Google Keep - 记事和清单。可惜没有iOS和wp8版,目前很少用了7.LastPass: Free Password Manager。密码管理、自动填充账号密码,谁用谁知道!8.Proxy SwitchySharp 。代理切换工具,科$%学*&上*&网必备,不过现在GoAgent不太好用了,用两款其它付费科$%学*&上*&网工具,这个就禁用已久了。9.Search by Image (by Google)。右键以图搜图,谷歌出品。10.xTab。限制Chrome标签页数量,超过设定数量后自动关闭之前的标签页。11.优酷去广告 插件(已支持优酷、土豆、爱奇艺、乐视网、搜狐视频、酷六)。禁用已久12.划词翻译。很好用,就是有时不太稳定。13.广告终结者。现在启用的,能屏蔽百度推广广告、各种牛皮癣广告,和大多数视频广告,目前去广告类,只有这个启用了。14.微博急简 WC。简化微博,现在不怎么用了。15.微软雅黑字体。 受不了win8上满知乎的宋体,所有网页必须雅黑!16.惠惠购物助手。考虑到一淘比价和阿里的包养关系,改用大网易的了!17.番茄土豆。番茄工作法的扩展,用过几次,坚持不下来,现已禁用。18.红杏。红杏出墙,啊不,翻*&Q。10元每月,简单稳定,用我这个链接购买你我都能增加10天哦:最后推荐下我自己开发的一款新标签页哈,Infinity New Tab:完全自定义的一个Chrome新标签页,可以云端备份你的数据。预置了几百个网站图标,预置了几百个网站图标,可以调节图标大小、数量、圆角读数、透明度。所有添加网站和设置都会备份到云端。还有个侧边还有个侧边天气,可以自动获取你所在城市的天气,不过考虑到浏览器定位不太准,你也可以自己设置城市。待办事项,帮你可在图标上待办事项,帮你可在图标上显示待办数目,Gmail图标还可以显示未读邮件数哦,前提是在设置里开启此功能。当然收到Gmail桌面通知也是可以的。每日一图是从3万多张选出来的几百张图片啊!当然你也可以自定义壁纸啦,为了让图标更清晰,还自带了模糊壁纸的功能。笔记与创意,简单的东西记在上面,帮你备份到云端。笔记与创意,简单的东西记在上面,帮你备份到云端。可以直接启动应用,也可以管理扩展。可以直接启动应用,也可以管理扩展。就算你觉得还不够简洁,也可以去掉搜索框啊!每个图标都可以自由删除与移动的。就算你觉得还不够简洁,也可以去掉搜索框啊!每个图标都可以自由删除与移动的。另外还有搜索引擎,网站图标啥的都是可以自定义的,我就不多说啦,感兴趣小伙伴去下载试试吧!官方地址:Chrome商店下载地址:
Webpage Screenshot
最好用的网页截图Black Menu for Google(TM)
谷歌服务集成Black Menu for Wikipedia
维基服务集成Diigo Web Collector
网页笔记摘录收藏Douban Pulse
豆瓣广播+FMDuckDuckGo
加密搜索服务The Economist
《经济学人》文章音频合体Economist Radio
可以听的《经济学人》FaWave
社交达人必备Lookup Companion for Wikipedia
维基搜索PM2.5
中国空气指数Quick Note
云笔记本Read Later Fast
保存页面稍候阅读Scroll to Top Button
一键回到顶部Search by Image
图片搜索Thin Scroll Bar
缩小滚动条 豆瓣的歌去虾米听ZenMate for Google Chrome(TM)
利器没话说中国天气预报
界面好信息全人人网改造器
让人人简洁一些咯咯哒
界面很好看的微博扩展太空饭否
饭否美化插件广告终结者
比AdBlock好用能去视频广告微博急简
让网页微博最简洁微度新标签页
很漂亮的云书签搜索拐杖
搜索结果切换查看背景图片
增加到右键爱库网快速收藏工具
网页收藏管理网页截图:注释&批注
diigo出品爱好学习者必备虾壳
小巧版虾米豆瓣快看
快速搜电影豆瓣看电影
增加视频链接豆瓣の豆皮
书影音全面增强豆瓣+百度网盘(TM)
Session Buddy,标签管理截图快手Coriander,新浪微博客户端Site to Phone,将网址发到多种系统的手机FlashBlock,屏蔽 Flash,降低系统资源的占用,可针对单一 Flash 文件进行解除
网页转二维码(QRURL)因为自己从事的行业经常要从电脑共享网页到手机(离开阅读,或者网页上有app链接,或者看手机版效果,,,,,),就顺手写了个把网页转成二维码的插件。(为了更快速的解决问题,我自己写了个ios的程序(打开app就扫描二维码,成功后马上跳转到safari),同时配合sbsetting,双击状态栏呼出我自己的app)。自认为已经很好的解决了自己的问题。app 还没有上架。正在考虑是否有必要提交上架app中。-------插件传上去后发现别人也写了一个,不管了。希望对你也有用这两天正在想如何从手机阅读快速转移到电脑阅读上来。
Pig toolbox,这个没有人推荐哇!
VimiumYet Another Drag and GoAdblock PlusQuick Reminder
装太多扩展会影响浏览器的速度,但是真的离不开有的扩展:Last Pass ……强大的密码管理器Smooth Gestures ……鼠标手势Adblock ……广告过滤Chrome IE Tab Multi……
IE Only网站神器中国天气预报与万年历…… 这个不解释
Send to Instapaper
分享到Instapaper待读Google Reader Notifier
查阅GR的入口StumbleUpon
发现和收藏网站Gooogle Mail Checker
进Gmail的入口
Google gmail checkerGoogle reader notifierGoogle 类似网页测试版中国天气预报与万年历截图快手Instapaper还有web apps:Google book、springpad、NYtimes、USA TODAY。chrome已经成为我的主力浏览器了,不论是在家还是在办公室,只是网银还得用IE。
fawave截图快手维基百科gmail checkergoo.gl URL shortener
Ad-blocker for Gmail+SChromeItLaterCode colaGoogle TranslateStylishGoogle官方版网页截图
Gmail Checker Plus,比官方的插件更强大;
网页截图,Google官方出品;
Google Reader Checker,快速进入Google Reader;
IE tab,遇到不兼容Chrome的网站,一键切换到IE模式。
楼上的各位还在用老旧的Proxy
Switchy么现在有了更好的:
Baidu Adblock 屏蔽百度广告。。
Unblock Youku。在海外和香港同学必备。
Proxy Switchy!Google Reader Snow Leopard PostRank ExtensionFaWave(发微)Resolution Test Chrome SEO以上按照使用频率排序,其他装了一堆,基本不常用5597人阅读
&&& 由于刚刚接触qemu,所以前面几篇文章仅仅是肤浅的介绍qemu的一些背景知识,今天突然感觉前面说的太没有条理了,而且大部分是读别人的文章,一知半解,没有自己的总结体会,今天感觉稍微有点心得,敬请指教。
1. 明确guest和host
&&& 对于qemu而言,被仿真的平台成为guest或者说target;很明显,运行qemu的平台就称为host。
2. 了解qemu动态翻译技术的发展
&&& qemu运用动态翻译的技术将guest binary instructions动态翻译成host binary instructions,之后由host运行翻译后的指令。在qemu-0.9之前的版本都采用dyngen的动态翻译技术,而从qemu-0.10开始的版本开始采用TCG(Tiny& Code Generator)的翻译技术。
& & 采用dyngen& 动态翻译技术的资料主要有以下两篇文章,是了解动态翻译技术入门的好文章(在后续的分析中,会简单介绍dyngen技术):
& QEMU, a Fast and Portable Dynamic Translator
&Porting QEMU to Plan 9: QEMU Internals and Port Strategy
&&& 介绍TCG技术的文章则相对较少,主要是阅读qemu源码和qemu官网上的相关资料。
3. dyngen简单介绍
&& &&图1简单说明了qemu采用dyngen动态翻译技术将目标平台指令翻译成主机平台指令的简单过程。
假设target为PowerPC,host为x86,说明整个翻译过程:
&& &dyngen在整个过程中扮演了非常重要的角色,其详细功能在这里不再详述,但是有一个疑问,希望与大家讨论:
在将目标平台指令集向micro-operations这一步的转化中,《QEMU, a Fast and Portable Dynamic Translator》一文中提到采用了hand coded code的方式,我理解是我们说的“硬编码”,即目标平台指令到micro-op是预先写好的一一映射的关系,我的疑问就是这种一一映射的关系是怎么实现的,因为没有看过qemu-0.9之前版本的代码,所以很想知道是怎么hand coded 的。另外,该文还提到“When QEMU first encounters
a piece of target code, it&translates it to host code ... ....”, 我的问题是qemu怎么处理目标平台的objective file的, 比方说qemu怎么分析一个ELF文件,怎么从中读取指令,怎么来进行后面的hand coded ????
&& &在dyngen动态翻译技术中,还涉及到几个比较重要的地方,比如:
&& &(1)TBs,Translated Blocks
&& & & & & & &qemu将TB定义为碰到下一个jump指令或修改CPU state的指令之前的所有代码称为一个TB
&& &(2)寄存器分配
&& & & & & & &target平台的寄存器被映射到host的固定寄存器或指定的内存地址
&& &(3)条件代码的优化
&& &(4)TB块以hash表的形式组织
&& &(5)mmap()系统调用仿真target的MMU
&& &(6)longjmp()实现异常仿真
&& &(7)异步轮询的方式实现中断的仿真
&& &至于(3)~(7)的具体实现方式,现在还比较模糊,希望与大家交流!!!!!!!!!
版权声明:本文为博主原创文章,未经博主允许不得转载。
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:654337次
积分:9146
积分:9146
排名:第824名
原创:236篇
转载:62篇
评论:188条
(1)(2)(1)(1)(1)(1)(4)(1)(1)(2)(3)(2)(7)(2)(3)(3)(3)(3)(1)(2)(2)(5)(4)(4)(5)(4)(4)(10)(10)(4)(4)(3)(7)(3)(6)(8)(7)(5)(1)(8)(4)(1)(23)(1)(21)(11)(1)(2)(7)(8)(11)(26)(23)(3)(12)
linuxsky.blog.chinaunix.net10848人阅读
偶也是学习,不过,觉得每次都是读英文,麻烦,就希望把它翻译成中文,为自己,也为其它想学习的朋友,呵呵.不过,由于内容比较多,可能翻译的时间要多一点,如果有兴趣合作的朋友,可以回复BLOG,留言您想翻译那一段.让我们一起完成该内容.
不过,为了增加文档的可阅读性,把阅读当成一种享受,请在翻译的时候遵守以下几点:
1).翻译的字体一律用绿色.保证阅读不那么伤眼睛.
2).重点标题用红色标明,重点内容用蓝色标注.
The Apache Jakarta Tomcat 5.5 Servlet/JSP Container
Manager App HOW-TO/帮助文档
Introduction/介绍Configuring Manager Application Access/配置管理应用程序权限Supported Manager Commands/支持的管理命令
Deploy A New Application Remotely/远程打包应用程序Deploy A New Application from a Local Path/从本地路径打包应用程序List Currently Deployed Applications/列表最近打包的应用程序Reload An Existing Application/重载已经存在的应用程序List OS and JVM Properties/操作系统与JAVA虚拟机属性列表List Available Global JNDI Resources/全局JNDI资源变量列表List Available Security Roles/安全角色变量列表Session Statistics/Session统计Start an Existing Application/启动存在的应用程序Stop an Existing Application/停止应用程序Undeploy an Existing Application/应用程序解包Executing Manager Commands With Ant/用Ant执行管理命令Using the JMX Proxy Servlet/使用JMX代理ServletWhat is JMX Proxy Servlet?/什么是JMX代理Servlet?Query command/查询命令Set command/命令设置
In many production environments, it is very useful to have the capability to deploy a new web application, or undeploy an existing one, without having to shut down and restart the entire container. In addition, you can request an existing application to reload itself, even if you have not declared it to be reloadable in the Tomcat 5 server configuration file.
在许多产品环境中,拥用打包一个新的网络应用程序或者是解包一个已经存在网络应用程序的能力,而不是关闭后再重新启动整个容器,这往往是非常有用的。另个,你可以请求一个存在的应用程序自动重新加载,即使你没有在Tomcat 5中定义可重新加载。
To support these capabilities, Tomcat 5 includes a web application (installed by default on context path /manager) that supports the following functions:
为了使这些得到支持,Tomcat 5中包括了支持一个以下功能的网络应用程序(安装在默认的路径/manager):
Deploy a new web application, on a specified context path, from the uploaded contents of a WAR file.
从指定路径上传的WAR文件打包新的WEB应用程序.
Deploy a new web application, on a specified context path, from the server file system.
从指定路径服务器文件系统打包新的WEB应用程序.
List the currently deployed web applications, as well as the sessions that are currently active for those web apps.
列表当前打包的WEB应用程序,包括当前为这些应用程序处于活动的SESSION.
Reload an existing web application, to reflect changes in the contents of /WEB-INF/classes or /WEB-INF/lib.
重载一个已经存在的应用程序,以使用/WEB-INF/classes or /WEB-INF/lib下的内容更改生效.
List the OS and JVM property values.
操作系统与JAVA虚拟机属性列表.
List the available global JNDI resources, for use in deployment tools that are preparing &ResourceLink& elements nested in a &Context& deployment description.
全局JNDI资源变量列表,这是为了使用在打包工具中用上他们.
List the available security roles defined in the user database.
列表在用户数据库中定的可用的安全角色.
Start a stopped application (thus making it available again).
启动一个停止的应用程序(使它再次成为可用).
Stop an existing application (so that it becomes unavailable), but do not undeploy it.
停止应用程序(使用成为不可用),但去不解包.
Undeploy a deployed web application and delete its document base directory (unless it was deployed from file system).
解包应有程序并且删除它的文档基目录(除非它是从文件系统打包的).
There are two ways to configure the Manager web application Context:
这里有两种方式配置管理应用程序环境:
Install the manager.xml context configuration file in the $CATALINA_HOME/conf/[enginename]/[hostname] folder.
安装环境配置文件manager.xml 在文件夹$CATALINA_HOME/conf/[enginename]/[hostname]中.
Configure the Manager Context within the Host configuration in your Tomcat server.xml configuration. Here is an example:
在你的Tomcat server.xml 配置中的主机配置下配置管理环境.下面是一个例子:
&Context path=&/manager& debug=&0& privileged=&true&
docBase=&/usr/local/kinetic/tomcat5/server/webapps/manager&&
&/Context&
If you have Tomcat configured to support multiple virtual hosts (websites) you would need to configure a Manager for each.
如果你已经将Tomcat配置成支持多个虚拟主机(网站),你就需要分别为其配置一个管理器.
There are three ways to use the Manager web application.
有三种方式可以应用网络应用程序管理器.
As an application with a user interface you use in your browser. Here is an example URL where you can replace localhost with your website host name:
在你的浏览器中成为一个具有用户接口的应用程序.这里有一个示例URL,在这里你可以用你的网站主机名取代localhost.
A minimal version using HTTP requests only which is suitable for use by scripts setup by system administrators. Commands are given as part of the request URI, and responses are in the form of simple text that can be easily parsed and processed. See Supported Manager Commands for more information.
一个仅仅使用HTTP请求基本版本,该版本适用于系统管理员用脚本进行的配置.命令作为请求URL的一部份,并且回应是以简单的文本的形式,这些文本可以很方便的被语法分析及处理.查看支持管理命令了解更详细的信息.
A convenient set of task definitions for the Ant (version 1.4 or later) build tool. See Executing Manager Commands With Ant for more information.
为Ant(1.4或者是更高版本)编译工具的一种方便的任务定义设置.查看用Ant执行管理命令了解更多信息.
Future versions of Tomcat 5 will include administrative functionality that is presented in (at least) the following forms:
Tomcat 5 后面的版本包括了以下形式的管理功能:
As web services, so that Tomcat administration can be easily integrated into remote and/or non-Java management environments.
作为网络服务器.这样Tomcat管理就可以很容易的集成到远程以及/或者是非JAVA管理环境中.
As a web application with a nice user interface (built on top of the web services processing layer) for easy Tomcat administration via a web browser.
为简化通过网络浏览器对Tomcat管理,成为具有好的用户接口的网络应用程序(基于网络服务处理层顶层).
The description below uses the variable name $CATALINA_HOME to refer to the directory into which you have installed Tomcat 5, and is the base directory against which most relative paths are resolved. However, if you have configured Tomcat 5 for multiple instances by setting a CATALINA_BASE directory, you should use $CATALINA_BASE instead of $CATALINA_HOME for each of these references.
It would be quite unsafe to ship Tomcat with default settings that allowed anyone on the Internet to execute the Manager application on your server. Therefore, the Manager application is shipped with the requirement that anyone who attempts to use it must authenticate themselves, using a username and password that have the role manager associated with them. Further, there is no username in the default users file ($CATALINA_HOME/conf/tomcat-users.xml) that is assigned this role. Therefore, access to the Manager application is completely disabled by default.
To enable access to the Manager web application, you must either create a new username/password combination and associate the role name manager with it, or add the manager role to some existing username/password combination. Exactly where this is done depends on which Realm implementation you are using:
MemoryRealm - If you have not customized your $CATALINA_HOME/conf/server.xml to select a different one, Tomcat 5 defaults to an XML-format file stored at $CATALINA_HOME/conf/tomcat-users.xml, which can be edited with any text editor. This file contains an XML &user& for each individual user, which might look something like this:
&user name=&craigmcc& password=&secret& roles=&standard,manager& /&
which defines the username and password used by this individual to log on, and the role names he or she is associated with. You can add the manager role to the comma-delimited roles attribute for one or more existing users, and/or create new users with that assigned role.
JDBCRealm - Your user and role information is stored in a database accessed via JDBC. Add the manager role to one or more existing users, and/or create one or more new users with this role assigned, following the standard procedures for your environment.
JNDIRealm - Your user and role information is stored in a directory server accessed via LDAP. Add the manager role to one or more existing users, and/or create one or more new users with this role assigned, following the standard procedures for your environment.
The first time you attempt to issue one of the Manager commands described in the next section, you will be challenged to log on using BASIC authentication. The username and password you enter do not matter, as long as they identify a valid user in the users database who possesses the role manager.
In addition to the password restrictions the manager web application could be restricted by the remote IP address or host by adding a RemoteAddrValve or RemoteHostValve. Here is an example of restricting access to the localhost by IP address:
&Context path=&/manager& debug=&0& privileged=&true&
docBase=&/usr/local/kinetic/tomcat5/server/webapps/manager&&
&Valve className=&org.apache.catalina.valves.RemoteAddrValve&
allow=&127.0.0.1&/&
&/Context&
All commands that the Manager application knows how to process are specified in a single request URI like this:
http://{host}:{port}/manager/{command}?{parameters}
where {host} and {port} represent the hostname and port number on which Tomcat is running, {command} represents the Manager command you wish to execute, and {parameters} represents the query parameters that are specific to that command. In the illustrations below, customize the host and port appropriately for your installation.
Most commands accept one or more of the following query parameters:
path - The context path (including the leading slash) of the web application you are dealing with. To select the ROOT web application, specify &/&. NOTE - It is not possible to perform administrative commands on the Manager application itself.
war - URL of a web application archive (WAR) file, pathname of a directory which contains the web application, or a Context configuration &.xml& file. You can use URLs in any of the following formats:
file:/absolute/path/to/a/directory - The absolute path of a directory that contains the unpacked version of a web application. This directory will be attached to the context path you specify without any changes.
file:/absolute/path/to/a/webapp.war - The absolute path of a web application archive (WAR) file. This is valid only for the /deploy command, and is the only acceptable format to that command.
jar:file:/absolute/path/to/a/warfile.war!/ - The URL to a local web application archive (WAR) file. You can use any syntax that is valid for the JarURLConnection class for reference to an entire JAR file.
file:/absolute/path/to/a/context.xml - The absolute path of a web application Context configuration &.xml& file which contains the Context configuration element.
directory - The directory name for the web applciation context in the Host's application base directory.
webapp.war - The name of a web application war file located in the Host's application base directory.
Each command will return a response in text/plain format (i.e. plain ASCII with no HTML markup), making it easy for both humans and programs to read). The first line of the response wil begin with either OK or FAIL, indicating whether the requested command was successful or not. In the case of failure, the rest of the first line will contain a description of the problem that was encountered. Some commands include additional lines of information as described below.
Internationalization Note - The Manager application looks up its message strings in resource bundles, so it is possible that the strings have been translated for your platform. The examples below show the English version of the messages.
WARNING: the legacy commands /install and /remove are deprecated. They are presently equivalent to /deploy and /undeploy, but could be removed in a future release.
http://localhost:8080/manager/deploy?path=/foo
Upload the web application archive (WAR) file that is specified as the request data in this HTTP PUT request, install it into the appBase directory of our corresponding virtual host, and start it on the context path specified by the path request parameter. If no path is specified the directory name or the war file name without the .war extension is used as the path. The application can later be undeployed (and the corresponding application directory removed) by use of the /undeploy.
The .WAR file may include Tomcat specific deployment configuration, by including a Context configuration XML file in /META-INF/context.xml.
URL parameters include:
update: When set to true, any existing update will be undeployed first. The default value is set to false.
tag: Specifying a tag name, this allows associating the deployed webapp with a version number. The application version can be later redeployed when needed using only the tag.
NOTE - This command is the logical opposite of the /undeploy command.
If installation and startup is successful, you will receive a response like this:
OK - Deployed application at context path /foo
Otherwise, the response will start with FAIL and include an error message. Possible causes for problems include:
Application already exists at path /foo
The context paths for all currently running web applications must be unique. Therefore, you must undeploy the existing web application using this context path, or choose a different context path for the new one. The update parameter may be specified as a parameter on the URL, with a value of true to avoid this error. In that case, an undeploy will be performed on an existing application before performing the deployment.
Encountered exception
An exception was encountered trying to start the new web application. Check the Tomcat 5 logs for the details, but likely explanations include problems parsing your /WEB-INF/web.xml file, or missing classes encountered when initializing application event listeners and filters.
Invalid context path was specified
The context path must start with a slash character. To reference the ROOT web application use &/&.
No context path was specified The path parameter is required.
Deploy and start a new web application, attached to the specified context path (which must not be in use by any other web application). This command is the logical opposite of the /undeploy command.
There are a number of different ways the deploy command can be used.
Deploy a version of a previously deployed webapp
This can be used to deploy a previous version of a web application, which has been deployed using the tag attribute. Note that the work directory for the manager webapp will contain the previously deployed WARs; removing it would make the deployment fail.
http://localhost:8080/manager/deploy?path=/footoo&tag=footag
Deploy a Directory or WAR by URL
Deploy a web application directory or &.war& file located on the Tomcat server. If no path is specified, the directory name or the war file name without the &.war& extension is used as the path. The war parameter specifies a URL (including the file: scheme) for either a directory or a web application archive (WAR) file. The supported syntax for a URL referring to a WAR file is described on the Javadocs page for the java.net.JarURLConnection class. Use only URLs that refer to the entire WAR file.
In this example the web application located in the directory /path/to/foo on the Tomcat server is deployed as the web application context named /footoo.
http://localhost:8080/manager/deploy?path=/footoo&war=file:/path/to/foo
In this example the &.war& file /path/to/bar.war on the Tomcat server is deployed as the web application context named /bar. Notice that there is no path parameter so the context path defaults to the name of the web application archive file without the &.war& extension.
http://localhost:8080/manager/deploy?war=jar:file:/path/to/bar.war!/
Deploy a Directory or War from the Host appBase
Deploy a web application directory or &.war& file located in your Host appBase directory. If no path is specified the directory name or the war file name without the &.war& extension is used as the path.
In this example the web application located in a sub directory named foo in the Host appBase directory of the Tomcat server is deployed as the web application context named /foo. Notice that there is no path parameter so the context path defaults to the name of the web application directory.
http://localhost:8080/manager/deploy?war=foo
In this example the &.war& file bar.war located in your Host appBase directory on the Tomcat server is deployed as the web application context named /bartoo.
http://localhost:8080/manager/deploy?path=/bartoo&war=bar.war
Deploy using a Context configuration &.xml& file
If the Host deployXML flag is set to true you can deploy a web application using a Context configuration &.xml& file and an optional &.war& file or web application directory. The context path is not used when deploying a web application using a context &.xml& configuration file.
A Context configuration &.xml& file can contain valid XML for a web application Context just as if it were configured in your Tomcat server.xml configuration file. Here is an example:
&Context path=&/foobar& docBase=&/path/to/application/foobar&
debug=&0&&
&!-- Link to the user database we will get roles from --&
&ResourceLink name=&users& global=&UserDatabase&
type=&org.apache.catalina.UserDatabase&/&
&/Context&
When the optional war parameter is set to the URL for a web application &.war& file or directory it overrides any docBase configured in the context configuration &.xml& file.
Here is an example of deploying an application using a Context configuration &.xml& file.
http://localhost:8080/manager/deploy?config=file:/path/context.xml
Here is an example of deploying an application using a Context configuration &.xml& file and a web application &.war& file located on the server.
http://localhost:8080/manager/deploy?config=file:/path/context.xml&war=jar:file:/path/bar.war!/
Deployment Notes
If the Host is configured with unpackWARs=true and you deploy a war file, the war will be unpacked into a directory in your Host appBase directory.
If the application war or directory is installed in your Host appBase directory and either the Host is configured with autoDeploy=true or liveDeploy=true, the Context path must match the directory name or war file name without the &.war& extension.
For security when untrusted users can manage web applications, the Host deployXML flag can be set to false. This prevents untrusted users from deploying web applications using a configuration XML file and also prevents them from deploying application directories or &.war& files located outside of their Host appBase.
Deploy Response
If installation and startup is successful, you will receive a response like this:
OK - Deployed application at context path /foo
Otherwise, the response will start with FAIL and include an error message. Possible causes for problems include:
Application already exists at path /foo
The context paths for all currently running web applications must be unique. Therefore, you must undeploy the existing web application using this context path, or choose a different context path for the new one. The update parameter may be specified as a parameter on the URL, with a value of true to avoid this error. In that case, an undeploy will be performed on an existing application before performing the deployment.
Document base does not exist or is not a readable directory
The URL specified by the war parameter must identify a directory on this server that contains the &unpacked& version of a web application, or the absolute URL of a web application archive (WAR) file that contains this application. Correct the value specified by the war parameter.
Encountered exception
An exception was encountered trying to start the new web application. Check the Tomcat 5 logs for the details, but likely explanations include problems parsing your /WEB-INF/web.xml file, or missing classes encountered when initializing application event listeners and filters.
Invalid application URL was specified
The URL for the directory or web application that you specified was not valid. Such URLs must start with file:, and URLs for a WAR file must end in &.war&.
Invalid context path was specified
The context path must start with a slash character. To reference the ROOT web application use &/&.
Context path must match the directory or WAR file name: If the application war or directory is installed in your Host appBase directory and either the Host is configured with autoDeploy=true or liveDeploy=true, the Context path must match the directory name or war file name without the &.war& extension.
Only web applications in the Host web application directory can be installed If the Host deployXML flag is set to false this error will happen if an attempt is made to deploy a web application directory or &.war& file outside of the Host appBase directory.
http://localhost:8080/manager/list
List the context paths, current status (running or stopped), and number of active sessions for all currently deployed web applications. A typical response immediately after starting Tomcat might look like this:
OK - Listed applications for virtual host localhost
/webdav:running:0
/examples:running:0
/manager:running:0
/:running:0
http://localhost:8080/manager/reload?path=/examples
Signal an existing application to shut itself down and reload. This can be useful when the web application context is not reloadable and you have updated classes or property files in the /WEB-INF/classes directory or when you have added or updated jar files in the /WEB-INF/lib directory.
NOTE: The /WEB-INF/web.xml web application configuration file is not reread on a reload. If you have made changes to your web.xml file you must stop then start the web application.
If this command succeeds, you will see a response like this:
OK - Reloaded application at context path /examples
Otherwise, the response will start with FAIL and include an error message. Possible causes for problems include:
Encountered exception
An exception was encountered trying to restart the web application. Check the Tomcat 5 logs for the details.
Invalid context path was specified
The context path must start with a slash character. To reference the ROOT web application use &/&.
No context exists for path /foo
There is no deployed application on the context path that you specified.
No context path was specified The path parameter is required.
Reload not supported on WAR deployed at path /foo Currently, application reloading (to pick up changes to the classes or web.xml file) is not supported when a web application is deployed directly from a WAR file. It only works when the web application is deployed from an unpacked directory. If you are using a WAR file, you should undeploy and then deploy or deploy with the update parameter the application again to pick up your changes.
http://localhost:8080/manager/serverinfo
Lists information about the Tomcat version, OS, and JVM properties.
If an error occurs, the response will start with FAIL and include an error message. Possible causes for problems include:
Encountered exception
An exception was encountered trying to enumerate the system properties. Check the Tomcat 5 logs for the details.
http://localhost:8080/manager/resources[?type=xxxxx]
List the global JNDI resources that are available for use in resource links for context configuration files. If you specify the type request parameter, the value must be the fully qualified Java class name of the resource type you are interested in (for example, you would specify javax.sql.DataSource to acquire the names of all available JDBC data sources). If you do not specify the type request parameter, resources of all types will be returned.
Depending on whether the type request parameter is specfied or not, the first line of a normal response will be:
OK - Listed global resources of all types
OK - Listed global resources of type xxxxx
followed by one line for each resource. Each line is composed of fields delimited by colon characters (&:&), as follows:
Global Resource Name - The name of this global JNDI resource, which would be used in the global attribute of a &ResourceLink& element.
Global Resource Type - The fully qualified Java class name of this global JNDI resource.
If an error occurs, the response will start with FAIL and include an error message. Possible causes for problems include:
Encountered exception
An exception was encountered trying to enumerate the global JNDI resources. Check the Tomcat 5 logs for the details.
No global JNDI resources are available
The Tomcat server you are running has been configured without global JNDI resources.
http://localhost:8080/manager/roles
List the security role names (and corresponding descriptions) that are available in the org.apache.catalina.UserDatabase resource that is linked to the users resource reference in the web.xml file for the Manager web application. This would typically be used, for example, by a deployment tool that wanted to create &security-role-ref& elements to map security role names used in a web application to the role names actually defined within the container.
By default, the users resource reference is pointed at the global UserDatabase resource. If you choose to utilize a different user database per virtual host, you should modify the &ResourceLink& element in the default manager.xml context configuration file to point at the global user database resource for this virtual host.
When this command is executed, the first line of the response will be:
OK - Listed security roles
followed by one line for each security role. Each line is composed of fields delimited by colon characters (&:&) as follows:
Security Role Name - A security role name that is known to Tomcat in the user database.
Description - Description of this security role (useful in creating user interfaces for selecting roles.
If an error occurs, the response will start with FAIL and include an error message. Possible causes for problems include:
Cannot resolve user database reference - A JNDI error prevented the successful lookup of the org.apache.catalina.UserDatabase resource. Check the Tomcat log files for a stack trace associated with this error.
No user database is available - You have not configured a resource reference for the users resource that points at an appropriate user database instance. Check your manager.xml file and ensure that you have created an appropriate &ResourceLink& or &ResourceParams& element for this resource.
http://localhost:8080/manager/sessions?path=/examples
Display the default session timeout for a web application, and the number of currently active sessions that fall within ten-minute ranges of their actual timeout times. For example, after restarting Tomcat and then executing one of the JSP samples in the /examples web app, you might get something like this:
OK - Session information for application at context path /examples
Default maximum session inactive interval 30 minutes
30 - &40 minutes:1 sessions
http://localhost:8080/manager/start?path=/examples
Signal a stopped application to restart, and make itself available again. Stopping and starting is useful, for example, if the database required by your application becomes temporarily unavailable. It is usually better to stop the web application that relies on this database rather than letting users continuously encounter database exceptions.
If this command succeeds, you will see a response like this:
OK - Started application at context path /examples
Otherwise, the response will start with FAIL and include an error message. Possible causes for problems include:
Encountered exception
An exception was encountered trying to start the web application. Check the Tomcat 5 logs for the details.
Invalid context path was specified
The context path must start with a slash character. To reference the ROOT web application use &/&.
No context exists for path /foo
There is no deployed application on the context path that you specified.
No context path was specified The path parameter is required.
http://localhost:8080/manager/stop?path=/examples
Signal an existing application to make itself unavailable, but leave it deployed. Any request that comes in while an application is stopped will see an HTTP error 404, and this application will show as &stopped& on a list applications command.
If this command succeeds, you will see a response like this:
OK - Stopped application at context path /examples
Otherwise, the response will start with FAIL and include an error message. Possible causes for problems include:
Encountered exception
An exception was encountered trying to stop the web application. Check the Tomcat 5 logs for the details.
Invalid context path was specified
The context path must start with a slash character. To reference the ROOT web application use &/&.
No context exists for path /foo
There is no deployed application on the context path that you specified.
No context path was specified The path parameter is required.
http://localhost:8080/manager/undeploy?path=/examples
WARNING - This command will delete any web application artifacts that exist within appBase directory (typically &webapps&) for this virtual host. This will delete the the application .WAR, if present, the application directory resulting either from a deploy in unpacked form or from .WAR expansion as well as the XML Context definition from $CATALINA_HOME/conf/[enginename]/[hostname]/ directory. If you simply want to take an application out of service, you should use the /stop command instead.
Signal an existing application to gracefully shut itself down, and remove it from Tomcat (which also makes this context path available for reuse later). In addition, the document root directory is removed, if it exists in the appBase directory (typically &webapps&) for this virtual host. This command is the logical opposite of the /deploy command.
If this command succeeds, you will see a response like this:
OK - Undeployed application at context path /examples
Otherwise, the response will start with FAIL and include an error message. Possible causes for problems include:
Encountered exception
An exception was encountered trying to undeploy the web application. Check the Tomcat 5 logs for the details.
Invalid context path was specified
The context path must start with a slash character. To reference the ROOT web application use &/&.
No context exists for path /foo
There is no deployed application on the context path that you specified.
No context path was specified The path parameter is required.
In addition to the ability to execute Manager commands via HTTP requests, as documented above, Tomcat 5 includes a convenient set of Task definitions for the Ant (version 1.4 or later) build tool. In order to use these commands, you must perform the following setup operations:
Download the binary distribution of Ant from http://ant.apache.org. You must use version 1.4 or later.
Install the Ant distribution in a convenient directory (called ANT_HOME in the remainder of these instructions).
Copy the file server/lib/catalina-ant.jar from your Tomcat 5 installation into Ant's library directory ($ANT_HOME/lib).
Add the $ANT_HOME/bin directory to your PATH environment variable.
Configure at least one username/password combination in your Tomcat user database that includes the manager role.
To use custom tasks within Ant, you must declare them first with a &taskdef& element. Therefore, your build.xml file might look something like this:
&project name=&My Application& default=&compile& basedir=&.&&
&!-- Configure the directory into which the web application is built --&
&property name=&build&
value=&${basedir}/build&/&
&!-- Configure the context path for this application --&
&property name=&path&
value=&/myapp&/&
&!-- Configure properties to access the Manager application --&
&property name=&url&
value=&http://localhost:8080/manager&/&
&property name=&username& value=&myusername&/&
&property name=&password& value=&mypassword&/&
&!-- Configure the custom Ant tasks for the Manager application --&
&taskdef name=&deploy&
classname=&org.apache.catalina.ant.DeployTask&/&
&taskdef name=&list&
classname=&org.apache.catalina.ant.ListTask&/&
&taskdef name=&reload&
classname=&org.apache.catalina.ant.ReloadTask&/&
&taskdef name=&resources& classname=&org.apache.catalina.ant.ResourcesTask&/&
&taskdef name=&roles&
classname=&org.apache.catalina.ant.RolesTask&/&
&taskdef name=&start&
classname=&org.apache.catalina.ant.StartTask&/&
&taskdef name=&stop&
classname=&org.apache.catalina.ant.StopTask&/&
&taskdef name=&undeploy&
classname=&org.apache.catalina.ant.UndeployTask&/&
&!-- Executable Targets --&
&target name=&compile& description=&Compile web application&&
&!-- ... construct web application in ${build} subdirectory, and
generated a ${path}.war ... --&
&target name=&deploy& description=&Install web application&
depends=&compile&&
&deploy url=&${url}& username=&${username}& password=&${password}&
path=&${path}& war=&${build}${path}.war&/&
&target name=&reload& description=&Reload web application&
depends=&compile&&
url=&${url}& username=&${username}& password=&${password}&
path=&${path}&/&
&target name=&undeploy& description=&Remove web application&&
&undeploy url=&${url}& username=&${username}& password=&${password}&
path=&${path}&/&
&/project&
Now, you can execute commands like ant deploy to deploy the application to a running instance of Tomcat, or ant reload to tell Tomcat to reload it. Note also that most of the interesting values in this build.xml file are defined as replaceable properties, so you can override their values from the command line. For example, you might consider it a security risk to include the real manager password in your build.xml file's source code. To avoid this, omit the password property, and specify it from the command line:
ant -Dpassword=secret deploy
Using Ant version 1.6.2 or later, the Catalina tasks offer the option to capture their output in properties or external files. They support directly the following subset of the &redirector& type attributes:
Description
Name of a file to which to write the output. If the error stream is not also redirected to a file or property, it will appear in this output.
The file to which the standard error of the command should be redirected.
This attribute is used when you wish to see error output in Ant's log and you are redirecting output to a file/property. The error output will not be included in the output file/property. If you redirect error with the error or errorProperty attributes, this will have no effect.
Whether output and error files should be appended to or overwritten. Defaults to false.
createemptyfiles
Whether output and error files should be created even when empty. Defaults to true.
outputproperty
The name of a property in which the output of the command should be stored. Unless the error stream is redirected to a separate file or stream, this property will include the error output.
errorproperty
The name of a property in which the standard error of the command should be stored.
A couple of additional attributes can also be specified:
Description
This attribute is used when you wish to see the output you are capturing, appearing also in the Ant's log. It must not be used unless you are capturing task output. Defaults to false. This attribute will be supported directly by &redirector& in Ant 1.6.3
failonerror
This attribute is used when you wish to avoid that any manager command processing error terminates the ant execution. Defaults to true. It must be set to false, if you want to capture error output, otherwise execution will terminate before anything can be captured. This attribute acts only on manager command execution, any wrong or missing command attribute will still cause Ant execution termination.
They also support the embedded &redirector& element in which you can specify its full set of attributes, but input, inputstring and inputencoding that, even if accepted, are not used because they have no meaning in this context. Refer to ant manual for details on &redirector& element attributes.
Here is a sample build file extract that shows how this output redirection support can be used:
&target name=&manager.deploy&
depends=&context.status&
if=&context.notInstalled&&
&deploy url=&${mgr.url}&
username=&${mgr.username}&
password=&${mgr.password}&
path=&${mgr.context.path}&
config=&${mgr.context.descriptor}&/&
&target name=&manager.deploy.war&
depends=&context.status&
if=&context.deployable&&
&deploy url=&${mgr.url}&
username=&${mgr.username}&
password=&${mgr.password}&
update=&${mgr.update}&
path=&${mgr.context.path}&
war=&${mgr.war.file}&/&
&target name=&context.status&&
&property name=&running& value=&${mgr.context.path}:running&/&
&property name=&stopped& value=&${mgr.context.path}:stopped&/&
&list url=&${mgr.url}&
outputproperty=&ctx.status&
username=&${mgr.username}&
password=&${mgr.password}&&
&condition property=&context.running&&
&contains string=&${ctx.status}& substring=&${running}&/&
&/condition&
&condition property=&context.stopped&&
&contains string=&${ctx.status}& substring=&${stopped}&/&
&/condition&
&condition property=&context.notInstalled&&
&isfalse value=&${context.running}&/&
&isfalse value=&${context.stopped}&/&
&/condition&
&condition property=&context.deployable&&
&istrue value=&${context.notInstalled}&/&
&istrue value=&${context.running}&/&
&istrue value=&${mgr.update}&/&
&istrue value=&${context.stopped}&/&
&istrue value=&${mgr.update}&/&
&/condition&
&condition property=&context.undeployable&&
&istrue value=&${context.running}&/&
&istrue value=&${context.stopped}&/&
&/condition&
WARNING: even if it doesn't make many sense, and is always a bad idea, calling a Catalina task more than once, badly set Ant tasks depends chains may cause that a task be called more than once in the same Ant run, even if not intended to. A bit of caution should be exercised when you are capturing output from that task, because this could lead to something unexpected:
when capturing in a property you will find in it only the output from the first call, because Ant properties are immutable and once set they cannot be changed,
when capturing in a file, each run will overwrite it and you will find in it only the last call output, unless you are using the append=&true& attribute, in which case you will see the output of each task call appended to the file.
The JMX Proxy Servlet is a lightweight proxy to get and set the tomcat internals. (Or any class that has been exposed via an MBean) Its usage is not very user friendly but the UI is extremely help for integrating command line scripts for monitoring and changing the internals of tomcat. You can do two things with the proxy: get information and set information. For you to really understand the JMX Proxy Servlet, you should have a general understanding of JMX. If you don't know what JMX is, then prepare to be confused.
This takes the form:
http://webserver/manager/jmxproxy/?qry=STUFF
Where STUFF is the JMX query you wish to perform. For example, here are some queries you might wish to run:
qry=*%3Atype%3DRequestProcessor%2C* --& type=RequestProcessor which will locate all workers which can process requests and report their state.
qry=*%3Aj2eeType=Servlet%2c* --& j2eeType=Servlet which return all loaded servlets.
qry=Catalina%3Atype%3DEnvironment%2Cresourcetype%3DGlobal%2Cname%3DsimpleValue --& Catalina:type=Environment,resourcetype=Global,name=simpleValue which look for a specific MBean by the given name.
You'll need to experiment with this to really understand its capabilites. If you provide no qry parameter, then all of the MBeans will be displayed. We really recommend looking at the tomcat source code and understand the JMX spec to get a better understanding of all the queries you may run.
Now that you can query an MBean, its time to muck with Tomcat's internals! The general form of the set command is :
http://webserver/manager/jmxproxy/?set=BEANNAME&att=MYATTRIBUTE&val=NEWVALUE
So you need to provide 3 request parameters:
set: The full bean name
att: The attribute you wish to alter
val: The new value
If all goes ok, then it will say OK, otherwise an error message will be shown. For example, lets say we wish to turn up debugging on the fly for the ErrorReportValve. The following will set debugging to 10.
http://localhost:8080/manager/jmxproxy/
?set=Catalina%3Atype%3DValve%2Cname%3DErrorReportValve%2Chost%3Dlocalhost&att=debug&val=10
and my result is (YMMV):
Result: ok
Here is what I see if I pass in a bad value. Here is the URL I used, I try set debugging equal to 'cowbell':
http://localhost:8080/manager/jmxproxy/
?set=Catalina%3Atype%3DValve%2Cname%3DErrorReportValve%2Chost%3Dlocalhost&att=debug&val=cowbell
When I try that, my result is
Error: java.lang.NumberFormatException: For input string: &cowbell&
Copyright & , Apache Software Foundation
版权声明:本文为博主原创文章,未经博主允许不得转载。
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:4645823次
积分:48435
积分:48435
排名:第32名
原创:462篇
转载:209篇
译文:28篇
评论:1531条
(3)(7)(7)(10)(3)(5)(2)(3)(10)(3)(1)(10)(8)(1)(1)(11)(13)(18)(9)(5)(2)(13)(14)(31)(1)(1)(2)(3)(4)(13)(3)(1)(12)(6)(4)(6)(4)(2)(1)(6)(15)(35)(11)(3)(2)(25)(2)(3)(13)(2)(5)(2)(1)(15)(5)(7)(8)(41)(33)(54)(40)(7)(2)(4)(1)(12)(17)(3)(8)(8)(1)(55)

我要回帖

更多关于 韩语谢谢中文怎么说 的文章

 

随机推荐