Newbie Tomcat & mod_jk Help

Upload core product.
Post Reply
CortoMaltese
Posts: 19
Joined: Sun Sep 13, 2009 10:25 am

Newbie Tomcat & mod_jk Help

Post by CortoMaltese »

Hello

I installed Tomcat and modjk on my server because i wanted to use the process.jsp version
so, when i do

myserver:8080

it's fine, i have the tomcat welcome page

myserver:8080/examples/servlets/ and
myserver:8080/examples/jsp/ both work fine

in httpd.conf

i have

Code: Select all

JkMount /examples/servlets/* ajp13
JkMount /examples/jsp/* ajp13
so
myserver/examples/servlets/ and
myserver/examples/jsp/ both work perfectly either

I installed Jfileupload and JSP upload script 2.1 in a dir named jsptestupload

so i added

Code: Select all

JkMount /jsptestupload/* ajp13
to httpd.conf
but well to make it short with or without this line :

myserver:8080/jsptestupload/ do not work
and
myserver/jsptestupload/ do not work either

i have
Status HTTP 404 - /jsptestupload/process.jsp

type Rapport d'état

message /jsptestupload/process.jsp

description La ressource demandée (/jsptestupload/process.jsp) is not available
Apache Tomcat/6.0.20
yet of course its in the dir

I'm really newbie, so any help could... well ... help :)

Thanks a lot

Corto

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Newbie Tomcat & mod_jk Help

Post by support »

And does it work with port 8080 ?
You have to copy jspupload.zip under TOMCAT_HOME/webapps and rename jspupload.zip into jspupload.war and then start TOMCAT.

CortoMaltese
Posts: 19
Joined: Sun Sep 13, 2009 10:25 am

Re: Newbie Tomcat & mod_jk Help

Post by CortoMaltese »

no for the 8080 port i does not work


do you mean that jspupload will be the available for all the sites on the server ?

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Newbie Tomcat & mod_jk Help

Post by support »

No, in fact before testing with Apache (port 80) you have to test with TOMCAT (port 8080) directly.
When it works then you close 8080 port to make sure end-user access the JSP through Apache (port 80).

Could you try:
1 - Stop TOMCAT
2 - Download jspupload2.1.zip from:
http://www.jfileupload.com/products/tools/index.html
3 - Copy jspupload2.1.zip into TOMCAT_HOME/webapps
4 - Rename jspupload2.1.zip into jspupload2.1.war
5 - Start TOMCAT
6 - Go to TOMCAT_HOME/webapps/jspupload2.1 (which should have been created on TOMCAT startup) and update process.jsp with the correct upload path on your server.
7 - Try http://yourserver.com:8080/jspupload2.1/process.jsp in your browser.
8 - Upload a small file for the HTML form displayed.
9 - If it works then download JFileUpload from:
http://www.jfileupload.com/products/jfi ... l#download
10 - Open applet_http.js and update both "url" parameters such as:
<PARAM NAME="url" VALUE="http://yourserver.com:8080/jspupload2.1/process.jsp">
11 - Open applet_http.html in your browser and try to upload a file again.

When all of these work then you can try to configure mod_jk into Apache as you did.

Does it help?

CortoMaltese
Posts: 19
Joined: Sun Sep 13, 2009 10:25 am

Re: Newbie Tomcat & mod_jk Help

Post by CortoMaltese »

Thank yoy for the reply

I did
1 to 11 and it all work fine

So i guess i could be satisfied with it but do i really need mod jk now ?

The thing is if i want to use the applet on many diffeent pages, i must have many different
process.jsp files (process1.jsp, process2.jsp,process3.jsp) as the upload dir is in the process jps file and not in a parameter

is that correct ?

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Newbie Tomcat & mod_jk Help

Post by support »

Great. mod_jk is for integration with Apache web server it is useful if you don't want to allow direct TOMCAT access.

You can have only on process.jsp and pass a property in URL or in applet extra parameter to select the upload dir. For instance:
<PARAM NAME="url" VALUE="http://yourserver.com:8080/jspupload2.1 ... p?id=user1">

Then in process.jsp:
<%
String relativefolder = request.getParameter("id");
String uploadir = "c:/uploads/"+relativefolder;
...

CortoMaltese
Posts: 19
Joined: Sun Sep 13, 2009 10:25 am

Re: Newbie Tomcat & mod_jk Help

Post by CortoMaltese »

OK then
Though it works fine I don't think it will fill my needs as it would oblige me to modify so many times the process.jsp

What would be the best installation architecture to accomplish this :

One server
- multiple websites on the server
-- every one of these websites running different applets for different needs (one for the images, one for the audio, etc...)


And the second part of my question is

I'm not sure if i understood right but is there a way to use the process.jsp outside of the TOMCAT/webapps folder ???


Thank you very much..

Corto

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Newbie Tomcat & mod_jk Help

Post by support »

Notice that process.jsp already supports storage in different folders thanks to "account" extra parameter. This solution allows you to not modify process.jsp:
<PARAM NAME="param5" VALUE="account">
<PARAM NAME="value5" VALUE="users/user1">
If process.jsp is setup with /home/ext then the example above will upload files to:
/home/ext/users/user1
However, I'm not sure to understand your needs ... You're a hosting company? If so you should allow one JFileUpload + process.jsp installation per customer.

About location of JSP:
You can move a web application in any folder outside webapps by editing TOMCAT_HOME/conf/server.xml with:
<Context path="" reloadable="true" docBase="/home/youraccount/public_html/anyfolder" />
See TOMCAT documention about server.xml

Post Reply