Linux – How to figure out why a tomcat6 webapps dir symbolic link works on one machine, but not another

jsplinuxtomcat6virtual-machines

I recently built an Ubuntu virtual machine for MarkLogic development. The machine was then distributed to 4 other developers to provide a consistent dev platform. Now I'm setting up another piece to the dev puzzle that consists of some java libraries and a JSP web application. The project source lives in the developer user home directory (each machine has the same exact account). I added a symbolic link into the /var/lib/tomcat6/webapps/ directory that points to the web application source root in the project directory.

/var/lib/tomcat6/webapps/jspapp -> /home/developer/dev/workspace/svn/Project/webapp/

(The actual JSP files live in the Project/webapp directory.)

This works fine on my instance of the VM. I successfully replicated the setup to one other VM and it worked fine. However, the rest of the VMs on which I replicate the setup don't work. On the first 2 VMs, I get the web app's pages. On the other VMs I get 404s.

The VMs were all cloned from a single original. All of the web app project source is the same except for 1 configuration value (the local machine's IP address). I created the symbolic link in the same way on each and verified that permissions/modes of the files and directories are the same. I compared the tomcat installation directories and see no configuration differences between them. The only file differences I do see are what appear to be the cache data of Catalina. For all intents and purposes, the setups are identical. Yet, clearly, something is not the same.

Does anyone have a suggestion as to how I can troubleshoot this problem? I am rather new to the linux world and brand new to tomcat.

Update – I copied the contents of the linked directory into a real directory of the same name (after deleting the link) and it still doesn't work. However, I can see a copy of /var/lib/tomcat6/webapps/ROOT/index.html that I put into the directory in question. It's behaving almost like the JSP files are getting ignored.

Best Answer

A quick checklist:

  1. Check that allowLinking="true" was set in your Tomcat config: https://stackoverflow.com/questions/315093/configure-symlinks-for-single-directory-in-tomcat/315145#315145

  2. Check that the user of the tomcat process has execute permission on every parent folder of the /home/developer/dev/workspace/svn/Project/webapp/ directory (i.e. /home, /home/developer, /home/developer/dev, /home/developer/dev/workspace, ...)