This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JSP and the fly likes Enable JSP on a user a/c Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Enable JSP on a user a/c" Watch "Enable JSP on a user a/c" New topic
Author

Enable JSP on a user a/c

Andrew Parker
Ranch Hand

Joined: Nov 12, 2001
Posts: 178
Hi,
I just set up the tomcat4.0.4. I had a user under /home/user on my redhat 7.3.
How can I enable the jsp page to be reviewed properly if I type http://localhost/~user/index.jsp?
It displayed the jsp code only, not the html page.
How can I set the tomcat and apache to enable user to use jsp and servlet?
Thanks
Andrew
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

That's functionality provided by Web servers (such Apache Web Server), where the incomming request is remapped to another directory based on the incomming format eg ~name gets converted to /usr/name
Dave
Andrew Parker
Ranch Hand

Joined: Nov 12, 2001
Posts: 178
So, how do I edit the httpd.conf and map to the var/tomcat4/webapps/ROOT/WEB-INF?
or I need to edit web.xml, server.xml and add mod_webapp module to apache?
Thanks for help
Andrew
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Now you got me beat. I know how it happens, I know what it looks like, but as to how you actually achieve it, you'd have to go have a look at the Apache docs.
I remember seeing an example on this, but it was mapping to user directories rather than a user context. There might be some differences.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

It looks like this conversation is now being continued here
Andrew Parker
Ranch Hand

Joined: Nov 12, 2001
Posts: 178
Hi,
I removed the mod_webapp.so and install mod_jk.so. But, httpd shows an error and cannot be started now.
Loaded DSO modules/mod_jk.so uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with - DEAPI).
What does it mean and how should I do it now?
According to http://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#APACHETOMCAT, here were my steps (Please tell me which part I was wrong):
1. I installed mod_jk-1.3-1.0-1.4.0.2.i386.rpm which was downloaded from http://jakarta.apache.org/builds/jakarta-tomcat-4.0/archives/v4.0.2/rpms/
2. I downloaded http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3/bin/linux/i386/mod_jk-3.3-ap13-eapi.so, rename it to mod_jk.so and replace the one located under /usr/lib/apache/mod_jk.so.
3. Modify: /etc/httpd/conf/workers.properties
4. Add to: /var/tomcat4/conf/server.xml
5. Add to: /etc/httpd/conf/httpd.conf
6. Modify: /etc/httpd/conf/mod_jk.conf
Thanks for any advice.
Andrew Parker
Ranch Hand

Joined: Nov 12, 2001
Posts: 178
The apache can connect to tomcat now.
When I run http://localhost/examples/servlet/MyHelloWorld, it works now.
I did not setup Virtualhost. However, I have many users like localhost/~userA.
I tried to add JkMount /*.jsp ajp13, JkMount /servlet/* ajp13 to httpd.conf in-between <Directory /home/*/html> </Directory>.
However, the apache cannot be started because they cannot be added in-between <Directory>.
I also tried to add <Host name="localhost/~userA">
<Context path="" docBase"/home/userA/html" /></Host> to server.xml.
But, it still did not work.
So, how should I configure httpd.conf and server.xml or other files in order to make it work?
And advice?
 
GeeCON Prague 2014
 
subject: Enable JSP on a user a/c