分享
 
 
 

使用tomcat的manager功能的试验与体会

王朝java/jsp·作者佚名  2006-01-08
窄屏简体版  字體: |||超大  

使用tomcat4的manager功能的试验与体会。

一)启用manager功能。

在测试Struts的时候,修改了struts-config.xml文件,需要重启tomcat进行测试。

每次重启感觉很麻烦,突然想起以前使用过的tomcat的manager功能,可以很方便的对web application进行启动、停止、重启、移除等操作,可省却频繁重新启动整个容器服务器的麻烦。

可输入地址:http://localhost:8080/manager/html总提示没有权限。

打开server\webapps\manager目录,没有看到jsp、Servlet文件。是不是没有找到相应的管理Servlet.它应该web.xml文件定义映射。

系统使用了:org.apache.catalina.servlets.HTMLManagerServlet,这个类在j2ee.jar包中。

将j2ee.jar放server\webapps\manager\WEB-INF\lib下,重新启动tomcat.

发现提示信息:由于j2ee.jar包中包括了Servlet.class,违反了Servelet2.3的规范,tomcat没有装载该jar.

用winrar打开该文件,删除Servlet目录。

重新启动tomcat,还是不能使用manage功能。

没有办法,硬着头皮看它的E文帮助文档。原来需要在conf/tomcat-users.xml文件中加入管理的角色。

在xml文件中添加一行, <role rolename="manager"/>

并给root授权。<user username="root" password="root" roles="tomcat,role1,admin,manager"/>

重新启动,一切OK。可以使用tomcat的管理功能了,很方便的。大家可以试一试。

二)manage使用体会。

其实这个体会是我以前在使用的时候,随手做的笔记。

大家有兴趣,可以先读一读,有问题再与我联系。

version:4.1.24

by caozhaoyong

1. tomcat directories structure of webapps.

you have many ways to define context(root virtual path and file path, it's a map.):

a. define context in file: tomcat/conf/server.xml, the content likes this:

<Context path="/a" docBase="e:/a" debug="0" privileged="true" reloadable="true">

</Context>

b. put the content block in a seperate file xxx.xml,and copy the file to tomcat/webapps/. Rember: one file maps one web application, you can specifile the xml file name as you want.

c. put your web application directory in tomcat/webapps, and then you can visit it: .../yourwebapp.

you need tomcat first.

Tomcat will check $tomcat$\webapps\*.xml files, add all these contexts and all directories in tomcat/webapps

to the tomcat services, don't try to put some other formatted xml files here, tomcat will complain some errors at

the start stage.

you can visit all the directories in tomcat/webapp/, http://localhost:8080/webapplicationname

2. Root is a special directory, you can't visit it via http://localhost:8080/Root.

You can renane Root to root and then you can treat it as regular directory and normal web application.

You can change the default root webapp in tomcat/conf/server.xml file,check it.

3. use "Tomcat Web Application Manager " to manager web application.

the manager url is : http://localhost:8080/manager/html/

you can start, stop, reload and remove the web applicaitons.

manager lists all the web applications in tomcat services.

if you add some new web applications, you should restart tomcat and then the manager can list the new

web application name, then you can operate the web application.

but you have another way to achieve it, use install method in manager.

input your new context: /aaa

input the real directory: file://D:/Tomcat/webapps/aaa

click: install

you can visit your new web application: http://localhsot:8080/aaa

Caution:

1. if you don't define web-inf in aaa, you can use the web application just after you install it.

but if you restart tomcat, the webapp will be unvaliable.

You must create web-inf in you web applicaiton, but you can let the directory include nothing.

2. don't use "remove" in manager pages if your web application directory just in tomcat/webapps,

it will drop your webpplicaiton from you hard disk completely!

If your web application in other directories, you can just remove the context from tomcat services.

and you can reinstall it to the services or restart tomcat.

End..

hajavaor@eyou.com

19843788

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有