You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Magnotta, Salvatore" <sm...@stoltenberg.com> on 2005/04/05 22:50:41 UTC

Tomcat + Apache Web Server

Hello,

I'm new with Apache products and this is my first post.  Please see the background info - it explains what versions I have and what I have done.

Question: How can I have both Apache and Tomcat running on a Windows platform using Internet Explorer and do the following:

http://localhost/servlet/HelloServlet  (no Tomcat default port 8080)

instead of 

http://localhost:8080/servlet/HelloServlet

?

If I try to do http://localhost/servlet/HelloServlet  I get an internal server error.  It cannot find where this is located.
Apache is trying to find it at C:\Documents and Settings\username\My Documents\My Website\localhost\www\servlet\HelloServlet

instead of 

C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\classes\HelloServlet

-------------------------------------------------------------------------
Background:  

Apache 2.0.53  (Port 80 - default)
Tomcat 5.5.7    (Port 8080 - default)
mod_jk 1.2.8 (to connect the two together)

Operating System: Win 2K Server

I installed both Apache and Tomcat as Windows Services using the install programs that are available.  

I am able to access  http://localhost and http://localhost:80  (Apache Web server page comes up)
I am able to access http://localhost:8080  (Tomcat page comes up)
I am able to create basic servlets and run them.  For example, http://localhost:8080/servlet/HelloServlet
I am able to access this host from another machine running Win XP.  I can bring up the Apache and Tomcat home pages on that PC's browser, and the servlets.

I have placed the following in my httpd.conf file:

LoadModule jk_module modules/mod_jk.so
JkWorkersFile "C:/Program Files/Apache Software Foundation/Tomcat 5.5/conf/workers.properties"
JkLogFile "C:/Program Files/Apache Group/Apache2/logs/mod_jk.log"
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

I have the workers.properties file also set up:

worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=2

worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp12, ajp13


Thank you,
Sal






Re: Tomcat + Apache Web Server

Posted by Jorge Davila <is...@nicaraguarealestate.com>.
You most configure mod_proxy in apache to get the configuration desired.

The idea is that apache receive the request and if the request is for
tomcat apache send the request at the respective servlet.

http://httpd.apache.org/docs-2.0/mod/mod_proxy.html

Best regards,

Jorge Dávila.

El mar, 05-04-2005 a las 16:50 -0400, Magnotta, Salvatore escribió:
> Hello,
> 
> I'm new with Apache products and this is my first post.  Please see the background info - it explains what versions I have and what I have done.
> 
> Question: How can I have both Apache and Tomcat running on a Windows platform using Internet Explorer and do the following:
> 
> http://localhost/servlet/HelloServlet  (no Tomcat default port 8080)
> 
> instead of 
> 
> http://localhost:8080/servlet/HelloServlet
> 
> ?
> 
> If I try to do http://localhost/servlet/HelloServlet  I get an internal server error.  It cannot find where this is located.
> Apache is trying to find it at C:\Documents and Settings\username\My Documents\My Website\localhost\www\servlet\HelloServlet
> 
> instead of 
> 
> C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\classes\HelloServlet
> 
> -------------------------------------------------------------------------
> Background:  
> 
> Apache 2.0.53  (Port 80 - default)
> Tomcat 5.5.7    (Port 8080 - default)
> mod_jk 1.2.8 (to connect the two together)
> 
> Operating System: Win 2K Server
> 
> I installed both Apache and Tomcat as Windows Services using the install programs that are available.  
> 
> I am able to access  http://localhost and http://localhost:80  (Apache Web server page comes up)
> I am able to access http://localhost:8080  (Tomcat page comes up)
> I am able to create basic servlets and run them.  For example, http://localhost:8080/servlet/HelloServlet
> I am able to access this host from another machine running Win XP.  I can bring up the Apache and Tomcat home pages on that PC's browser, and the servlets.
> 
> I have placed the following in my httpd.conf file:
> 
> LoadModule jk_module modules/mod_jk.so
> JkWorkersFile "C:/Program Files/Apache Software Foundation/Tomcat 5.5/conf/workers.properties"
> JkLogFile "C:/Program Files/Apache Group/Apache2/logs/mod_jk.log"
> JkLogLevel info
> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
> 
> I have the workers.properties file also set up:
> 
> worker.ajp13.port=8009
> worker.ajp13.host=localhost
> worker.ajp13.type=ajp13
> worker.ajp13.lbfactor=2
> 
> worker.loadbalancer.type=lb
> worker.loadbalancer.balanced_workers=ajp12, ajp13
> 
> 
> Thank you,
> Sal
> 
> 
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org