我在Ubuntu 15.10上安装了tomcat8,当我去的时候,我得到了通常的欢迎屏幕:
http://myhost:8082/
(我在server.xml中将端口重新配置为8082)。
但我无法访问经理gui:
http://myhost:8082/manager/html
我在 /etc/tomcat8/tomcat-users.xml 文件中尝试了以下操作,然后重新启动tomcat8:
sudo /etc/init.d/tomcat8 restart
以下是我尝试过的修改内容:
1)
<role rolename="manager-gui"/>
<user username="admin" password="12345" roles="manager-gui"/>
2)
<user username="user" password="password" roles="admin-gui,manager-gui" />
我发现其他SO帖子和博客都描述了新的方式,因此配置用户/角色但没有一个工作。相反,我一直得到:
cat catalina.out
INFO: Starting service Catalina
Apr 27, 2016 10:36:32 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.0.26 (Ubuntu)
Apr 27, 2016 10:36:32 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat8/webapps/ROOT
Apr 27, 2016 10:36:32 PM org.apache.catalina.core.StandardContext setPath
WARNING: A context path must either be an empty string or start with a '/' and do not end with a '/'. The path [/] does not meet these criteria and has been changed to []
Apr 27, 2016 10:36:34 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Apr 27, 2016 10:37:36 PM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [61,847] milliseconds.
Apr 27, 2016 10:37:36 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /var/lib/tomcat8/webapps/ROOT has finished in 63,602 ms
Apr 27, 2016 10:37:36 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8082"]
Apr 27, 2016 10:37:36 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 63722 ms
答案 0 :(得分:1)
看起来您根本没有安装经理应用。默认情况下,它没有安装ubuntu的tomcat。在Ubuntu 14.04中有一个包tomcat7-admin - 我假设您可以在15.10中找到tomcat8-admin - 检查aptitude search tomcat
的结果并验证可用的包,然后sudo aptitude install tomcat8 -admin。
安装时,请记住正确保护它 - 您不应该在生产系统中使用它而不明确限制谁有权访问它(不仅仅是用户名/密码)