Tomcat with Apache Web Server

I

Ike

I am trying to set up Tomcat 5.0.28 to run under an Apache Web Server
2.0.59. I have the correct mod_jk.so and have everything set up just fine on
a Windows XP SP2 box.

My CATALINA_HOME directory is C:\Tomcat

Everything works fine with the examples for
C:\Tomcat\webapps\servlets-examples. Additionally, everythging works fine
with the Apache web server taking the static content as it should, and
Tomcat taking on the servlets.

What I want to do is have it so that when I call
{a_domain}/servlets/myservlet that the myservlet be executed. But I cannot
seem to get it to do this. My problem is in my httpd.conf file, and I have
tried copying from that portion of it (which works) for servlets-examples.
(Addtionally, I will have multiple and different a_domain's)

Can someone please help me here and show me what I am doing wrong? Thanks,
Ike. My httpd.conf for the relevant portion is below: p.s. yes I have
restarted Apache and Tomcat.


LoadModule jk_module modules/mod_jk.so

<IfModule mod_jk.c>

JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel error
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"

Alias /jsp-examples "C:/Tomcat/webapps/jsp-examples/"

<Directory "C:/Tomcat/webapps/jsp-examples/">
Options Indexes +FollowSymLinks
AllowOverride None
Allow from all
</Directory>

JkMount /jsp-examples/*.jsp example

Alias /servlets-examples "C:/Tomcat/webapps/servlets-examples/"

<Directory "C:/Tomcat/webapps/servlets-examples/">
Options Indexes +FollowSymLinks
AllowOverride None
Allow from all
</Directory>

JkMount /servlets-examples/* example

#now here is my stuff, which isn;t working ###################
#my servlet.class file is in C:\Tomcat\webapps\a_domain\WEB-INF\classes

Alias /a_domain/servlets "C:/Tomcat/webapps/a_domain/"

<Directory "C:/Tomcat/webapps/a_domain/">
Options Indexes +FollowSymLinks
AllowOverride None
Allow from all
</Directory>

JkMount /a_domain/servlets/* example

<Location /*/WEB-INF/*>
AllowOverride None
deny from all
</Location>
</IfModule>
 
I

IchBin

Ike said:
I am trying to set up Tomcat 5.0.28 to run under an Apache Web Server
2.0.59. I have the correct mod_jk.so and have everything set up just fine on
a Windows XP SP2 box.

My CATALINA_HOME directory is C:\Tomcat

Everything works fine with the examples for
C:\Tomcat\webapps\servlets-examples. Additionally, everythging works fine
with the Apache web server taking the static content as it should, and
Tomcat taking on the servlets.

What I want to do is have it so that when I call
{a_domain}/servlets/myservlet that the myservlet be executed. But I cannot
seem to get it to do this. My problem is in my httpd.conf file, and I have
tried copying from that portion of it (which works) for servlets-examples.
(Addtionally, I will have multiple and different a_domain's)

Can someone please help me here and show me what I am doing wrong? Thanks,
Ike. My httpd.conf for the relevant portion is below: p.s. yes I have
restarted Apache and Tomcat.


LoadModule jk_module modules/mod_jk.so

<IfModule mod_jk.c>

JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel error
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"

Alias /jsp-examples "C:/Tomcat/webapps/jsp-examples/"

<Directory "C:/Tomcat/webapps/jsp-examples/">
Options Indexes +FollowSymLinks
AllowOverride None
Allow from all
</Directory>

JkMount /jsp-examples/*.jsp example

Alias /servlets-examples "C:/Tomcat/webapps/servlets-examples/"

<Directory "C:/Tomcat/webapps/servlets-examples/">
Options Indexes +FollowSymLinks
AllowOverride None
Allow from all
</Directory>

JkMount /servlets-examples/* example

#now here is my stuff, which isn;t working ###################
#my servlet.class file is in C:\Tomcat\webapps\a_domain\WEB-INF\classes

Alias /a_domain/servlets "C:/Tomcat/webapps/a_domain/"

<Directory "C:/Tomcat/webapps/a_domain/">
Options Indexes +FollowSymLinks
AllowOverride None
Allow from all
</Directory>

JkMount /a_domain/servlets/* example

<Location /*/WEB-INF/*>
AllowOverride None
deny from all
</Location>
</IfModule>

You need to add a JkMount for the myservlet program you are trying to run.

I never added an Alias, Location nor Directory for servlets-examples.

This is all I added for jsp-examples:

JkWorkersFile "conf/workers.properties"
JkLogFile "logs/mod_jk.log"
JkLogLevel error

JkMount /jsp-examples default
JkMount /jsp-examples/* default

--
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
 
I

Ike

I cannot understand why this is so seemingly complicated.

I have C:\Tomcat as CATALINA_HOME

Everything should go under webapps/ROOT

I have a servlet, myservlet.class.

I put it in C:\Tomcat\webapps\ROOT\classes.

Im just down to what I need to put into httpd.conf, but there really is no
documetnation I can find on this very simple exercise. Can someone who is
doing this please explain what would go into httpd.conf using I am using
mod_jk. Thanks, Ike
 
I

Ike

OK....I got it (finally, despite the stupid pills)....

myservlet.class goes in C:\Tomcat\webapps\gg\WEB-INF\classes.

httpd.conf gets:

JkMount /gg/servlet/* example

now, if I hit:
http://localhost/gg/servlet/myservlet

it is invoked by tomcat. If I hit

http://localhost/gg

then it invokes the /htdocs under Apache for the typical Apache webserver --
exactly as I want. -Ike
 
S

Simon Brooke

Ike said:
I am trying to set up Tomcat 5.0.28 to run under an Apache Web Server
2.0.59. I have the correct mod_jk.so and have everything set up just fine
on a Windows XP SP2 box.

My CATALINA_HOME directory is C:\Tomcat

Everything works fine with the examples for
C:\Tomcat\webapps\servlets-examples. Additionally, everythging works fine
with the Apache web server taking the static content as it should, and
Tomcat taking on the servlets.

What I want to do is have it so that when I call
{a_domain}/servlets/myservlet that the myservlet be executed. But I
{cannot
seem to get it to do this. My problem is in my httpd.conf file, and I
have tried copying from that portion of it (which works) for
servlets-examples. (Addtionally, I will have multiple and different
a_domain's)

<VirtualHost 217.34.156.188>
ServerAdmin (e-mail address removed)
ServerName www.stewartry-wheelers.org
DocumentRoot /home/wheelers/public_html/
ErrorLog /var/log/apache/wheelers_error.log
TransferLog /var/log/apache/wheelers_access.log
JkMount /wheelers/* ajp13
JkMount /wheelerswiki/* ajp13
</VirtualHost>

<VirtualHost 217.34.156.188>
ServerAdmin (e-mail address removed)
ServerName www.7-24.org.uk
DocumentRoot /home/seven24/public_html/
ErrorLog /var/log/apache/7-24_error.log
TransferLog /var/log/apache/7-24_access.log
JkMount /seven24/* ajp13
</VirtualHost>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top