By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,934 Members | 1,692 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,934 IT Pros & Developers. It's quick & easy.

Apache + Tomcat integration - please help!

P: n/a
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
Jul 17 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
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\hosts 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:3u*******************@news2.telusplanet.net.. .
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


Jul 17 '05 #2

P: n/a
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:
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


Jul 17 '05 #3

P: n/a

"Florian Laabs" <Fl***********@web.de> wrote
Alexandr Molochnikov wrote:

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


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
Jul 17 '05 #4

P: n/a
Yes, it does.
And the hosts file looks like that.

Florian
ge0rge wrote:
"Florian Laabs" <Fl***********@web.de> wrote
Alexandr Molochnikov wrote:


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

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


Jul 17 '05 #5

P: n/a
> ge0rge wrote:
....
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

"Florian Laabs" <Fl***********@web.de> wrote in message
news:bn************@ID-155046.news.uni-berlin.de... Yes, it does.
And the hosts file looks like that.


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>perseus</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
Jul 17 '05 #6

P: n/a
Hi geOrge,

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

Flow
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


Jul 17 '05 #7

P: n/a
Me again geOrge,

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

Thx,
Flow
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


Jul 17 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.