You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Ibrahim Haddad (LMC)" <lm...@lmc.ericsson.se> on 2000/07/13 21:31:13 UTC

Apache cooperating w/ Tomcat problem

Hello all,

I have Apache 1.3.12 serving on port 80. I also have Tomcat 3.1 
serving on port 8080. I would like to set Apache to cooperate 
with Tomcat. So I followed the instruction in the "Tomcat 
Minimalistic User's Guide". 

I included $tomcathome/conf/tomcat-apache.conf in Apache's httpd.conf.
I restart Tomcat (it works ok on port 8080). I restart Apache (works 
ok on port 80). I try to access servername:8007 but the browser keeps
stalling and on the shell prompt I get:

------------
HANDLER THREAD PROBLEM: java.io.IOException: Stream broken
java.io.IOException: Stream broken at
org.apache.tomcat.service.connector.AJP12RequestAdapter.readNextRequest(Ajp12ConnectionHandler.java:386) 
	at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:134)
        at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
        at java.lang.Thread.run(Thread.java:475)
------------

I put the servlets examples under Apache's html directory and try to
access
it using: servername:80/servelts, and try to execute the Hello World
example,
for instance, I get an html page result saying:

------------
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, root@servername and inform them 
of the time the error occurred, and anything you might have done that
may 
have caused the error.
More information about this error may be available in the server error
log.
------------

I check Tomcat's log file but there are no errors. All there is:

root@lmcpc112471 logs]# more tomcat.log
Context log: path="/examples" Adding context path="/examples" 
docBase="webapps/examples"
Context log: path="" Adding context path=""  docBase="webapps/ROOT"
Context log: path="/test" Adding context path="/test" 
docBase="webapps/test"
Starting tomcat install="/usr/local/jakarta-tomcat/bin/.."
home="/usr/local/jakarta-tomcat"
classPath=".:/usr/local/jakarta-tomcat/bin/../lib/ant.jar:/usr/local/jakarta-tomcat/bin/../lib/jasper.jar:/usr/local/jakarta-tomcat/bin/../lib/servlet.jar:/usr/local/jakarta-tomcat/bin/../lib/test:/usr/local/jakarta-tomcat/bin/../lib/webserver.jar:/usr/local/jakarta-tomcat/bin/../lib/xml.jar:/usr/local/jdk1.2.2/bin/../lib/tools.jar"
Context log: path="/admin" Automatic context load
docBase="/usr/local/jakarta-tomcat/webapps/admin"
Context log: path="/admin" Adding context path="/admin" 
docBase="/usr/local/jakarta-tomcat/webapps/admin"Starting endpoint
port="8080"
handler="org.apache.tomcat.service.http.HttpConnectionHandler"
Starting endpoint port="8007"
handler="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"
[root@lmcpc112471 logs]# 
---------------

How can I make Apache co-operate with Tomcat? What am I missing?

Thanks a lot.

/ibrahim

Re: Apache cooperating w/ Tomcat problem

Posted by Alan Savary <al...@simteam.com>.
"Craig R. McClanahan" wrote:

> "Ibrahim Haddad (LMC)" wrote:
>
> > Hello all,
> >
> > I have Apache 1.3.12 serving on port 80. I also have Tomcat 3.1
> > serving on port 8080. I would like to set Apache to cooperate
> > with Tomcat. So I followed the instruction in the "Tomcat
> > Minimalistic User's Guide".
> >
> > I included $tomcathome/conf/tomcat-apache.conf in Apache's httpd.conf.
> > I restart Tomcat (it works ok on port 8080). I restart Apache (works
> > ok on port 80). I try to access servername:8007 but the browser keeps
> > stalling and on the shell prompt I get:
> >
>
> You should not be referring to port 8007 directly from your browser.  That port is used only to communicate between Apache and Tomcat, and it does not use the HTTP protocol.
>
> Instead, use a port 80 URI that references one of the URIs that is being forwarded to Tomcat.  For example, if you used the standard Tomcat configuration you should be able to request:
>
>     http://servername/examples/jsp
>
> and get the index page for the JSP examples, and then execute the JSP pages from there, while going through Apache.
>
> Craig McClanahan

When I try this URL, my browser is searching (I can see it in the status bar) www.http.com

But it works if I request http://servername/examples/jsp/

Why?

I also have a similar problem:

When I request http://localhost/examples, or http://localhost/examples/
I can see a web page with 3 directories links (images,jsp and servlets).

If i try to click on the last 2 links (jsp or servlets) then the browser

is trying to search www.http.com. If I click the images link, we enter
into
the directory correctly.

Requesting http://localhost/examples/jsp does the same error.

Requesting http://localhost/examples/jsp/ give me the JSP sample page,
and JSP samples work!

But if I request http://localhost:8080/examples/ and then click the jsp
link,
then it works!!

How to remove the need for port declaration in URL?

Best regards,

Alan.
--
============================================
Alan Savary
R&D Engineer
SimTeam
Virtual Presence
Muse Technologies, Inc
Tel: +33 (0)1 45 45 15 55
Fax +33 (0)1 45 45 16 17
Web: http://www.simteam.com & http://www.vrweb.com & http://www.musetech.com
email: alan@simteam.com




Re: Apache cooperating w/ Tomcat problem

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
"Ibrahim Haddad (LMC)" wrote:

> Hello all,
>
> I have Apache 1.3.12 serving on port 80. I also have Tomcat 3.1
> serving on port 8080. I would like to set Apache to cooperate
> with Tomcat. So I followed the instruction in the "Tomcat
> Minimalistic User's Guide".
>
> I included $tomcathome/conf/tomcat-apache.conf in Apache's httpd.conf.
> I restart Tomcat (it works ok on port 8080). I restart Apache (works
> ok on port 80). I try to access servername:8007 but the browser keeps
> stalling and on the shell prompt I get:
>

You should not be referring to port 8007 directly from your browser.  That port is used only to communicate between Apache and Tomcat, and it does not use the HTTP protocol.

Instead, use a port 80 URI that references one of the URIs that is being forwarded to Tomcat.  For example, if you used the standard Tomcat configuration you should be able to request:

    http://servername/examples/jsp

and get the index page for the JSP examples, and then execute the JSP pages from there, while going through Apache.

Craig McClanahan