Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

Tomcat with Apache Web Server

Thread view: 
Ike - 30 Sep 2006 16:21 GMT
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>
IchBin - 30 Sep 2006 19:27 GMT
> 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
[quoted text clipped - 66 lines]
>     </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

Signature

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-)

Ike - 01 Oct 2006 01:32 GMT
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
Ike - 01 Oct 2006 02:42 GMT
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
Simon Brooke - 01 Oct 2006 08:04 GMT
> 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
[quoted text clipped - 14 lines]
> servlets-examples. (Addtionally, I will have multiple and different
> a_domain's)

<VirtualHost 217.34.156.188>
       ServerAdmin simon@jasmine.org.uk
       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 simon@jasmine.org.uk
       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>

Signature

simon@jasmine.org.uk (Simon Brooke) http://www.jasmine.org.uk/~simon/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.