user1691070
user1691070

Reputation: 363

Can't run Tomcat from Intellij Idea

I installed Tomcat using this guide: https://help.ubuntu.com/13.04/serverguide/tomcat.html

When I successfully run it from the console, but when I try to run it using Intellij Idea error occurs: "Error running Tomcat : Can't find directory '/usr/share/tomcat7/conf'"

Application server configuration in Idea:

Tomcat Home: /usr/share/tomcat7
Tomcat Base: /var/lib/tomcat7

Upvotes: 24

Views: 30399

Answers (3)

Ercross
Ercross

Reputation: 646

I encountered the same problem earlier and followed these steps to get it working:

  1. create a new group for tomcat sudo groupadd tomcat

  2. create a tomcat user and add this user to the tomcat group created earlier sudo useradd -M -s /bin/nologin -g tomcat -d /opt/tomcat tomcat

  3. Update permissions for tomcat on the installation directory (e.g., /opt/tomcat as used above)

sudo chgrp -R tomcat /opt/tomcat (this gives tomcat ownership over the directory)
sudo chmod -R g+r conf
sudo chmod g+x conf (this and the one above gives tomcat read/write perm on conf dir)
sudo chown -R tomcat webapps/ work/ temp/ logs/ (makes user, tomcat, owner of the following dirs)
4. Open tomcat installation parent directory, i.e., /opt, as root, right click on the tomcat folder -> properties -> permissions -> folder access, change to create and delete files.```

And Jesus said, "It is finished."

Upvotes: 0

Kayvan Tehrani
Kayvan Tehrani

Reputation: 3210

In my case, creating a soft link and changing the access permission solved the problem

    cd /usr/share/tomcat7
    ln -s /etc/tomcat7 conf
    chmod -R 655 /etc/tomcat7/

I have replied to the similar question here

Upvotes: 23

mish
mish

Reputation: 1065

The problem is that the layout is as they call "non-standard"

The problem has been marked as solved here: IntelliJ needs to copy tomcat conf dir to project directory

Note that Tomcat installed using the package manager on some Linux systems has non-standard layout and permissions, and therefore will not work with IDEA.

Upvotes: 15

Related Questions