Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Apache + Tomcat Configuration Problem

 
Venkatesh Rajendran
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1033
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic