View Full Version : Simple Apache 2 Tomcat 5 Integration with Debian 3.1
fernandoch
9th April 2006, 19:46
Hello all,
I have opened this thread to try to help those who find problems using the tutorial I have made at:
http://www.howtoforge.com/apache2_tomcat5_mod_jk_integration
Please post in here your questions and we will all try to solve them.
Fernando
falko
10th April 2006, 10:52
You might have noticed that I did a little formatting on your Howto so that it fits into these guidelines: http://www.howtoforge.com/howto_formatting_guide :)
fernandoch
10th April 2006, 11:03
Yes I have noticed,
I was supposed to do it today ;)
Thank you anyways,
Fernando
leorulez
3rd May 2006, 00:06
Hi,
I followed the exact steps given by you in
http://www.howtoforge.com/apache2_tomcat5_mod_jk_integration
trying to make tomcat and apache communicate.
However when I typed
http://host/jsp-examples, I got an Apache Tomcat error report, "HTTP status 404". I am not sure what I have done wrong. Any help on this would be appreciated.
My config is
Linux 3.2.3-53
Apache Web Server 2.0.46
Tomcat 4.1.29
Thanks
ambika
Anything in your error logs?
Have you also tried http://host/jsp-examples/ (with a trailing slash)?
leorulez
4th May 2006, 21:35
I tried with trailing slash, but still getting the same error. The mod_jk.log file is empty, mod_jk.log.1 has lines similar to this,
[Tue May 02 15:59:21 2006]worker1 host 0.020002
My workers.properties file is
workers.tomcat_home=/usr/local/tomcat/
workers.java_home=/usr/java/j2sdk1.4.2_06/
ps=/
worker.list=worker1
worker.default.port=8009
worker.default.host=hostname
worker.default.type=ajp13
worker.default.lbfactor=1
I replaced hostname with the real hostname.
devnet
11th May 2006, 17:50
Actually, the examples are located http://localhost:8080/jsp-examples/ instead of http://localhost/jsp-examples/
There is a link to those examples on the front page of your default tomcat index http://localhost:8080/
So the how-to should be updated with this error fix. Not sure if it is because I used apache-tomcat-5.5.17.tar.gz versus apache-tomcat-5.5.16.tar.gz or not...but that's the fix.
fernandoch
26th May 2006, 18:51
Hi leorulez,
What happens when you point your browser to:
http://localhost ??? Does your apache respond to the request?
And when you point it to:
http://localhost:8080 ??? What does it give you?
fernandoch
26th May 2006, 18:56
Hi Devnet,
If this address http://localhost/jsp-examples/ is not working, it means your connection between apache 2 and tomcat 5 is not working.
If you point you browser to http://localhost:8080/ this means you are not using the mod_jk connection, but just the tomcat 5.
To make it work, no port numbers should be in the middle of your address. You should have the apache respond to http://localhost and tomcat to http://localhost/jsp-examples if you followed the manual. I havenīt tried it with apache-tomcat-5.5.17.tar.gz but I will do it as soon as I have some time.
leorulez
30th May 2006, 21:27
Hi,
With http://host, I get the main web page that we have developed. so apache web server is working fine. With http://host:8080, I get the default tomcat servlet engine page. Hence even tomcat as a stand alone works fine. I tried http://host/jsp-examples, and got an Apache Tomcat error report, "HTTP status 404". Is there any other way to verify whether the apache web server and the tomcat servlet engine both communicate with one another?
Thanks
fernandoch
30th May 2006, 22:14
1) In http://host:8080/ can you try executing the examples? And do they work?
2) Can you post your /etc/apache2/workers.properties
3) The fifteen last lines of your /etc/apache2/apache2.conf
leorulez
30th May 2006, 23:50
1) In http://host:8080/ both jsp examples and servlet examples are working
2) workers.properties file.. I have already posted this before. Let me post it again
workers.tomcat_home=/usr/local/tomcat/
workers.java_home=/usr/java/j2sdk1.4.2_06/
ps=/
worker.list=worker1
worker.default.port=8009
worker.default.host=hostname
worker.default.type=ajp13
worker.default.lbfactor=1
I replaced hostname with the real hostname (eg. abc.edu)
3) The fifteen last lines of your /etc/apache2/apache2.conf
I assume this is httpd.conf
But the last 15 lines are related to section 3: virtual hosts. I am posting the last few lines from Section 2: Main server configuration
JkWorkersFile "/etc/httpd/workers.properties"
JkLogFile "/etc/httpd/logs/mod_jk.log"
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# Send servlet for context / jsp-examples to worker named worker1
JkMount /jsp-examples worker1
# Send JSPs for context /jsp-examples/* to worker named worker1
JkMount /jsp-examples/* worker1
Thanks
fernandoch
31st May 2006, 00:12
If you followed the manual line by line you would see that in 2) the first two lines differ.
workers.tomcat_home=/usr/local/tomcat/
workers.java_home=/usr/java/j2sdk1.4.2_06/
should be replaced by:
workers.tomcat_home=/usr/lib/apache-tomcat
workers.java_home=/usr/lib/jdk
And in 3) I cannot see that you load the jk_module
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
Try to take some time and check again the manual line by line copying and pasting the commands and if it does not work then get back here.
And since you are using httpd.conf this means you are not using Debian 3.1 so it might be a problem with your distro. In Debian we use apache2.conf for the configuration file.
leorulez
31st May 2006, 22:35
I had
workers.tomcat_home=/usr/local/tomcat/
workers.java_home=/usr/java/j2sdk1.4.2_06/
because these are the actual locations for tomcat and java in my server. Is it necessary to change those lines to the ones you specified?.
In 3) I have the load module:
LoadModule jk_module modules/mod_jk.so
in httpd.conf along with the other LoadModules.
And yes I am not using Debian but I thought this manual would work for RedHat too. Thanks for your help.
fernandoch
1st June 2006, 11:11
I am sorry leorulez but I havenīt had the time to play with RH.
Maybe this manual could help you a bit more:
http://www.meritonlinesystems.com/docs/apache_tomcat_redhat.html
Have you ever tried Debian ;)
leorulez
1st June 2006, 21:50
Thanks..but I have tried that procedure already. I have'nt tried Debian..did'nt want to mess around with the server which already has RedHat
chrno
3rd September 2006, 14:42
Step 6
./configure --with-apxs=/usr/bin/apxs2
Step 7
Now build the mod_jk with the following:
make
I ran Step 6 fine but I get the following error on Step7
make
bash: make: command not found
I followed your tutorial right to the word ... so I must be missing something ...
Any help/assistance will be much appreciated! Thanks!
chrno
drks
3rd September 2006, 20:07
a base install of any OS is likely not going to include 'make'. You might need to do the following:
apt-get install make
On another note, I have actually written a similar Howto that you all may wish to cross reference:
http://5dollarwhitebox.org/wiki/index.php/Howtos_Apache_Tomcat_with_Mod_JK
I am waiting to get 'whitelisted' by one of the guys to that I can add the Howto here. Though this here article by fernandoch, it never hurts to read a couple different Howto's to get as much info as possible.
falko
4th September 2006, 15:58
I am waiting to get 'whitelisted' by one of the guys to that I can add the Howto here. Though this here article by fernandoch, it never hurts to read a couple different Howto's to get as much info as possible.
How do you mean that? Once you have a user account on HowetoForge (as you do), you can post tutorials. Have a look here: http://www.howtoforge.com/add_howto
DarkFoxDK
17th February 2007, 22:27
What is your reason for commenting out php types?
I uncommented them after completing the guide (great and easy guide by the way), and i don't see any problems yet.
falko
18th February 2007, 20:24
Take a look here: http://www.howtoforge.com/forums/showthread.php?t=2789&highlight=disable+php+globally
wacind
19th May 2007, 16:32
Hi
this tutorial has been very helpful, i've set up everything as described but i am still trying to figure one thing out.
i would like to be able to run the jsp files from my public_html folder not from the webapps folder.
I have done quite a bit of searching for this and have also gone through tutorial by C. Troy Popplewell. Ive also tried changing the context.xml file but without any luck.
Can anyone point me out how i can get this done.
I am using ubuntu edgy
Thanks
wacind
diamondpearl
12th March 2008, 15:14
Hi Dudes,
I am having the following things installed in unix server.
Apache:HP-UX Apache-based Web Server A.2.0.58.01
Tomcat:Tomcat 5.5.20
How to integrate both of them?
For unix based server what confguration needs to be done?
Steps required to configure?
Where can i get the connector files?
Please help me to solve this...!
In Apache conf folder mod_jk and mod_jk.so both files are there?Which one i have to use it?
Thanks in Advance...!
regards
diamondpearl
topdog
12th March 2008, 17:00
http://www.howtoforge.com/forums/showthread.php?t=19780
nulix31
29th June 2008, 13:15
Hi,
I followed the exact steps given by you in
http://www.howtoforge.com/apache2_tomcat5_mod_jk_integration
trying to make tomcat and apache communicate.
However when I typed
http://host/jsp-examples, I got an Apache Tomcat error report, "HTTP status 404". I am not sure what I have done wrong. Any help on this would be appreciated.
Hi,
I had the same issue: apache and tomcat worked correctly respectively on ports 80 and 8080, but the redirection with mod_jk did not work.
I set JkLogLevel=debug instead of info in apache2.conf.
I obtained the following message in mod_jk.log:
"missing uri map for localhost.localdomain:/jsp-examples"
I corrected this when adding the following JkMount statement in Apache virtual hosts configuration file:
NameVirtualHost *
<VirtualHost *>
...
JkMount /jsp-examples/* worker1
</VirtualHost>
I hope this can help.
Ludo
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.