|
MMBase on Mac OS X with Tomcat and MySQL
MMBase is an open
source Content Management System that's becoming very popular in the
Netherlands.
In this document i describe how i installed MMBase on Mac OS X 10.1 with MySQL as
a database and Apache
Tomcat as webserver and Java servlet container.
- Install Tomcat
At developers.apple.com is good installation
help and tutorial. You could also use Orion,
a lot of directory names would be different but the installation is basically
the same as this one. I installed 'jakarta-tomcat-4.0.3' in my home directory
in Applications, so it is in '/Users/user_name/Applications/jakarta-tomcat-4.0.3'.
Normally you would install software like this in '/usr/local' but I found
this more convenient while developing: you have to access the logs and webapps
directory very often.
Start Tomcat and convince yourself that the examples are working by accessing http://localhost:8080/examples (with
a default installation).
- Install MySQL, if you want to run MMBase
on top of MySQL. Make sure that you can enter MySQL. Create a table
'mmbase' and a user 'mmbase' that has privileges on this table, those
are the examples i will use here.
Get the MySQL JDBC driver 'mm.mysql-2.0.4-bin.jar', you can find it at http://www.mysql.com/downloads/api-jdbc.html.
You should put it in the directory 'jakarta-tomcat-4.0.3/lib' when you want
to use the driver with other applications as well, otherwise it could live
in 'jakarta-tomcat-4.0.3/webapps/name_of_webapp/WEB-INF/lib'.
- Next thing to get is ImageMagick.
ImageMagick is a great open source image manipulation tool that is
being used by MMBase to display images in various ways and sizes. You
could also use the Java Advanced Imaging API (JAI) but that is not
so powerful.
Marc Liyanage created an easy Mac
OS X package for ImageMagick, it installs ImageMagick in '/usr/local'
right where the MMBase image builder expects it normally.
- Finally: download the latest MMBase binary distribution at http://www.mmbase.org/mmbasenew/index.shtml?download.
I installed the MMBase 1.5.1 (beta) binary release. It is also possible to
install MMBase from CVS or a (still experimental) WAR file, but i will
concentrate here on the 'official' release.
Expand the zip-file and put it's contents in 'jakarta-tomcat-4.03/webapps/ROOT'.
You should have the following directory structure:
[localhost:jakarta-tomcat-4.0.3/webapps/ROOT] andre% ls -lF
total 16
drwxr-xr-x 7 andre staff 194 Jun 24 08:54 WEB-INF/
-rw-r--r-- 1 andre staff 393 Jun 22 00:51 index.html
-rw-r--r-- 1 andre staff 254 Jun 22 00:51 index.jsp
drwxr-xr-x 52 andre staff 1724 Jun 24 08:54 mmadmin/
drwxr-xr-x 3 andre staff 264 Jun 24 08:54 mmapps/
drwxr-xr-x 11 andre staff 330 Jun 24 08:54 mmdocs/
drwxr-xr-x 28 andre staff 908 Jun 24 08:54 mmeditors/
drwxr-xr-x 6 andre staff 264 Jun 24 08:54 mmexamples/
drwxr-xr-x 17 andre staff 534 Jun 24 17:24 my_project/
Now that everything is were it should be we can start the configuration of
MMBase. You will find all the configuration files of MMBase in 'jakarta-tomcat-4.0.3/webapps/ROOT/WEB-INF/config'.
- Open 'modules/mmbaseroot.xml' and change the property 'database'
to 'mysql'. It should read
<property name="database">mysql</property>
Other optional settings: change language to for example <property name="language">nl</property>
- Open 'modules/jdbc.xml' and set url to
<property name="url">jdbc:mysql://$HOST:$PORT/$DBM?user=mmbase&password=</property>
<property name="user">mmbase</property>
<property name="password"></property>
<property name="database">mmbase</property>
<property name="driver">org.gjt.mm.mysql.Driver</property>
<property name="port">3306</property>
<property name="host">localhost</property>
- Check if 'builders/images.xml' is set to
<!-- convert using ImageMagick -->
<property name="ImageConvertClass">org.mmbase.module.builders.ConvertImageMagick</property>
<property name="ImageConvert.ConverterCommand">bin/convert</property>
<property name="ImageConvert.ConverterRoot">/usr/local/</property>
- Restart Tomcat and watch MMBase progress through Tomcat's log file
'jakarta-tomcat-4.0.3/logs/catalina.out'. Check http://localhost:8080 you
will be redirected to the MMBase admin pages. You will find the MMBase
editors at http://localhost:8080/mmeditors/jsp/search_node.jsp
- You can change MMBase's logging settings in 'jakarta-tomcat-4.0.3/webapps/ROOT/WEB-INF/config/log/log4j.mxl'.
Copy the first example in this directory and set it to:
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd" [ <!ENTITY logger "org.mmbase.util.logging.log4j.Log4jImpl" > <!ENTITY priority "org.mmbase.util.logging.log4j.Log4jPriority" > <!ENTITY logdir "/Users/user_name/Applications/jakarta-tomcat-4.0.3/logs/" >
|
|