File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Tomcat_WorkWith_Apache? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Tomcat_WorkWith_Apache?" Watch "Tomcat_WorkWith_Apache?" New topic
Author

Tomcat_WorkWith_Apache?

Peng Cedar
Greenhorn

Joined: Jul 25, 2001
Posts: 10
How can I joint Apache and Tomcat working together?
(On windows2000 professional)
Installed:
jdk1.3
Apache 1.3.14
Tomcat
Everything above run very well.
I have add a line in Apache's httpd.conf---

include c:/jakarta-tomcat/conf/tomcat.conf
then I start Apache and see:
Apache/1.3.14 (Win32) tomcat/1.0 running...
But when I want to visit http://127.0.0.1:8080,
I failed, Why?



I love MySQL<BR>Sun Certified Programmer for Java 2 Platform
kishore konuri
Greenhorn

Joined: Aug 04, 2001
Posts: 2
Hi,
you just do one thing
1) add this line at the end of the conf file..then restart both your machine.
u'r apache will start automatically.then you need to start tomcat manually(unless u configured at start up).. by clicking at startup.bat in tomcat/bin.
80 is the port for apache.and 8080 is the default port fort tomcat.
i can see two reasons to fail..
i) u might not have stated tomcat server, since u said u'r using 8080 as port..
ii) u might have changed the tomcat default port number to something else(otherthan 8080) in server.xml file..
iii) whenever u modify something in conf file..u need to restart u'r machine, thebn only automatic setting will work..
try out..
let me know if u still face probs..
regads,
kishore.
Originally posted by Peng Cedar:
How can I joint Apache and Tomcat working together?
(On windows2000 professional)
Installed:
jdk1.3
Apache 1.3.14
Tomcat
Everything above run very well.
I have add a line in Apache's httpd.conf---

include c:/jakarta-tomcat/conf/tomcat.conf
then I start Apache and see:
Apache/1.3.14 (Win32) tomcat/1.0 running...
But when I want to visit http://127.0.0.1:8080,
I failed, Why?


Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

iii) whenever u modify something in conf file..u need to restart u'r machine,
hmmm...i din't know this.
To the best of my knowledge, even when I changed the port
of Tomcat, I don't think I restarted my machine.
I stop tomcat before changing the conf file and
then restart the tomcat server (no not the machine)
after the changes. I think it works that way too.
Ahhh! well who knows I use a Microsoft box here.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040


But when I want to visit http://127.0.0.1:8080,
I failed, Why?

First, you can get all you need to do re this in the
tomcat/doc folder. The *howto* files.
Then if you have followed all these steps, you need to
starts tomcat first, then start your Apache. This way,
tomcat is ready on its designated port (8080 by default)
when Apache sends any msgs to it during startup (I don't
know if it will, but then I do it that way). Then when both
servers are up, you can still directly goto the URL you mentioned.
While all I said is generic info, if you could be a little more spcific abt the errors you get, then we could investigate
that issue...
regds.
- satya
kishore konuri
Greenhorn

Joined: Aug 04, 2001
Posts: 2
Dear satya,
you don't need to restart u'r machine when u change some thing in tomcat.but u need to restart u'r machine when u change the conf file of apache (not tomcat)..
tomcat-apache bridge is working fine for me...
satya,let me know if i'm wrong..
regds,
kishore.
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040


but u need to restart u'r machine when u change the conf file of apache (not tomcat)..
tomcat-apache bridge is working fine for me...
satya,let me know if i'm wrong..

well, I am afraid you are. On my win98 box, I just changed
the port on which apache runs from its default 80, to 8001.
Then I started apache and on my browser I pointed it
to my server using http://myMachineName:8001 and sure
enough, I saw the apache home page. So, I don't have to restart
my machine. Just re-start your apache server.

Oh, BTW the port is in the conf/httpd.conf file, in
case you want to try.
regds.
- satya
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15629
    
  15

Look at the tomcat-apache howto at http://jakarta.apache.org/tomcat in the tomcat docs. All cookbook.
You DON'T access tomcat via port 8080 if using apache - 8080 is the direct-to-tomcat http port. What you are trying to do is send tomcat-related requests coming in through the apache port (80) to tomcat by telling apache that tomcat is a handler for these types of requests.
BTW, I highly recommend you use the ajp3 connector not ajp2. It's MUCH less frustrating to get working right!


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat_WorkWith_Apache?
 
Similar Threads
error 404 in tomcat 5
compiling first JSP program
Simple question : Tomcat installation
hello everyone.I have made tomcat and apache together just now under your help!but--
tomcat port ---81;apache port---8080;