aspose file tools*
The moose likes Tomcat and the fly likes Tomcat + Apache mod_jk PUT gives 405 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat + Apache mod_jk PUT gives 405" Watch "Tomcat + Apache mod_jk PUT gives 405" New topic
Author

Tomcat + Apache mod_jk PUT gives 405

Jack Coleman
Ranch Hand

Joined: Apr 08, 2002
Posts: 32
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.


Tell me, Mr. Anderson, what good is a phone call when you are unable to speak?
Jack Coleman
Ranch Hand

Joined: Apr 08, 2002
Posts: 32
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.
Ben Zung
Ranch Hand

Joined: Mar 25, 2004
Posts: 109
Jack, if you do a search on "mod_jk" you got lots of past discussions regarding your topic.
John Larsen
Greenhorn

Joined: May 19, 2004
Posts: 7
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

Joined: Apr 08, 2002
Posts: 32
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.
 
jQuery in Action, 2nd edition
 
subject: Tomcat + Apache mod_jk PUT gives 405