Installing Tomcat with Apache
Results 1 to 9 of 9

Thread: Installing Tomcat with Apache

  1. #1
    Antionline Herpetologist
    Join Date
    Aug 2001
    Posts
    1,165

    Question Installing Tomcat with Apache

    OK, I've got Apache running on my windows box (like that's hard ) and I've got Tomcat running independantly. But I just can't find any instructions of how to get Tomcat running as a module within Apache. The instructions on the Tomcat website are vague at best and they really don't help at all. All I could find was that I had to download the source for the connectors. But beyond that, I'm at sea. Anyone done this before?
    Cheers,
    cgkanchi
    Buy the Snakes of India book, support research and education (sorry the website has been discontinued)
    My blog: http://biology000.blogspot.com

  2. #2
    Banned
    Join Date
    Jan 2003
    Posts
    81
    If im understanding you corectly i think you should try this

    Here goes.....

    #================================
    Software Used:

    Windows 2000 Advanced Server
    Apache 1.3.24-Win32
    PHP 4.1.2-Win32
    Jakarta Tomcat 4.0.3

    #--------------------------------
    Paths to software
    #--------------------------------
    Apache Path:
    C:\Program Files\Apache Group

    PHP Path:
    C:\Program Files\php

    Jakarta Tomcat Path:
    C:\Program Files\jakarta-tomcat-4.0.3

    JDK:
    C:\Program Files\j2sdk1.4.0

    #############################################
    PHP ISSUE
    #############################################
    Apache is running fine until I add in the following three lines load PHP as a dynamic module...

    LoadModule php4_module c:/Program Files/php/sapi/php4apache.dll
    AddModule mod_php4.c
    AddType application/x-httpd-php .php

    Here's what I've done....
    - I have moved the php4ts.dll to the winnt/system32
    - Copied the file, php.ini to c:\winnt

    In the Apache httpd.conf file I did the following....

    -Put the LoadModule directive directly after the commented out LoadModule directives
    -Put the AddModule directive directly after the commented out AddModule directives
    -Put the AddType directive in the following location, in the httpd.conf file....

    #
    # AddType allows you to tweak mime.types without actually editing it, or to
    # make certain files to be certain types.
    #
    AddType application/x-tar .tgz

    AddType application/x-httpd-php .php

    Hope that helps. sorry if it doesn't

  3. #3
    Antionline Herpetologist
    Join Date
    Aug 2001
    Posts
    1,165
    Nope. That has nothing to do with what I'm trying to do. I'm not even trying to put PHP on my server. I just can't figure out how to load Tomcat as a module. Also, as far as Apache goes, I'm a total newbie, so I might need a little hand-holding.
    Cheers,
    cgkanchi
    Buy the Snakes of India book, support research and education (sorry the website has been discontinued)
    My blog: http://biology000.blogspot.com

  4. #4
    Just a Virtualized Geek MrLinus's Avatar
    Join Date
    Sep 2001
    Location
    Redondo Beach, CA
    Posts
    7,324
    cgkanchi,

    Isn't this what you are looking for?
    Goodbye, Mittens (1992-2008). My pillow will be cold without your purring beside my head
    Extra! Extra! Get your FREE copy of Insight Newsletter||MsMittens' HomePage

  5. #5
    Senior Member
    Join Date
    Oct 2001
    Posts
    638
    I've yet to find some solid doco on how to do this with the latest version of tomcat. A lot of the doco is pre version 4.1 and some of it is for the rpm install and some from source. It took me a lot of piecing together from various web site doco plus some hacking to get working. I might be able to help with more specific questions. Good luck.
    OpenBSD - The proactively secure operating system.

  6. #6
    Antionline Herpetologist
    Join Date
    Aug 2001
    Posts
    1,165
    I think I got it *nearly* working from the instructions given on this site. Tomcat now runs fine but when I start Apache, it gives me the message: "Can't locate API module structure jk_module in file C:\windows\system32\mod_jk.dll". Of course, the file exists and I just can't figure out what's wrong. BTW, that url is a cached version of the doc as it's a .doc file and not a HTML page.
    Cheers,
    cgkanchi
    Buy the Snakes of India book, support research and education (sorry the website has been discontinued)
    My blog: http://biology000.blogspot.com

  7. #7
    Antionline Herpetologist
    Join Date
    Aug 2001
    Posts
    1,165
    I'm so stupid! I finally figured out what I was doing wrong with Apache. However, I still have this problem. Apache runs without errors and even says "Apache/2.0.44 (Win32) mod_jk2/2.0.2 Server at localhost Port 80" in it's 404 messages. But now, Tomcat gives me the following errors:
    C:\PROGRA~1\JAKART~1.18\bin>catalina.bat run
    Using CATALINA_BASE: ..
    Using CATALINA_HOME: ..
    Using CATALINA_TMPDIR: ..\temp
    Using JAVA_HOME: "C:\j2sdk1.4.1_01"
    Mar 3, 2003 12:35:12 PM org.apache.commons.modeler.Registry loadRegistry
    INFO: Loading registry information
    Mar 3, 2003 12:35:12 PM org.apache.commons.modeler.Registry getRegistry
    INFO: Creating new Registry instance
    Mar 3, 2003 12:35:12 PM org.apache.commons.modeler.Registry getServer
    INFO: Creating MBeanServer
    Mar 3, 2003 12:35:13 PM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on port 8080
    ServerLifecycleListener: createMBeans: MBeanException
    java.lang.Exception: ManagedBean is not found with Ajp13Connector
    at org.apache.catalina.mbeans.MBeanUtils.createMBean(MBeanUtils.java:224)
    at org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(ServerLifecycleListener.java:369)
    at org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(ServerLifecycleListener.java:777)
    at org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(ServerLifecycleListener.java:751)
    at org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(ServerLifecycleListener.java:339)
    at org.apache.catalina.mbeans.ServerLifecycleListener.lifecycleEvent(ServerLifecycleListener.java:206)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:2182)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
    at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
    at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
    Starting service Tomcat-Standalone
    Apache Tomcat/4.1.18
    Mar 3, 2003 12:35:18 PM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on port 8080
    Mar 3, 2003 12:35:18 PM org.apache.jk.server.JkMain newHandler
    SEVERE: Can't create apr
    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
    at org.apache.jk.apr.AprImpl.<clinit>(AprImpl.java:340)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:140)
    at org.apache.jk.server.JkMain.newHandler(JkMain.java:556)
    at org.apache.jk.server.JkMain.start(JkMain.java:341)
    at org.apache.jk.server.JkCoyoteHandler.start(JkCoyoteHandler.java:169)
    at org.apache.coyote.tomcat4.CoyoteConnector.start(CoyoteConnector.java:1056)
    at org.apache.catalina.core.StandardService.start(StandardService.java:506)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:2189)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
    at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
    at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
    Mar 3, 2003 12:35:18 PM org.apache.jk.server.JkMain newHandler
    SEVERE: Can't create apr
    java.lang.NoClassDefFoundError
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:140)
    at org.apache.jk.server.JkMain.newHandler(JkMain.java:556)
    at org.apache.jk.server.JkMain.processProperty(JkMain.java:537)
    at org.apache.jk.server.JkMain.processProperties(JkMain.java:505)
    at org.apache.jk.server.JkMain.start(JkMain.java:346)
    at org.apache.jk.server.JkCoyoteHandler.start(JkCoyoteHandler.java:169)
    at org.apache.coyote.tomcat4.CoyoteConnector.start(CoyoteConnector.java:1056)
    at org.apache.catalina.core.StandardService.start(StandardService.java:506)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:2189)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
    at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
    at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
    Mar 3, 2003 12:35:18 PM org.apache.jk.common.ChannelSocket init
    INFO: Port busy 8009 java.net.BindException: Address already in use: JVM_Bind
    Mar 3, 2003 12:35:18 PM org.apache.jk.common.ChannelSocket init
    INFO: JK2: ajp13 listening on /0.0.0.0:8010
    Mar 3, 2003 12:35:18 PM org.apache.jk.server.JkMain start
    INFO: Jk running ID=1 time=10/120 config=C:\PROGRA~1\JAKART~1.18\bin\..\conf\jk2.properties
    Help!!
    Cheers,
    cgkanchi
    Buy the Snakes of India book, support research and education (sorry the website has been discontinued)
    My blog: http://biology000.blogspot.com

  8. #8
    Senior Member
    Join Date
    Aug 2002
    Posts
    508
    Cgkanchi,
    I am not really sure this one can solve your problem.
    Can you try using java js2sdk1.3.1 or js2sdk1.2 instead of j2sdk1.4.1(you have latest version here) cause I tried using j2sdk1.4.1 for my*nix box but I've got error so I used oldest version of java, but I have no idea how to change that java versions for windows..
    Not an image or image does not exist!
    Not an image or image does not exist!

  9. #9
    Antionline Herpetologist
    Join Date
    Aug 2001
    Posts
    1,165
    Thanks for the input sweet_angel, but that wasn't the problem. There were errors in the default server.xml of tomcat. However, having got that problem fixed, the damn thing still won't run. It gets to "Creating MBeanServer" and stops. The cursor continues blinking (ie the batch file doesn't freeze) but it just doesn't go any further than that. I've attached a copy of all the important configuation files in the attached zip file, so if someone would take a look at them and tell me what's wrong, I'll be really grateful.
    Cheers,
    cgkanchi
    Buy the Snakes of India book, support research and education (sorry the website has been discontinued)
    My blog: http://biology000.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •