我已经在Ubuntu 15.10上安装了tomcat8,当我转到以下位置时,我得到了通常的欢迎屏幕:
http://myhost:8082/
(我在server.xml中将端口重新配置为8082)。
但是我无法在以下位置访问manager 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
最佳答案
看起来您根本没有安装manager应用。默认情况下未与ubuntu的tomcat一起安装。在Ubuntu 14.04中有一个软件包tomcat7-admin-我假设您可能可以在15.10中找到tomcat8-admin-检查aptitude search tomcat
的结果并验证可用的软件包,然后sudo aptitude安装tomcat8-admin。
在安装它时,请记住要对其进行适当的保护-在生产系统中,如果不明确限制谁可以访问它(除了用户名/密码),就不应在生产系统中使用它