Simple Apache 2 Tomcat 5 Integration with Debian 3.1

Discussion in 'Server Operation' started by fernandoch, Apr 9, 2006.

  1. fernandoch

    fernandoch New Member HowtoForge Supporter

    Last edited: Apr 9, 2006
  2. falko

    falko Super Moderator ISPConfig Developer

  3. fernandoch

    fernandoch New Member HowtoForge Supporter

    Yes I have noticed,

    I was supposed to do it today ;)

    Thank you anyways,
    Fernando
     
    Last edited: Apr 10, 2006
  4. leorulez

    leorulez New Member

    problem with apache webserver and tomcat integration

    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
     
  5. falko

    falko Super Moderator ISPConfig Developer

  6. leorulez

    leorulez New Member

    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.
     
  7. devnet

    devnet New Member

  8. fernandoch

    fernandoch New Member HowtoForge Supporter

    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?
     
  9. fernandoch

    fernandoch New Member HowtoForge Supporter

    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.
     
  10. leorulez

    leorulez New Member

    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
     
    Last edited: May 30, 2006
  11. fernandoch

    fernandoch New Member HowtoForge Supporter

    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
     
  12. leorulez

    leorulez New Member

    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
     
  13. fernandoch

    fernandoch New Member HowtoForge Supporter

    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.
     
  14. leorulez

    leorulez New Member

    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.
     
  15. fernandoch

    fernandoch New Member HowtoForge Supporter

  16. leorulez

    leorulez New Member

    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
     
  17. chrno

    chrno New Member

    Step 7

    I ran Step 6 fine but I get the following error on Step7
    Code:
    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
     
  18. drks

    drks New Member HowtoForge Supporter

    a base install of any OS is likely not going to include 'make'. You might need to do the following:

    Code:
    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.
     
  19. falko

    falko Super Moderator ISPConfig Developer

    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
     
  20. DarkFoxDK

    DarkFoxDK New Member

    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.
     

Share This Page