This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Apache 2.5 with tomcat 8 setup problem  RSS feed

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an apache 2.4 on Debian Jessie and I host several sites as virtual hosts.
On of these sites is running on jsp so I hav installed tomcat 8 and I use mod_jk.

My virtual host configuration file for apache is:


On tomcat's server.xml I have a host record as:


Site is running here and I get a "permission denied" error where I access

I use ispconfig and for each domain, I must have a directory where apache's domains directories resides, regardless if this domain is served from apache or in my case from tomcat. So for this domain I have a corresponding directory on both apache and tomcat. I also have an index.jsp on both tomcat domain root directory and apache's domain root directory.

When I access I get an uncompiled jsp page ( I see the source code ) on my browser.
A strange think is that this uncompiled page, is not from tomcat's directory but from apache's domain directory.

any help is appreciated.

Thanks in advance,

Christoforos Korifidis
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this was resolved with the help of André Warnier  from tomcat mailing list.
For anyone having the same problem the solutin is to change


Saloon Keeper
Posts: 20507
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The reason for this is that "" is the domain name. A URL in the Tomcat world consists of a domain part (domain name and optionally port number), a context part - which in this case identifieds which webapp within the target Tomcat server to send the request to, a servlet part, which tells Tomcat which servlet or JSP to send the request to, and a resource ID which can be used as an unnamed argument to the servlet or JSP.

Technically the servlet part is optional. If the URL, once domain and context parts are removed, matches a URL pattern defined for a servlet in the web.xml, then that's the servlet that gets the request. If it does not, there's an invisible "default servlet" that attempts to match the remaining URL path to a WAR-relative resource path of a JSP. And if neither of those attempts match, then the default servlet looks for a resource whose path matches the remaining URL and attempts to resolve it. If the resource is a directory, Tomcat generates a directory listing (unless told not to), if it's a regular "file" resource like CSS, javascript or an image, it generates suitable response headers to the response stream and copies the resource out as a response.

In your case, domain name was defined to Apache as a VirtualHost, so that part is taken care of by Apache. Then the JkMount defines what the remaining parts of the URL are that will route to Tomcat. You can actually get very creative and make Apache-relative contexts that send requests to different backends. For example, ajp13_worker1 might receive all requests targeting and send them to Tomcat Server1 and might be JkMount'ed to be sent to Tomcat Server2. Or even to a non-Java backend server.

I’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
Become a Java guru with IntelliJ IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!