• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tomcat + Apache mod_jk PUT gives 405

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was using Tomcat standalone and I could send files to the server with the PUT request-method with no problems (in a REST Web Service).

Now that I have Apache hooked into Tomcat with mod_jk, the PUT request gives me a 405 error (method not allowed)

In Apache's httpd.conf file, one can set up a cgi script to allow the PUT method...i.e.



The question is...how do I set this up so that the PUT request gets forwarded to a servlet or a JSP instead of a cgi script? I tried serveral different things to no avail.

Any help would be appreciated.

Thanks.
 
Jack Coleman
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I still have not figured this one out.

As a temporary workaround, I set up a second connector in Tomcat (listening on the port 8888) and I do all of my PUT requests to that port instead of the default port 80.

I don't like having to do this because I have to open up the port 8888 on the firewall and it kind of defeats the purpose of using Apache and mod_jk if everything can't be done through port 80.

Still looking for someone who has come upon this problem (I still can't believe that I'm the only one who has ever come across this problem).

The folks on the tomcat mailing list are helpful, but still no luck.
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jack, if you do a search on "mod_jk" you got lots of past discussions regarding your topic.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Jack,

You need to make sure your cgi is setup in the httpd.conf for this virtualhost, then you need to include jkmounts for what you wish tomcat to handle. For example:
JkAutoAlias /home/path/to/you/tomcat/webapps
JkMount /*.jsp ajp13
JKMount /*/*.jsp ajp13
JkMount /servlet/ ajp13
JkMount /admin/* ajp13
JkMount /manager/* ajp13
JKMount /servlets-examples/* ajp13

By specifying the .jsp tomcat will only handle that and wherever your cgi-bin is located and defined for that virtual host will work.

Howeer - I have had some problems with this in the past as apache and tomcat fight over what to handle.
 
Jack Coleman
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jack, if you do a search on "mod_jk" you got lots of past discussions regarding your topic.



Well, Ben, thanks for that. I have searched a whole bunch, and I could not find any past discussions WITH A SOLUTION to this particular problem. If you know of any specific discussions with working solutions, please let me know.

You need to make sure your cgi is setup in the httpd.conf for this virtualhost...



Thanks John, but I am looking for a non CGI way to do this. I would like the JSP to handle the request (as it does when Apache is not involved). Once Apache is put in front of Tomcat, it denys all PUT reqests.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic