File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes mod_jk Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "mod_jk" Watch "mod_jk" New topic
Author

mod_jk

Danny Luk
Greenhorn

Joined: Mar 11, 2011
Posts: 4
I have a problem with using both Apache 2.2.3 and Tomcat 5.5.23 using mod_jk.
Basically when I type http://www.mywebsite.com I want it to go to http://ipaddress:8088/shop where shop is my webapp and it's in the shop dir under /usr/lib/apache-tomcat-5.5.23/webapps.
I tested that tomcat is working and http://ipaddress:8088/shop brings up the shop web app.
Here's what I've done:
-Downloaded and put mod_jk.so into /usr/lib/httpd/modules
-Created mod_jk.conf in /etc/httpd/conf.d with the following lines:

-Created workers.properties in /etc/httpd/conf with the following lines:

-Add virtual host in /etc/httpd/conf/httpd.conf as such:

192.168.0.2 is the internal ip for the website.
But I only see the Apache default after I restart both Apache and Tomcat and then type http://www.mywebsite.com.
So what did I do wrong or miss?
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
Do you have something like



in your tomcat's server.xml ?
Danny Luk
Greenhorn

Joined: Mar 11, 2011
Posts: 4
Yes I do.
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
Looks like you need to set 'shop' as default app. You need to have something like this in server.xml within <Host>

<Context docBase="/usr/lib/apache-tomcat-5.5.23/webapps/shop" path="">
Danny Luk
Greenhorn

Joined: Mar 11, 2011
Posts: 4
I added the context line like you said and it's the same when I restarted Apache.
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
Danny Luk wrote:I added the context line like you said and it's the same when I restarted Apache.


You have to restart Tomcat
Danny Luk
Greenhorn

Joined: Mar 11, 2011
Posts: 4
I restarted both and ran http://ipaddress:8088/shop to make sure the app is running. But http://www.mywebsite.com still returns the Apache HTTP Server Test Page.
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
Danny Luk wrote:I restarted both and ran http://ipaddress:8088/shop to make sure the app is running. But http://www.mywebsite.com still returns the Apache HTTP Server Test Page.


In this case you have to solve one problem at a time. This part should not work at all.



Are you sure that you are seeing correct Apache HTTP Server Test Page. I mean it is Apache on 192.168.0.2:8088.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: mod_jk
 
Similar Threads
File uploading problem
How to map apache to tomcat?
Apache 2 and Tomcat 7 on Ubuntu 10.04 in VirtualBox 4.06xxx
Enable JSP on a user a/c
Apache SSL Module on Ubuntu