• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

2 JForums Running at 1 Context

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys!!!

I would like to run 2 JForum's instances at the same Tomcat's context...

I suppose that the only differences between different JForums would be the database and the file WEB-INF\config\jforum-custom.conf, am I right?

I would like to do it because my provider charges about US$10 per new Tomcat context... but (I think) almost all the files under JForum could be shared between infinite JForum's instances, just changing the database target and one or two configuration files, don't you agree?

Tips and ideas would be very welcomed!!!

[ ]'s
[originally posted on jforum.net by leandro_salvador]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't think you're going to be able to do that!

The "context root" is the path (directory) to the app ... it will be difficult (if not impossible) to deploy two instances or apps to the same place and have it work.

A comparison of what you are wanting to do would be trying to install an application twice to the same directory and expecting to have two applications available ... doesn't work that way, it will overwrite the previous install.


leandro_salvador wrote:Hi Guys!!!

I would like to run 2 JForum's instances at the same Tomcat's context...

I suppose that the only differences between different JForums would be the database and the file WEB-INF\config\jforum-custom.conf, am I right?

I would like to do it because my provider charges about US$10 per new Tomcat context... but (I think) almost all the files under JForum could be shared between infinite JForum's instances, just changing the database target and one or two configuration files, don't you agree?

Tips and ideas would be very welcomed!!!

[ ]'s


[originally posted on jforum.net by GatorBait3]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi GatorBait3!!!

But don't you think that in fact, the only affected physical files are the database and WEB-INF\config\jforum-custom.conf?

Don't run all the rest on virtual memory?

I accept your considerations, it makes sense... but I don't see what happens behind the JForum engine (or would be Tomcat?) that don't allow 2 instances simultaneously... just sharing my persistent doubts... ;)

[ ]'s
[originally posted on jforum.net by leandro_salvador]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Absolutely not .. it's all the files. Just try deploying a Tomcat app twice to the same place. You can't do it.

And think about it ... how does the app get into the "virtual memory" .... something has to load it.

And how would each app piece know which config file to use? There would be mass confusion for the application trying to figure out what to do (if you could even install it as you would like).

And when you hit the URL for the app (i.e. http://localhost:8080/AppName) .. which one will load? How are you going to split the apps among different ports (you can't on a single URL)? Or, if you have a jk-workers hook from Apache ... how would that work? (it wouldn't!)

However, you could literally code two apps to live side-by-side under one context root - packaged as a single app.

Pay the $10 and be done with it... ;)


leandro_salvador wrote:Hi GatorBait3!!!

But don't you think that in fact, the only affected physical files are the database and WEB-INF\config\jforum-custom.conf?

Don't run all the rest on virtual memory?

I accept your considerations, it makes sense... but I don't see what happens behind the JForum engine (or would be Tomcat?) that don't allow 2 instances simultaneously... just sharing my persistent doubts... ;)

[ ]'s


[originally posted on jforum.net by GatorBait3]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have sense of humor

In my case, and I don't know exactly why, the JForum's index.htm file isn't the first one loaded, but the file index.jsp, which has response.sendRedirect from request.getHeader("host")...

Well, I think it's because Tomcat runs under Apache... but I'm not sure...

Anyway, if each app piece had its own config file, with the sendRedirect from JSP would be possible to diferenciate which config file to load basing on the hitted URL :lol:

It's not the US$10 from the new Tomcat's context... JForum uses +- 41MB... how I have 100MB, my Test's context uses other 41MB... if each JForum will use 41MB, I'll have to hire another plan, of 300MB... the double of the price...

It's what motivated me to try run 2 JForums at the same context...

My last one hope would be, in some specific part of JForum lines, to insert an IF-ELSE to select the configuration file depending of the URL... but I already understood that it's not conventional and would be virtually impossible...

I don't intend to reinvent the wheel...

So, TKS a lot for your attention Bud!!! This altruism around the free software community charms me

[ ]'s
[originally posted on jforum.net by leandro_salvador]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

leandro_salvador wrote:You have sense of humor


I try! ;)

leandro_salvador wrote:Well, I think it's because Tomcat runs under Apache... but I'm not sure...


No, Tomcat and Apache are two different applications. Tomcat is an application server, Apache is a web server. There are ways to "tie" the two together.

leandro_salvador wrote:Anyway, if each app piece had its own config file, with the sendRedirect from JSP would be possible to diferenciate which config file to load basing on the hitted URL :lol:


But there is the rub ... which app would be loaded when you hit a single URL? Both? Let's say you could load both ... then which one would be handling the requests from the web browser? There would need to be some kind of identifier to say which app gets the request. Usually this is in the form of a different URL / port. That's just one of the reasons why what you want to do won't work this way.

leandro_salvador wrote:My last one hope would be, in some specific part of JForum lines, to insert an IF-ELSE to select the configuration file depending of the URL... but I already understood that it's not conventional and would be virtually impossible...


But again, how would your IF-ELSE logic determine via a GET request or URL which application should be used? There is no way for your application to test to see which app should be used, since both apps would be pointed to by the same URL, and the browser doesn't know which one to pick, and it is not passing a special flag or parameter to your application by default.

leandro_salvador wrote:So, TKS a lot for your attention Bud!!! This altruism around the free software community charms me
[ ]'s



Glad to try to help. You ask some interesting questions ... ;)
[originally posted on jforum.net by GatorBait3]
 
reply
    Bookmark Topic Watch Topic
  • New Topic