Apache + Tomcat integration - please help!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alexandr Molochnikov

    Apache + Tomcat integration - please help!

    Hello,

    I've spent a few days trying to get Apache and Tomcat work together via JK
    module. First I followed the following HOWTO link:



    and managed to get Tomcat static html page load from Apache server without
    specifying 8080 port, like this:



    But when I substituted the IP address of the server host instead of
    "localhost" (i.e. http://192.168.1.250/examples/), port 80 was not
    redirected to 8080, and Tomcat page did not come up.

    Then I tried another link:



    with the same end result: using "localhost" in the URL works. Using the IP
    address does not.

    And it all happens on the same host where both Apache and Tomcat run.

    My environment: Windows 2000 Pro
    Apache 2.0.47
    Tomcat 4.1.27

    Any help will be greatly appreciated.

    Alex Molochnikov
    Gestalt Corporation


  • Bob Kranson

    #2
    Re: Apache + Tomcat integration - please help!

    Alex,

    Redirection to the IP address will have some network dependancies.
    - Are you validated via DHCP?
    - Is this static address in your winnt\system32\ drivers\etc\hos ts file?
    - Did you change Tomcat configuration to point port 80?
    - Is IIS installed/running?

    Hope this helps,
    BobK

    "Alexandr Molochnikov" <NOBODY@NO_SPAM .com> wrote in message
    news:3uM9b.7213 $Y67.183662@new s2.telusplanet. net...[color=blue]
    > Hello,
    >
    > I've spent a few days trying to get Apache and Tomcat work together via JK
    > module. First I followed the following HOWTO link:
    >
    > http://www.johnturner.com/howto/winxp-howto.html
    >
    > and managed to get Tomcat static html page load from Apache server without
    > specifying 8080 port, like this:
    >
    > http://localhost/examples/
    >
    > But when I substituted the IP address of the server host instead of
    > "localhost" (i.e. http://192.168.1.250/examples/), port 80 was not
    > redirected to 8080, and Tomcat page did not come up.
    >
    > Then I tried another link:
    >
    > http://www.greenfieldresearch.ca/tec...k2_config.html
    >
    > with the same end result: using "localhost" in the URL works. Using the IP
    > address does not.
    >
    > And it all happens on the same host where both Apache and Tomcat run.
    >
    > My environment: Windows 2000 Pro
    > Apache 2.0.47
    > Tomcat 4.1.27
    >
    > Any help will be greatly appreciated.
    >
    > Alex Molochnikov
    > Gestalt Corporation
    >
    >[/color]



    Comment

    • Florian Laabs

      #3
      Re: Apache + Tomcat integration - please help!

      Hello Alex,

      I have exactly the same environment and exactly the same problem!
      And like you I followed the how-tos you mentioned!
      I've been trying to get it work since 3 days now...

      Have you found a solution yet?
      Please let me know.
      Yours,
      Flo


      Alexandr Molochnikov wrote:[color=blue]
      > Hello,
      >
      > I've spent a few days trying to get Apache and Tomcat work together via JK
      > module. First I followed the following HOWTO link:
      >
      > http://www.johnturner.com/howto/winxp-howto.html
      >
      > and managed to get Tomcat static html page load from Apache server without
      > specifying 8080 port, like this:
      >
      > http://localhost/examples/
      >
      > But when I substituted the IP address of the server host instead of
      > "localhost" (i.e. http://192.168.1.250/examples/), port 80 was not
      > redirected to 8080, and Tomcat page did not come up.
      >
      > Then I tried another link:
      >
      > http://www.greenfieldresearch.ca/tec...k2_config.html
      >
      > with the same end result: using "localhost" in the URL works. Using the IP
      > address does not.
      >
      > And it all happens on the same host where both Apache and Tomcat run.
      >
      > My environment: Windows 2000 Pro
      > Apache 2.0.47
      > Tomcat 4.1.27
      >
      > Any help will be greatly appreciated.
      >
      > Alex Molochnikov
      > Gestalt Corporation
      >
      >[/color]

      Comment

      • ge0rge

        #4
        Re: Apache + Tomcat integration - please help!


        "Florian Laabs" <Florian.Laabs@ web.de> wrote[color=blue]
        > Alexandr Molochnikov wrote:[/color]
        ....[color=blue][color=green]
        > > But when I substituted the IP address of the server host instead of
        > > "localhost" (i.e. http://192.168.1.250/examples/), port 80 was not
        > > redirected to 8080, and Tomcat page did not come up.
        > >
        > > Then I tried another link:
        > > http://www.greenfieldresearch.ca/tec...k2_config.html
        > > with the same end result: using "localhost" in the URL works. Using the[/color][/color]
        IP[color=blue][color=green]
        > > address does not.[/color][/color]

        Does Apache itself (not Tomcat) return static pages when you specify the
        local machine IP address? eg. pages held in Apache's ../htdocs folder.

        Just a shot in the dark ... Have you configured the hosts file on your
        system? It should have at least a couple of entries like -
        127.0.0.1 localhost # for loopback
        192.168.1.250 perseus # some name for my machine

        ge0rge
        --
        Changing husbands/wives is only changing troubles.
        -- Kathleen Norris


        Comment

        • Florian Laabs

          #5
          Re: Apache + Tomcat integration - please help!

          Yes, it does.
          And the hosts file looks like that.

          Florian


          ge0rge wrote:[color=blue]
          > "Florian Laabs" <Florian.Laabs@ web.de> wrote
          >[color=green]
          >>Alexandr Molochnikov wrote:[/color]
          >
          > ...
          >[color=green][color=darkred]
          >>>But when I substituted the IP address of the server host instead of
          >>>"localhost " (i.e. http://192.168.1.250/examples/), port 80 was not
          >>>redirected to 8080, and Tomcat page did not come up.
          >>>
          >>>Then I tried another link:
          >>>http://www.greenfieldresearch.ca/tec...k2_config.html
          >>>with the same end result: using "localhost" in the URL works. Using the[/color][/color]
          >
          > IP
          >[color=green][color=darkred]
          >>>address does not.[/color][/color]
          >
          >
          > Does Apache itself (not Tomcat) return static pages when you specify the
          > local machine IP address? eg. pages held in Apache's ../htdocs folder.
          >
          > Just a shot in the dark ... Have you configured the hosts file on your
          > system? It should have at least a couple of entries like -
          > 127.0.0.1 localhost # for loopback
          > 192.168.1.250 perseus # some name for my machine
          >
          > ge0rge
          > --
          > Changing husbands/wives is only changing troubles.
          > -- Kathleen Norris
          >
          >[/color]

          Comment

          • ge0rge

            #6
            Re: Apache + Tomcat integration - please help!

            > ge0rge wrote:
            ....[color=blue][color=green]
            > > Just a shot in the dark ... Have you configured the hosts file on your
            > > system? It should have at least a couple of entries like -
            > > 127.0.0.1 localhost # for loopback
            > > 192.168.1.250 perseus # some name for my machine[/color][/color]

            "Florian Laabs" <Florian.Laabs@ web.de> wrote in message
            news:bn5ku6$sv4 kc$1@ID-155046.news.uni-berlin.de...[color=blue]
            > Yes, it does.
            > And the hosts file looks like that.[/color]

            woo hoo ... Got it to work! Basically the answer was in John Turner's howto
            ....
            NOTE: in Tomcat, virtual hosts are "Hosts". That is, as far as Tomcat is
            concerned, localhost is a virtual host. So, if you want to setup
            www.server-a.com and www.server-b.com, you just need more copies of the Host
            container included in the default server.xml that comes with Tomcat.

            Here's a minimal cook book recipe -
            1) make a copy of your Tomcat server.xml (safety first!)
            2) edit server.xml and duplicate the xml Host tag to create another virtual
            host
            <Host name="localhost " ...> ... </Host>
            That's some 150 lines and are found just after this line <!-- Define the
            default virtual host -->
            3) Now, in your new virtual host, you need to replace at least these two
            references to localhost with perseus (or whatever you've called your
            192.168.1.250 machine)-
            a) <Host name="perseus" debug="0" ...
            b) <value>perseu s</value>
            4) Stop Apache - stop Tomcat - start Tomcat - start Apache in that order...
            and Bob's your uncle.

            Now, http://localhost/examples/jsp/index.html or http://perseus/... or
            http://192.168.1.250/... all work. Of course, on a production Tomcat, you'd
            need to mess around a bit more with the xml file to tailor the additional
            virtual host(s) to point to the correct directories as needed.

            ge0rge
            --
            Leave no stone unturned.
            -- Euripides


            Comment

            • Florian Laabs

              #7
              Re: Apache + Tomcat integration - please help!

              Hi geOrge,

              must be something else, I already did that before and it does not work.

              Flow


              [color=blue]
              > Now, http://localhost/examples/jsp/index.html or http://perseus/... or
              > http://192.168.1.250/... all work. Of course, on a production Tomcat, you'd
              > need to mess around a bit more with the xml file to tailor the additional
              > virtual host(s) to point to the correct directories as needed.
              >
              > ge0rge
              > --
              > Leave no stone unturned.
              > -- Euripides
              >
              >[/color]

              Comment

              • Florian Laabs

                #8
                Re: Apache + Tomcat integration - please help!

                Me again geOrge,

                I guess it must have something to do with the workers file.
                Can you show yours?

                Thx,
                Flow
                [color=blue]
                > Now, http://localhost/examples/jsp/index.html or http://perseus/... or
                > http://192.168.1.250/... all work. Of course, on a production Tomcat, you'd
                > need to mess around a bit more with the xml file to tailor the additional
                > virtual host(s) to point to the correct directories as needed.
                >
                > ge0rge
                > --
                > Leave no stone unturned.
                > -- Euripides
                >
                >[/color]

                Comment

                Working...