14. Installing more MMBase servers on a single Tomcat server

If you want to support more instances of MMBase, for example if you would like to make MMBase available to more or all of your users, you can create several MMBase installations and have these all run on the same Tomcat server.

Install MMBase in the home directory of the user <user> performing all steps before:

Make sure both the user and the Tomcat server have access to the MMBase installation:

  
  chown -R <user>:tomcat /home/<user>/mmbase/
  
  

Make sure that the directory /home/<user>/mmbase/WEB-INF/config/builders/applications is writable and accessible by the servlet engine user (for auto-installing builders):

  
  chmod 770 /home/<user>/mmbase/WEB-INF/config/builders/applications
  chmod 750 /home/<user>/mmbase/WEB-INF/config/builders/
  chmod 750 /home/<user>/mmbase/WEB-INF/config/
  chmod 750 /home/<user>/mmbase/WEB-INF/
  chmod 750 /home/<user>/mmbase/
  
  

Now the home directory of this user has to be accessible to the Tomcat server as well. You can change the group owner of the users home directory to the tomcat user group:

  
  chown -g tomcat /home/<user>/
  
  

Or, if you don't want this, use the Access Control Lists (ACL's) to accomplish the same:

  
  setfacl -m u:tomcat:r-x /home/<user>/
  
  

Finally, link the new MMBase installation to the Tomcat server:

  
  ln -s /home/<user>/mmbase /usr/local/tomcat/webapps/mmbase-<user>
  
  

and restart Tomcat:

  
  service tomcat restart
  
  

which will make this users MMBase installation available through:

  
  http://<hostname>:8080/mmbase-<user>/
  
  

Again, you can set up a JK 2 mapping or a reverse proxy in Apache like we did before.

Important

In order to run several instances of MMBase on a single Tomcat server, make sure you increase the available memory resources, i.e. by adding to the $CATALINA_OPTS environment variable in /etc/rc.d/init.d/tomcat:

  
  -Xms64m -Xmx512m