This commit is contained in:
gferg 2002-05-29 15:09:37 +00:00
parent d9fc30fed5
commit 5464279308
3 changed files with 83 additions and 190 deletions

View File

@ -473,7 +473,7 @@ MMBase</ULink>, <CiteTitle>
MMBase Mini-HOWTO: Installation on Debian Woody</CiteTitle>
</Para><Para>
<CiteTitle>
Updated: October 2001</CiteTitle>.
Updated: May 2002</CiteTitle>.
Describes how to set up MMBase on a Debian GNU/Linux (Woody) system. </Para>
</ListItem>

View File

@ -926,7 +926,7 @@ MMBase</ULink>, <CiteTitle>
MMBase Mini-HOWTO: Installation on Debian Woody</CiteTitle>
</Para><Para>
<CiteTitle>
Updated: October 2001</CiteTitle>.
Updated: May 2002</CiteTitle>.
Describes how to set up MMBase on a Debian GNU/Linux (Woody) system. </Para>
</ListItem>

View File

@ -4,7 +4,7 @@
<title>MMBase Mini-HOWTO: Installation on Debian Woody
<author>Casper Joost Eyckelhof <tt/&lt;joost@dnd.utwente.nl>/ <newline>University of Twente
<date>v0.1, 01 October 2001
<date>v0.2, 28 May 2002
<abstract>
This document briefly describes how to set up MMBase on a Debian Gnu/Linux (Woody) system
@ -34,13 +34,18 @@ All copyrights are held by their respective owners, unless specifically noted ot
Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark.<p>
Finally, this is my first HOWTO, my first experience with linuxdoc and I am no expert on
MMbase either. I am just trying to share my solutions to some problems I encountered while installing
MMBase either. I am just trying to share my solutions to some problems I encountered while installing
MMBase on a Debian system.<p>
<sect1>History<p>
0.2 Updated for MMbase 1.5; lost support for apache frontend<p>
0.1 Initial version - Installing MMBase 1.4 on Woody<p>
<sect1>Copyright<p>
Copyright (c) 2001 Casper Joost Eyckelhof, All rights reserved. This is free
Copyright (c) 2001-2002 Casper Joost Eyckelhof, All rights reserved. This is free
documentware; you can redistribute it and/or modify it under the terms of
version 2 or later of the <url name="GNU General Public License"
url="http://www.gnu.org/copyleft/gpl.html">.<p>
@ -68,16 +73,15 @@ After a few days of playing with my own install, I think I can help others by de
which choices I made to get things running. I do not claim this is the only way, or the best way!
But it worked for me :)<p>
The version of MMBase used is 1.4. Ofcourse everything might be different with another version.<p>
The version of MMBase used is 1.5. Ofcourse everything might be different with another version.<p>
MMbase can run together with various webservers, databases, servlet engines and JRE's.
The programs/packages/versions I chose are:<p>
<itemize>
<item>Apache (1.3.19)
<item>MySQL (3.23)
<item>Tomcat (3.2.3)
<item>Java (1.3)
<item>mod-jk (3.2.3)
<item>MySQL-Server (3.23.49-8)
<item>Tomcat4 (4.0.3-3)
<item>j2sdk1.3 (1.3.1-1) (Java)
<item>imagemagick (4:5.4.4.5-1)
</itemize><p>
Attention: The version numbers are those that were available in
@ -85,6 +89,10 @@ the Woody distribution at the time of writing. Except for Java, which
came from a different location. See <ref id="java" name="Non standard package(s)">.
<p>
Some other options for databases and webservers are described in the
installation notes for MMBase 1.5
<p>
<sect>Prerequisites<p>
You will need a working Debian Woody installation, including apt, and make sure
@ -92,10 +100,8 @@ the following packages are installed and working correctly.
<sect1>Standard packages<p>
<itemize>
<item>apache
<item>tomcat
<item>tomcat4
<item>mysql-server
<item>libapache-mod-jk
<item>imagemagick
</itemize><p>
@ -105,7 +111,8 @@ If these packages are not installed, you can do so by typing
</verb></tscreen>
where packagename is one of the above.<p>
Note: naturally you will need al dependencies too, but apt will take automatically care of that.
Note: naturally you will need al dependencies too, but apt will take care of that
automatically.
<sect1>Non standard package(s)<label id="java"><p>
While writing this document, Woody only contains java 1.1, but for MMBase
@ -132,29 +139,31 @@ Now that you have all supporting packages up and running (you <em>did</em>
follow the instructions in the previous section, didn't you?) get yourself a copy of MMBase.
As said before, this document describes the works for MMbase version 1.4.<p>
Download MMBase from <url name="http://www.mmbase.org/releases/MMBase-1.4.zip"
url="http://www.mmbase.org/releases/MMBase-1.4.zip"> with a browser, or even easier:
Download MMBase from <url name="http://www.mmbase.org/releases/mmbase-1.5.zip"
url="http://www.mmbase.org/releases/mmbase-1.5.zip"> with a browser, or even easier:
<tscreen><verb>
wget http://www.mmbase.org/releases/MMBase-1.4.zip
wget http://www.mmbase.org/releases/mmbase-1.5.zip
</verb></tscreen><p>
In this document I will assume that MMbase will be unpacked in /usr/local/mmbase/ so do something like this
<tscreen><verb>
mkdir /usr/local/mmbase
unzip MMBase-1.4.zip -d /usr/local/mmbase
</verb></tscreen><p>
From version 1.5 MMBase can be used as an webapp within Tomcat. So I
recommend unpacking the distribution in a temporary directory and copying
the mmbase-webapp/ tree to /var/lib/tomcat4/webapps/.
If MMBase is your only (or main) application on Tomcat, you can also install
it as ROOT, by copying everything from mmbase-webapp/ to /var/lib/tomcat4/webapps/ROOT/.
In this document I will assume that MMBase is unpacked in
/var/lib/tomcat4/webapps/mmbase-webapp/<p>
<sect1>Getting mm.mysql<p>
You will also need mysql.jar (JDBC driver for MySQL) which can be downloaded from
<url name="http://mmmysql.sourceforge.net/" url="http://mmmysql.sourceforge.net/">. <newline>
Put the file in your /usr/local/mmbase/lib/ directory and create a symbolic link to mysql.jar.<p>
Make sure you get the binary jar, which means you may have to unjar the
complete distribution first and locate the file mm.mysql-2.0.14-bin.jar
(2.0.14 was the latest release when writing this HOWTO)
Put the file in /var/lib/tomcat4/webapps/mmbase-webapp/WEB-INF/lib/.<p>
<tscreen><verb>
cd /usr/local/mmbase/lib
wget http://mmmysql.sourceforge.net/dist/mm.mysql-2.0.2-bin.jar
ln -s mm.mysql-2.0.2-bin.jar mysql.jar
</verb></tscreen><p>
<sect1>Creating a database for MMBase<p>
MMbase needs a database and a user that has full rights on that database.
@ -172,14 +181,18 @@ GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON MMBase.* TO mmbaseuser@realhost
flush privileges;
</verb></tscreen><p>
<sect1>Setting MMBase as tomcat ROOT<p>
This probably isn't the cleanest way to do it, but we need to let tomcat know about MMBase, which I did by
making a symbolic link from /var/lib/tomcat/webapps/ROOT to /usr/local/mmbase/html.
<tscreen><verb>
localhost# ls -la /var/lib/tomcat/webapps/ROOT
lrwxrwxrwx 1 root root 22 Sep 24 12:01 /var/lib/tomcat/webapps/ROOT -> /usr/local/mmbase/html
</verb></tscreen><p>
<sect1>Tomcat security manager<p>
The Tomcat java security manager somehow interferes with MMBase. I haven't
found out what settings are needed to run MMBase with the security manager
active. Please let me know. For now I disabled the security manager, which
you should never not do. (Big Disclaimer!)
In /etc/default/tomcat4 change the security line to:<newline>
TOMCAT4_SECURITY="no"
<sect1>Copying xml-apis<p>
For some odd reason, Tomcat wants to find the file WEB-INF/lib/xml-apis.jar also in
/usr/share/tomcat/common/lib/xml-apis.jar, so you have to copy it.<p>
<sect>Configuration files<p>
There are various configuration files that need some adjustment or have to be created.
@ -188,167 +201,49 @@ There are various configuration files that need some adjustment or have to be cr
In my setup, I created a virtual host to handle all MMBase request, but using a few <em>Alias</em> directors
it cannot be too hard to include MMBase somewhere in your normal web tree.<p>
<tscreen><verb>
...
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
&etago;Directory>
<Location "/mmbase/WEB-INF/">
AllowOverride None
deny from all
&etago;Location>
&etago;IfModule>
&etago;VirtualHost>
That was for my last setup (HOWTO version 0.1 covering MMBase 1.4).
#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
&etago;IfModule>
</verb></tscreen><p>
Using the newest version of Tomcat and Apache, I have troubles getting the
two working together. As soon as I find out how to use libapache-mod-webapp
or libapache-mod-jk with tomcat4, I will update this HOWTO.<p>
<sect1>tomcat<p>
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.<p>
The file /etc/tomcat/server.xml needs 2 additions when using virtual hosts. If you are not,
you can omit the Host-directive.<p>
<tscreen><verb>
...
&lt;!-- Request Interceptor for mmbase-jumpers -->
<RequestInterceptor
className="org.mmbase.servlet.jumpersInterceptor" />
...
<Host name="mmbase.idonotexist.com" >
<Context path=""
docBase="/usr/local/mmbase/html" />
&etago;Host>
</verb></tscreen><p>
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.<p>
<tscreen><verb>
&lt;?xml version="1.0"?>
&lt;!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&etago;param-name>
<param-value>/usr/local/mmbase/config/default/&etago;param-value>
&etago;context-param>
<!-- Performance -->
<servlet>
<servlet-name>performance&etago;servlet-name>
<servlet-class>org.mmbase.servlet.performance&etago;servlet-class>
<load-on-startup>1&etago;load-on-startup>
&etago;servlet>
<!-- servscan -->
<servlet>
<servlet-name>servscan&etago;servlet-name>
<servlet-class>org.mmbase.servlet.servscan&etago;servlet-class>
<load-on-startup>2&etago;load-on-startup>
&etago;servlet>
<!-- servdb -->
<servlet>
<servlet-name>servdb&etago;servlet-name>
<servlet-class>org.mmbase.servlet.servdb&etago;servlet-class>
<load-on-startup>3&etago;load-on-startup>
&etago;servlet>
<servlet-mapping>
<servlet-name>performance&etago;servlet-name>
<url-pattern>/performance.html&etago;url-pattern>
&etago;servlet-mapping>
<servlet-mapping>
<servlet-name>servscan&etago;servlet-name>
<url-pattern>*.shtml&etago;url-pattern>
&etago;servlet-mapping>
<servlet-mapping>
<servlet-name>servdb&etago;servlet-name>
<url-pattern>/img.db&etago;url-pattern>
&etago;servlet-mapping>
<servlet-mapping>
<servlet-name>servdb&etago;servlet-name>
<url-pattern>/xml.db&etago;url-pattern>
&etago;servlet-mapping>
<servlet-mapping>
<servlet-name>servdb&etago;servlet-name>
<url-pattern>/dtd.db&etago;url-pattern>
&etago;servlet-mapping>
<taglib>
<taglib-uri>http://www.mmbase.org/mmbase-taglib-0.8&etago;taglib-uri>
<taglib-location>/WEB-INF/mmbase-taglib.tld&etago;taglib-location>
&etago;taglib>
<!-- add default.jsp and index.shtml to the default index files -->
<welcome-file-list>
<welcome-file>default.jsp&etago;welcome-file>
<welcome-file>index.jsp&etago;welcome-file>
<welcome-file>index.shtml&etago;welcome-file>
<welcome-file>index.html&etago;welcome-file>
&etago;welcome-file-list>
&etago;web-app>
</verb></tscreen><p>
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 :)<newline>
Add the following to /etc/init.d/tomcat<p>
<tscreen><verb>
...
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
...
</verb></tscreen><p>
One posible solution is compiling mod-webapp yourself, because the version
that comes with Debian seems to be non-standard. This is beyond the scope and intention of this
HOWTO.<p>
This also means that by default MMBase will run on port 8180 (directly from
the stand-alone Tomcat server. You can change this port in
/etc/tomcat4/server.xml
<sect1>MMBase<p>
Although many things have to be configured on MMbase itself, I have added a few subjects to this mini-HOWTO.<p>
The database access should be set in /usr/local/mmbase/config/default/modules/jdbc.xml :<p>
Although many things have to be configured on MMBase itself, I have added a few subjects to this mini-HOWTO.<p>
The database access should be set in WEB-INF/config/modules/jdbc.xml :<p>
<tscreen><verb>
<property name="url">
jdbc:mysql://localhost/MMBase?user=mmbaseuser&amp;password=secret
&etago;property>
<property name="url">jdbc:mysql://$HOST:$PORT/$DBM?user=mmbaseuser&amp;password=secret&etago;/property>
<property name="user">url&etago;/property>
<property name="password">url&etago;/property>
<property name="database">MMBase&etago;/property>
<property name="driver">org.gjt.mm.mysql.Driver&etago;/property>
</verb></tscreen><p>
The builder for images contains a path to convert that is not Debian-compliant. Change
/usr/local/mmbase/config/default/builders/images.xml
And one more line to change to get the mysql connection working. In WEB-INF/config/modules/mmbaseroot.xml
make sure you have this setting:
<tscreen><verb>
<properties>
<property name="ImageConvert.ConverterCommand">bin/convert&etago;property>
<property name="ImageConvert.ConverterRoot">/usr/&etago;property>
<property name="ImageConvertClass">org.mmbase.module.builders.ConvertImageMagick&etago;property>
<property name="MaxConcurrentRequests">3&etago;property>
&etago;properties>
<property name="database">mysql&etago;/property>
</verb></tscreen><p>
The builder for images contains a path to convert that is not Debian-compliant. Change
WEB-INF/config/builders/images.xml
<tscreen><verb>
<properties>
<property name="ImageConvert.ConverterCommand">bin/convert&etago;property>
<property name="ImageConvert.ConverterRoot">/usr/&etago;property>
<property name="ImageConvertClass">org.mmbase.module.builders.ConvertImageMagick&etago;property>
&etago;properties>
</verb></tscreen><p>
@ -357,8 +252,7 @@ There are various sources for more help on most of the subject covered in this m
their own documentation. Some links that really helped me are:<p>
<itemize>
<item>Apache: <url name="http://httpd.apache.org/docs/" url="http://httpd.apache.org/docs/">
<item>mod_jk: <url name="http://jakarta.apache.org/tomcat/tomcat-3.2-doc/mod_jk-howto.html" url="http://jakarta.apache.org/tomcat/tomcat-3.2-doc/mod_jk-howto.html">
<item>Tomcat: <url name="http://jakarta.apache.org/tomcat/tomcat-3.2-doc/uguide/tomcat_ug.html" url="http://jakarta.apache.org/tomcat/tomcat-3.2-doc/uguide/tomcat_ug.html">
<item>Tomcat: <url name="http://jakarta.apache.org/tomcat/tomcat-4.0-doc/index.html" url="http://jakarta.apache.org/tomcat/tomcat-4.0-doc/index.html">
<item>MMBase: Click on Documentation on <url name="http://www.mmbase.org/" url="http://www.mmbase.org/">
<item>Java: <url name="http://java.sun.com/" url="http://java.sun.com/">
</itemize><p>
@ -366,4 +260,3 @@ their own documentation. Some links that really helped me are:<p>
Another great source for help is channel #mmbase on ircnet, usually there are some developers there.
</article>