Whole document tree
    

Whole document tree

MMBase Mini-HOWTO: Installation on Debian Woody: Configuration files Next Previous Contents

5. Configuration files

There are various configuration files that need some adjustment or have to be created.

5.1 apache

In my setup, I created a virtual host to handle all MMBase request, but using a few Alias directors it cannot be too hard to include MMBase somewhere in your normal web tree.

...
LoadModule jk_module /usr/lib/apache/1.3/mod_jk.so
...
<VirtualHost x.y.z.a:80>  
   ServerName mmbase.idonotexist.com  
   DocumentRoot /usr/local/mmbase/html  
   # mod_jk specific  
   <IfModule mod_jk.c>    
      JkMount /*.jsp ajp12    
      JkMount /*.shtml ajp12    
      JkMount /servlet/* ajp12    
      JKMount /mmservlets/* ajp12    
      JKMount /*.db ajp12    
      <Directory "/usr/local/mmbase/html/">      
          Options Indexes FollowSymLinks    
      </Directory>    
      <Location "/mmbase/WEB-INF/">      
         AllowOverride None      
         deny from all    
      </Location>  
   </IfModule>
</VirtualHost>

#Config for mod_jk :
<IfModule mod_jk.c>  
   AddModule mod_jk.c  
   JkWorkersFile /usr/share/tomcat/conf/workers.properties  
   JkLogFile /usr/share/tomcat/logs/mod_jk.log  
   JKLogLevel info
</IfModule>

5.2 tomcat

Make sure that in the file /usr/share/tomcat/conf/workers.properties the line workers.java_home=/usr/lib/j2sdk1.3 appears, and not a reference to another java version.

The file /etc/tomcat/server.xml needs 2 additions when using virtual hosts. If you are not, you can omit the Host-directive.

...
<!-- Request Interceptor for mmbase-jumpers -->
        <RequestInterceptor            
        className="org.mmbase.servlet.jumpersInterceptor" />
...
<Host name="mmbase.idonotexist.com" >
           <Context path=""                    
           docBase="/usr/local/mmbase/html" />
</Host>

Both /var/lib/tomcat/webapps/ROOT/WEB-INF/web.xml and /etc/tomcat/web.xml have the same content. This must be wrong but it solved a problem at my system and I haven't seen any negative side effects yet. In theory only /var/lib/tomcat/webapps/ROOT/WEB-INF/web.xml should be edited, for that is the application specific configuration. The /etc/tomcat/web.xml is a global tomcat configuration file. If anybody knows what I'm doing wrong, please tell me, so I can update it in the next revision.

<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>
      <context-param>
          <param-name>mmbase.config</param-name>
          <param-value>/usr/local/mmbase/config/default/</param-value>
      </context-param>

      <!-- Performance -->
      <servlet>
      <servlet-name>performance</servlet-name>
      <servlet-class>org.mmbase.servlet.performance</servlet-class>
      <load-on-startup>1</load-on-startup>
      </servlet>

      <!-- servscan -->
      <servlet>
      <servlet-name>servscan</servlet-name>
      <servlet-class>org.mmbase.servlet.servscan</servlet-class>
      <load-on-startup>2</load-on-startup>
      </servlet>

      <!-- servdb -->
      <servlet>
      <servlet-name>servdb</servlet-name>
      <servlet-class>org.mmbase.servlet.servdb</servlet-class>
      <load-on-startup>3</load-on-startup>
      </servlet>

      <servlet-mapping>
      <servlet-name>performance</servlet-name>
      <url-pattern>/performance.html</url-pattern>
      </servlet-mapping>

      <servlet-mapping>
      <servlet-name>servscan</servlet-name>
      <url-pattern>*.shtml</url-pattern>
      </servlet-mapping>

      <servlet-mapping>
      <servlet-name>servdb</servlet-name>
      <url-pattern>/img.db</url-pattern>
      </servlet-mapping>

      <servlet-mapping>
      <servlet-name>servdb</servlet-name>
      <url-pattern>/xml.db</url-pattern>
      </servlet-mapping>

      <servlet-mapping>
      <servlet-name>servdb</servlet-name>
      <url-pattern>/dtd.db</url-pattern>
      </servlet-mapping>

      <taglib>
        <taglib-uri>http://www.mmbase.org/mmbase-taglib-0.8</taglib-uri>
        <taglib-location>/WEB-INF/mmbase-taglib.tld</taglib-location>
      </taglib>

      <!-- add default.jsp and index.shtml to the default index files -->
      <welcome-file-list>
         <welcome-file>default.jsp</welcome-file>
         <welcome-file>index.jsp</welcome-file>
         <welcome-file>index.shtml</welcome-file>
         <welcome-file>index.html</welcome-file>
      </welcome-file-list>
</web-app>      

The debian specific start/stop file was edited to get the CLASSPATH right and to make sure that java 1.3 was used. This too is an ugly hack, and should be addressed somewhere else, but hey! it works :)
Add the following to /etc/init.d/tomcat

  ...
  JDK_DIRS="/usr/lib/jdk1.1 /usr/lib/ibm-java/jdk118 /usr/lib/j2sdk1.3 /usr/lib/j2re1.3"
  CLASSPATH="/usr/lib/j2re1.3/lib/rt.jar:/usr/local/mmbase/lib/mysql.jar:/usr/local/mmbase/build/classes/:/usr/local/mmbase/lib/log4j.jar:$CLASSPATH"
  export CLASSPATH
  ...

5.3 MMBase

Although many things have to be configured on MMbase itself, I have added a few subjects to this mini-HOWTO.

The database access should be set in /usr/local/mmbase/config/default/modules/jdbc.xml :

  <property name="url">     
     jdbc:mysql://localhost/MMBase?user=mmbaseuser&password=secret
  </property>

The builder for images contains a path to convert that is not Debian-compliant. Change /usr/local/mmbase/config/default/builders/images.xml

<properties>
        <property name="ImageConvert.ConverterCommand">bin/convert</property>
        <property name="ImageConvert.ConverterRoot">/usr/</property>
        <property name="ImageConvertClass">org.mmbase.module.builders.ConvertImageMagick</property>
        <property name="MaxConcurrentRequests">3</property>
</properties>


Next Previous Contents