This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Apache + Tomcat Configuration Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Apache + Tomcat Configuration Problem" Watch "Apache + Tomcat Configuration Problem" New topic
Author

Apache + Tomcat Configuration Problem

Venkatesh Rajendran
Ranch Hand

Joined: May 17, 2001
Posts: 59
Hi,

I am trying to configure Apache and Tomcat in Solaris, my basic intention is to avoid giving port number in the URL. I think, I have configured every thing as of my knowledge based on the below link, but my tomcat server still expects port number,

http://johnturner.com/howto/apache2-tomcat4112-sol8-howto.html

I have configured the same thing in Windows it works fine,only difference is the port number, in windows I am pointing to the 80 port but in solaris I have given some other ports like 8381.

It will be very greatful, if any one can give solution for the above said problem.

Do I need to do any other extra configuration, due to this port change?

Thanks in advance.

Regards,

Venkat
Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
Tomcat will listen on any port you want it to. Since all http requests come in looking for port 80, you would have to point all that traffic to your tomcat listener on port 8381. You should be able to use a router or web server software to do this.
peter wooster
Ranch Hand

Joined: Jun 13, 2004
Posts: 1033
Originally posted by Venkatesh Rajendran:
Hi,

I am trying to configure Apache and Tomcat in Solaris, my basic intention is to avoid giving port number in the URL. I think, I have configured every thing as of my knowledge based on the below link, but my tomcat server still expects port number,

http://johnturner.com/howto/apache2-tomcat4112-sol8-howto.html



Yes, that document is a good start on configuring an Apache-Tomcat connector. We got this to work on Solaris 9, here are the steps we used:

Get the mod_jk2 binary

# cd /tmp/src
# gunzip jakarta-tomcat-connectors-jk2.0.2-solaris8-apache2.0.43.tar.gz
# gtar -xf jakarta-tomcat-connectors-jk2.0.2-solaris8-apache2.0.43.tar
# cd jakarta-tomcat-connectors-jk2.0.2-solaris8-apache2.0.43
# cp mod_jk2-2.0.43.so /usr/local/apache2/modules
# cp jkjni.so /usr/local/apache2/modules

Edit httpd.conf

# for JK2 connector to Tomcat
LoadModule jk2_module modules/mod_jk2-2.0.43.so
JkSet config.file /usr/local/share/tomcat5/conf/workers2.properties
Alias /jsp-examples/ "/usr/local/share/tomcat5/webapps/jsp-examples/"
Alias /servlets-examples/ "/usr/local/share/tomcat5/webapps/servlets-examples/"

Set permissions
# cd /usr/local/share/
# chmod 755 tomcat5
# cd tomcat5
# chmod 755 webapps
# cd conf
# cp workers2.properties.minimal workers2.properties

Edit workers2.properties

change [uri:/admin]
to [uri:/admin/*]

change [uri:/manager]
to [uri:/manager/*]

change [uri:/jsp-examples]
to [uri:/jsp-examples/*]

change [uri:/servlets-examples]
to [uri:/servlets-examples/*]

add any other uri's you might need

Shutdown and restart Tomcat and Apache

try to use "http://your-server/jsp-examples without providing a port to test the config.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Apache + Tomcat Configuration Problem
 
Similar Threads
HowTo: Optional mod files in Apache
HowTo configure the C3P0 properties in hibernateconfig.xml
Date into Calendar? Howto?
How to implement SSL when running Tomcat behind Apache
howto invoke servlet