You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Shoe <ms...@gmail.com> on 2007/04/07 16:09:53 UTC

Apache2 Tomcat5.5 auto mod_jk 1.2.18 only works localhost

I've been trying to get apache 2(running on port 80) to front end my tomcat
instance(running port 8080) using this tutorial
http://www.slholmes.org/journal/2006/7/15/apache-2-tomcat-5-mod_jk-xp.html


I can get the following URL's to work just fine from localhost
     http://localhost:8080/servlest-examples   (hitting tomcat directly)
     http://localhost/servlets-examples          (hitting apache which is
passing off to tomcat)


The problem comes in when I attempt to have my home router redirect
traffic(port forward) to the apache instance using a domain instead of
"localhost".   This doesn't work for my tomcat apps.  It will display the
apache start page just fine but will show the following 404 when I try and
request one of the apps deployed in tomcat.

Here is the error I get when I try
The requested URL /servlets-examples was not found on this server.
Apache/2.0.59 (Unix) DAV/2 SVN/1.4.3 mod_jk/1.2.18 Server at
www.**domainremoved**.com Port 80

I've atttached Apache's httpd.conf , Tomcats server.xml, and the auto
generated mod_jk.conf

I think these are the relevant pieces to the puzzle.  Please let me know if
there is something else I should focus on.

Thanks in advance.  Once I figure this out, I'll write up a how to in order
to help the next person out.

Thanks
Mike

Re: Apache2 Tomcat5.5 auto mod_jk 1.2.18 only works localhost

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
Try this
Add this to your server.xml

<Host name="Your Host Name" appBase="webapps"

unpackWARs="true" autoDeploy="true"

xmlValidation="false" xmlNamespaceAware="false">

<!-- USE THIS FOR AUTO GEN OF JK MOD for Apache Forwarding to tomcat -->

<Listener className="org.apache.jk.config.ApacheConfig" append="true" forwardAll="false" modJk="D:/DEV/Apache2.2/modules/mod_jk.so"/>



</Host>

Then have a look at conf\auto\mod_jk.so.... and map Apache to that file.

What this stuff does is generate the file (WHEN TOMCAT STARTS) needed by Apache automatically... nice!

Enjoy...

  ----- Original Message ----- 
  From: Shoe 
  To: users@tomcat.apache.org 
  Sent: Saturday, April 07, 2007 4:09 PM
  Subject: Apache2 Tomcat5.5 auto mod_jk 1.2.18 only works localhost


  I've been trying to get apache 2(running on port 80) to front end my tomcat instance(running port 8080) using this tutorial http://www.slholmes.org/journal/2006/7/15/apache-2-tomcat-5-mod_jk-xp.html 

  I can get the following URL's to work just fine from localhost
       http://localhost:8080/servlest-examples   (hitting tomcat directly)
       http://localhost/servlets-examples          (hitting apache which is passing off to tomcat)


  The problem comes in when I attempt to have my home router redirect traffic(port forward) to the apache instance using a domain instead of "localhost".   This doesn't work for my tomcat apps.  It will display the apache start page just fine but will show the following 404 when I try and request one of the apps deployed in tomcat.  

  Here is the error I get when I try
  The requested URL /servlets-examples was not found on this server.
  Apache/2.0.59 (Unix) DAV/2 SVN/1.4.3 mod_jk/1.2.18 Server at www.**domainremoved**.com Port 80 

  I've atttached Apache's httpd.conf , Tomcats server.xml, and the auto generated mod_jk.conf

  I think these are the relevant pieces to the puzzle.  Please let me know if there is something else I should focus on.  

  Thanks in advance.  Once I figure this out, I'll write up a how to in order to help the next person out.  

  Thanks
  Mike



------------------------------------------------------------------------------


  ---------------------------------------------------------------------
  To start a new topic, e-mail: users@tomcat.apache.org
  To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
  For additional commands, e-mail: users-help@tomcat.apache.org