tomcat [Ubuntu]-警告:所选目录不是有效的Tomcat主页 [英] tomcat [Ubuntu] - Warning: The selected directory is not a valid Tomcat home

查看:605
本文介绍了tomcat [Ubuntu]-警告:所选目录不是有效的Tomcat主页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在PC上安装了Tomcat 9(在Ubuntu 16.04上).

I have installed Tomcat 9 in my PC (on Ubuntu 16.04).

我还在端口8080上成功启动了服务器.

I also successfully started the server in port 8080.

问题是,当我尝试配置Intellij IDEA来运行Tomcat服务器时,它会引发以下错误:

The problem is, when I try to configure Intellij IDEA to run a Tomcat server, it throws the following error:

我不知道Tomcat home: opt/tomcat的问题是什么,因为我的PC上没有其他tomcat文件夹,如图所示,它可以正常工作.我曾尝试放入内部opt/tomcat文件夹,例如Tomcat home: opt/tomcat/binTomcat home: opt/tomcat/lib(可执行文件所在的位置),但是它也不起作用.

I don't know what the problem with the Tomcat home: opt/tomcat is since i have no other tomcat folder on my PC, and as shown, it works perfectly. I have tried putting inner opt/tomcat folders, like Tomcat home: opt/tomcat/bin or Tomcat home: opt/tomcat/lib (where executables are), but it doesn't work either.

推荐答案

IntelliJ IDEA支持 https://tomcat.apache.org .程序包管理器安装的特定于操作系统的发行版可能具有非标准布局.我们建议下载并使用官方发行版.至少您可以将其与所需的内容进行比较,以查找丢失的内容或位于其他位置的内容.

IntelliJ IDEA supports the standard Tomcat layout for the official distributions from https://tomcat.apache.org. OS specific distributions installed by the package managers may have non-standard layout. We recommend to download and use the official distribution. At least you can compare it to what you have to find out what's missing or located in a different place.

还要检查您是否具有当前的IDE版本.我已经使用IntelliJ IDEA 2017.2.1进行了验证,该软件可以在 http://www.jetbrains上获得. com/idea/download/index.html 并具有当前可用的最新Tomcat 9版本(9.0.0.M26),并且运行良好:

Also check that you have the current IDE version. I've verified with IntelliJ IDEA 2017.2.1 available at http://www.jetbrains.com/idea/download/index.html and with the latest Tomcat 9 version available at the moment (9.0.0.M26) and it works fine:

在您的特定情况下,IntelliJ IDEA无法从服务器安装目录中读取文件,因为从其运行的用户IDE对服务器安装目录没有任何权限.出于开发目的,只需将服务器分发下载并解压缩到您的主目录就足够了,而无需更改此目录的任何权限.这样,IDE将能够读取文件并使用此安装.

In your specific case IntelliJ IDEA was not able to read the files from the server installation directory because the user IDE was running from had no any permissions to the server installation directory. For development purposes it's enough to just download and unpack the server distribution into your home directory without changing any permissions for this directory. This way IDE will be able to read the files and use this installation.

创建一个单独的用户并将权限限制为 仅对向公众开放的生产服务器是必需的.在服务器受到威胁或在JVM,应用服务器或在此服务器上运行的应用程序中发现任何安全漏洞的情况下,这是一种很好的安全措施,可以限制可能对系统造成的损害.

Creating a separate user and limiting the permissions as described in the guide you've followed is only needed for the production servers that are open to public. It's a good security measure to limit the possible harm to the system in case the server is compromised or any security vulnerability is found in the JVM, the app server or your application running on this server.

这篇关于tomcat [Ubuntu]-警告:所选目录不是有效的Tomcat主页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆