integrating Apache with Tomcat
Hi all!
I'm sort of new around here (new to this forum, not to the field ) and I have recently installed and set-up apache1.3+tomcat4.0+mysql with some minor probs to begin with but now they are working good. the only "minor" detail I wanted to fix is that currently I have to specify the path+port_number on the links on my html files so that Apache knows that those files/links belong to Tomcat to deal with. I'm sure there is a better way to make Apache and Tomcat integrate smoothly, so if any of you can help me out there, I would very much appreciate.
Another thing, I set-up the whole system on a windows2k os but I had to trial & error to get some of the things working at first because I think the Apache1.3+Tomcat4.0 docs are not accurate or up-to-date. For instance I found out that I could only access mysql when placing the mysql-jdbc.jar file on the Tomcat/lib folder. Any other solution presented on the literature (setting the classpath, placing the .jar file on the jdk/lib folder, pointing the classpath to the org.gjt... directory, did not work...)
Cheers and thanks
joba
mairving posted this at 13:23 — 10th October 2001.
They have: 2,256 posts
Joined: Feb 2001
joba, welcome to WMF. In a previous thread, I mentioned the lack of docs and help for Apache/Windows. Plenty of help out there for Apache/'nix.
To get your question straight in my head, you are saying that you have to make a link like this:
http://www.link.com/webpage.html:80 or something such.
Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states
joba posted this at 13:33 — 10th October 2001.
They have: 14 posts
Joined: Oct 2001
First of all, thank you Mark, for your prompt answer!
Yes, that is exactly what is hapening: I have to write the links on the form -http://www.whatever.net:8080/folder/file
I am sure it is possible to make Apache know that .jsp and java class files should be handled by Tomcat. I have seen how to do this with the previous versions of Tomcat (3.2...) & Apache (1.2...), but not with the ones I've got (which by the way, were a lot easier to install & set up on Win2k!)
Jorge
joba
netcommr posted this at 20:15 — 7th November 2001.
They have: 8 posts
Joined: Nov 2001
We had the same issue, domain:8080, using Apache/Tomcat, though this was a *nix machine. Now we are able to connect to domain/servlet. Below is a snip from our httpd.conf if it helps you any...
LoadModule jserv_module modules/mod_jserv.so
ApJServManual on
ApJServDefaultProtocol ajpv12
ApJServSecretKey DISABLED
ApJServMountCopy on
ApJServLogLevel notice
ApJServDefaultHost localhost
ApJServDefaultPort 4444
Alias /servlet /home/**********/public_html
SetHandler jserv-servlet
ApJServMount /servlet
----------------
Note: I am not the server admin, just glanced at the config to see if I could help ya.
----------------
Nice site mods... I'll have to take a day or so and read through the posts.
http://www.KeywordDelivery.com
A dynamic response content delivery and management system which allows any web page to display content targeting the visitors interest based on the referrer.
joba posted this at 13:25 — 23rd November 2001.
They have: 14 posts
Joined: Oct 2001
Hi all,
First of all, thanks for your help with my Apache-Tomcat4-windows-integration issue. In the meantime I went on a holiday and just got back.
Now in case anyone bumps into the same problem of integrating Apache with Tomcat4 on a Windows platform, I found 2 ways of doing that. Just as a reminder, the problem was having to use "www.domainname:tomcat_port" every time you wanted a link to be served by tomcat on your main html documents handled by Apache.
It is not hard at all to get what I want done, but I found the jakarta documentation a bit confusing.
Solution 1 -Using the mod_webapp connector
1 - download mod_webapp from the jakarta website (download the .dll AND the .lib file) and place them on the /modules/ folder of your Apache directory.
2 - Add these lines to the bottom of your "httpd.conf" file on the Apache directory:
LoadModule webapp_module modules/mod_webapp.so
WebAppConnection warpConnection warp :8008
WebAppDeploy examples warpConnection /examples/
Remember to replace
with your Apache server domain name (in my case is arakno.net -don't know why localhost did not work because this way it seems to me that he has to resolve the domain name only to discover that it is the same machine...go figure)
Remember also that this assumes your applications to be inside the /examples folder on the Tomcat directory.
And that's it. I did this pretty fast and I didn't have time to go through all that is happening underneath but it worked as I wanted. Now on my html page served by Apache, I can link to the servlets or .jsp files just by using the relative path+filename.
Solution 2- Using the connector mod_jk
1-Download the mod_jk connector and again place it on your /modules/ folder on the Apache directory.
Get hold of a .config file for Tomcat. I can give you one if you need it. The thing is that Tomcat3.x creates a config file automatically. I haven't seen this feature on Tomcat4. But I have used one .config that I found on the web and adjusted it to my system.
2-edit your htpdconfig file on Apache and on the bottom add a line that includes the Tomcat file above mentioned:
And that will work. There are some specific issues and details that I do not quite master but I will work on them and let everybody know. Maybe someone can teach me some stuff as I did this pretty much by trial-error and by brute force.
cheers
joba
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.