Tomcat 5.5.23 文档阅读Tips 4 - Manager
2011-01-11 22:33
295 查看
本文介绍Tomcat Manager。Tomcat manager就是一个Tomcat自带的web app,用来作一些管理用途。他能干下面的一些事情:
(1) Deploy a new web application, on a specified context path, from the uploaded contents of a WAR file.
(2) Deploy a new web application, on a specified context path, from the server file system.
(3) List the currently deployed web applications, as well as the sessions that are currently active for those web apps.
(4) Reload an existing web application, to reflect changes in the contents of /WEB-INF/classes or /WEB-INF/lib.
(5) List the OS and JVM property values.
(6) List the available global JNDI resources, for use in deployment tools that are preparing <ResourceLink> elements nested in a <Context> deployment description.
(7) List the available security roles defined in the user database.
(8) Start a stopped application (thus making it available again).
(9) Stop an existing application (so that it becomes unavailable), but do not undeploy it.
(10) Undeploy a deployed web application and delete its document base directory (unless it was deployed from file system).
manager这个web应用的context配置在$CATALINA_HOME/conf/[enginename]/[hostname]目录下,名为manager.xml
1. 其实manager本身没什么好讲的,都是web界面的,自己进去看一下就OK了。这里主要需要讲这么几个东西:manager的调用/访问方法;配置一个能使用manager的账户。
2. OK, manager的访问和调用方法。除了直接访问http://localhost/manager/html这种方法之外,我们还可以通过在URL上带参数的方式,从而直接执行manager的某项功能,如:http://{host}:{port}/manager/{command}?{parameters},这样的好处就是manager能很方便的和一些其他应用集成,其他应用通过这种直接调用的方式来取道Tomcat中的一些信息。在下个版本的manager中,Tomcat会考虑将它做成web service,这样就更容易集成了。此外,manager还可以和ANT集成起来。
3. 配置一个manager的使用账户。Tomcat默认情况下是没有配置manager账户的,也就是说,当Tomcat刚装好的时候,没人能使用manager,这当然是出自安全的考虑。要想使用manager,要做如下配置:在$CATALINA_HOME/conf/tomcat-users.xml文件中,配置一个账户,隶属于manager role(这里的role就相当于Linux系统中的group)。当然,通过配置Realm,我们可以让这个账户不配置在tomcat-users.xml中,也可以配置在数据库中,LDAP中等等,这些东西可以参考Realm的配置。OK,所以我们可以这样配置:
<user name="craigmcc" password="secret" roles="standard,manager" />
这样用craigmcc, secret就可以登陆使用manager web app了。
4. 除了配置用户名和密码之外,manager还支持对IP的限制,这需要修改manager的context配置,如下:
CODE: SELECT ALL
这样就只允许127.0.0.1这个IP用用户名和密码来访问manager。
OK,其他的内容自己登陆进入manager就很容易学会和使用了,不再赘述。
(1) Deploy a new web application, on a specified context path, from the uploaded contents of a WAR file.
(2) Deploy a new web application, on a specified context path, from the server file system.
(3) List the currently deployed web applications, as well as the sessions that are currently active for those web apps.
(4) Reload an existing web application, to reflect changes in the contents of /WEB-INF/classes or /WEB-INF/lib.
(5) List the OS and JVM property values.
(6) List the available global JNDI resources, for use in deployment tools that are preparing <ResourceLink> elements nested in a <Context> deployment description.
(7) List the available security roles defined in the user database.
(8) Start a stopped application (thus making it available again).
(9) Stop an existing application (so that it becomes unavailable), but do not undeploy it.
(10) Undeploy a deployed web application and delete its document base directory (unless it was deployed from file system).
manager这个web应用的context配置在$CATALINA_HOME/conf/[enginename]/[hostname]目录下,名为manager.xml
1. 其实manager本身没什么好讲的,都是web界面的,自己进去看一下就OK了。这里主要需要讲这么几个东西:manager的调用/访问方法;配置一个能使用manager的账户。
2. OK, manager的访问和调用方法。除了直接访问http://localhost/manager/html这种方法之外,我们还可以通过在URL上带参数的方式,从而直接执行manager的某项功能,如:http://{host}:{port}/manager/{command}?{parameters},这样的好处就是manager能很方便的和一些其他应用集成,其他应用通过这种直接调用的方式来取道Tomcat中的一些信息。在下个版本的manager中,Tomcat会考虑将它做成web service,这样就更容易集成了。此外,manager还可以和ANT集成起来。
3. 配置一个manager的使用账户。Tomcat默认情况下是没有配置manager账户的,也就是说,当Tomcat刚装好的时候,没人能使用manager,这当然是出自安全的考虑。要想使用manager,要做如下配置:在$CATALINA_HOME/conf/tomcat-users.xml文件中,配置一个账户,隶属于manager role(这里的role就相当于Linux系统中的group)。当然,通过配置Realm,我们可以让这个账户不配置在tomcat-users.xml中,也可以配置在数据库中,LDAP中等等,这些东西可以参考Realm的配置。OK,所以我们可以这样配置:
<user name="craigmcc" password="secret" roles="standard,manager" />
这样用craigmcc, secret就可以登陆使用manager web app了。
4. 除了配置用户名和密码之外,manager还支持对IP的限制,这需要修改manager的context配置,如下:
CODE: SELECT ALL
<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>
这样就只允许127.0.0.1这个IP用用户名和密码来访问manager。
OK,其他的内容自己登陆进入manager就很容易学会和使用了,不再赘述。
相关文章推荐
- Tomcat 5.5.23 文档阅读Tips 12 - APR and Tomcat
- Tomcat 5.5.23 文档阅读Tips 11 - Default Servlet
- Tomcat 5.5.23 文档阅读Tips 10 - SSL
- Tomcat 5.5.23 文档阅读Tips 9 - Class Loading
- Tomcat 5.5.23 文档阅读Tips 8 - JNDI Datasource
- Tomcat 5.5.23 文档阅读Tips 7 - JNDI Resources
- Tomcat 5.5.23 文档阅读Tips 6 - Security Manager
- Tomcat 5.5.23 文档阅读Tips 5 - Realms and Access Control
- Tomcat 5.5.23 文档阅读Tips 3 - Deployer
- Tomcat 5.5.23 文档阅读Tips 2 - Setup,有JSVC的重要内容
- Tomcat 5.5.23 文档阅读Tips 1 - Introduction
- Tomcat StringManager阅读学习 -我们到底能走多远系列(10)
- tomcat-redis-session-manager 是一个用来将 Tomcat 的 Sessi
- Tomcat5.5.23 配置mysql数据库连接池
- 让man文档在windows下阅读
- linux音频alsa-uda134x驱动文档阅读之九(咔咔声)(不完整)
- ovx openVirtex的阅读文档
- Bmob文档阅读3-特殊实体BmobUser【用户管理】
- 【转】Tomcat源代码阅读系列
- 微信公共开发者文档 阅读笔记