[opencms-dev] Concepts on Apache+Tomcat

Claus Priisholm cpr at codedroids.com
Sat Feb 7 08:55:28 CET 2009


I've been using this recipe successfully for fronting tomcat with apache:

http://www.sebastian.himberger.de/comp/tutorials/opencms/apache-integration/

For OpenCms 7 you don't need the first step (changing the top_fs.jsp) 
but otherwise just follow the recipe.

If your using mod_jk and still have the browser hit the tomcat port 
(like 8180) then the setup is wrong, Mod_jk allows apache to contact 
tomcat via the AJP connector (typically 8009), get the response and then 
send it back to the browser - all this as if apache itself did the work 
and so the browser should only see the port number that your apache is 
running (likely to be 80, i.e. implicit)

Iván V.G. wrote:
> Hi again:
> 
> I'm trying to configure OpenCms with Tomcat+Apache, for many days now,
> and I'm getting more and more confused each time. I've read a lot of
> documentation, forums, mail archives, etc. and now I can't be sure of
> what I'm really doing. I've been trying many configurations without
> much success, and I'm beginning to think all I'm doing is messing up
> the system configuration and my concepts.
> 
> I need the following: I have a dedicated server in which I need to
> install several applications (some using PHP & Apache, and some using
> Java & Tomcat), one of that being OpenCms. I also need to have
> dedicated subdomains for them; for example: www.domain.com for the web
> using OpenCms served by Tomcat, support.domain.com for a PHP ticketing
> system served by Apache, etc. By the moment, I pretend to run just one
> site within OpenCms (maybe later will do another ones, but I need to
> control first the simpler configuration). We also could use other
> Tomcat applications besides OpenCms. We don't want to see ":8180" in
> the URL of the Tomcat applications, and generally we prefer to have
> the cleanest possible URL's.
> 
> This is my technical context: I'm using Debian 4.0, with Java, Apache
> and Tomcat installed from the repositories, and working fine
> separately. OpenCms is also working, installed as the ROOT application
> of Tomcat and with the main servlet renamed from "opencms" to "cms".
> By the moment there is just one site inside OpenCms.
> 
>>From what I've read, there are at least two ways of joining Tomcat and
> Apache: one is using mod_jk and other is using mod_proxy. At the
> beginning I wen't configuring mod_jk, which after some efforts worked
> well, although it still showed the ":8180" URL. I thought I could get
> rid of it using mod_jk, but now I think it has nothing to do with it,
> isn't it? I now suppose that "mod_jk" just joins Apache and Tomcat,
> but to "play" with the URL's you have to use "mod_proxy" (or is it
> "mod_rewrite"?), isn't it?
> 
> Moreover, regarding Apache HTTPd configuration, I'm not sure if I have
> to define different sites or virtual hosts (In fact I'm not sure if
> they're the same thing!). I've tried two options: a) defining a new
> "site" in "sites-available" just for the "www.domain.com" and b)
> making two different configurations at the "default" site, one for
> "*:80" and another for "*:8180".
> 
> I've got several configuration examples on my desk, but now I don't
> now which one should I follow. I really need some guidance and help on
> this. Thank you very much in advance.
> 

-- 
Claus Priisholm, CodeDroids ApS
Phone: +45 48 22 46 46
cpr (you know what) codedroids.com - http://www.codedroids.com
cpr (you know what) interlet.dk - http://www.interlet.dk
-- 
Javadocs and other OpenCms stuff: 
http://www.codedroids.com/community/opencms




More information about the opencms-dev mailing list