Διαμόρφωση Πολλαπλών Εμφανίσεων του LAMS σε Μία Μηχανή


Added by Spyros Papadakis, last edited by Spyros Papadakis on Sep 16, 2008

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
Unknown macro: {snipedit}

Intro

You may have a need to run multiple instances of LAMS on one machine. This may be to run LAMS 1.0.x and LAMS 2.0, or two different LAMS 2.0 instances (e.g. two groups in your organisation want to have two completely different instances with different welcome pages, different default content, etc).

If your machine can have virtual machines, then you could run each instance of LAMS in its own virtual machine. That is outside the scope of this page.

But if you can't have virtual machines, then you will need to have two different JBoss installations on the one machine.

This is described on the JBoss Website on http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfiguringMultipleJBossInstancesOnOneMachine.

Basically, to do this you can either bind each jboss instance to an IP, or configure each instance to use a different (unique) set of ports, on the same IP. In a production environment, the latter could be used with Apache/jk/rewrite.

Method 1 - Bind to IP

This works if your machine has multiple IPs. Basically instead of starting jboss with@import url(/download/resources/confluence.ext.code:code/shStyles.css);| /usr/local/jboss-4.0.2/bin/run.sh |/usr/local/jboss-4.0.2/bin/run.shif(!window.newcodemacro_initialised) { window.newcodemacro_initialised = true; window.oldonloadmethod = window.onload; window.onload = function(){ dp.SyntaxHighlighter.HighlightAll('newcodemacro'); if(window.oldonloadmethod)

Unknown macro: { window.oldonloadmethod(); }

} }
do

/usr/local/jboss-4.0.2/bin/run.sh -b 192.168.1.1 /usr/local/jboss-4.0.2/bin/run.sh -b 192.168.1.1if(!window.newcodemacro_initialised) { window.newcodemacro_initialised = true; window.oldonloadmethod = window.onload; window.onload = function(){ dp.SyntaxHighlighter.HighlightAll('newcodemacro'); if(window.oldonloadmethod)

} }

Method 2 - JBoss' Service Binding (Map Ports)

Time to configure: 5 minutes
Files modified:

  • $JBOSS_HOME/server/
    Unknown macro: {new server instance}

    /* (just copy the default folder into a new folder)

  • $JBOSS_HOME/server/
    Unknown macro: {each server instance}

    /conf/jboss-service.xml (modified for each instance you want to run)

    • $JBOSS_HOME/docs/examples/binding-manager/sample-bindings.xml
    • $JBOSS_HOME/server/

    /conf/login-config.xml (update the path to the lamsauthentication.xml at the bottom)

See the above JBoss Wiki page for motivation reasons and instructions.


LAMS 1.0.x
If for whatever reason you would like to run LAMS 2.0 with LAMS 1.0, you can. 1.0 uses JBoss 3.0, which has no option to bind to an IP, so you must use the second method of using different ports. Assign the default ports to LAMS 1.0, and another set to LAMS 2, as JBoss 3.0's sample-bindings.xml doesn't cover all ports that are used when it is actually run.

Notes on Using the Java Service Wrapper

In addition to the standard instructions to setup the wrapper with jboss here, do the following:

  • rename $JBOSS_HOME/conf/wrapper.conf to something like wrapper_server1.conf, and increment as necessary.
  • rename your init script (the one originally called sh.script.in) to something more descriptive, as you'll be having one for each server instance
  • in the init script, change the name of the the wrapper.conf to match your renamed conf file above
  • pass your '-b' or '-c' parameters to run.sh by specifying it in the conf file:
    wrapper.app.parameter.1=org.jboss.Main
    wrapper.app.parameter.2=-c
    wrapper.app.parameter.3=server1 wrapper.app.parameter.1=org.jboss.Main
    wrapper.app.parameter.2=-c
    wrapper.app.parameter.3=server1if(!window.newcodemacro_initialised) { window.newcodemacro_initialised = true; window.oldonloadmethod = window.onload; window.onload = function()
    Unknown macro: { dp.SyntaxHighlighter.HighlightAll('newcodemacro'); if(window.oldonloadmethod)
    Unknown macro: { window.oldonloadmethod(); }
    }
    }
  • you may also want to make each wrapper log to a different wrapper.log by modifying the wrapper.logfile parameter in each wrapper.conf