Helma logo
helma.org » Home > docs > howtos > LAMTHA

LAMTHA

A guide for setting up Helma/Antville with Apache, Tomcat and MySQL on Linux systems.

Linux :: Apache :: MySQL :: Tomcat :: Helma :: Antville


Lamtha (the greek letter Λ) is about setting up helma with Tomcat as servletengine. Not so easy but possible :) There is also a lot of stuff about setting up antville.

The following sections are available:

(L) Linux


Every standard Linux Distribution will do the Job. I use Unix conventions for programms and paths. It won't be difficult to use this Tutorial on Windows, because nearly everything is plattform independent (thanx to java).

(A) Setting up Apache


Get the apache httpd from http://httpd.apache.org/ and install it following the install instructions.

Create to directorys in your www directory.
#will proxy every request to port 8080
mkdir antville

#for the static files
mkdir static
Helma must have write privileges on the static directory!

In the main config of apaches commonhttpd.conf add the following lines
RewriteEngine on
RewriteRule   ^/antville(.*)  http://localhost:8080/antville$1 [P,L]
This will proxy every request to our Tomcat/Helma application. If you cant't edit the main config, you can also put this into a .htaccess file.

(M) Setting up MYSQL


Get MySQL from http://www.mysql.com/ and install it following the install instructions.

After installing you should set the root password!

Next step is to set the root password, if you haven't done this before. Believe me this is important.

You will also need the latest jdbc driver for mysql witch you can download from http://www.mysql.com/downloads/api-jdbc-stable.html. Save it somwhere you can remember, we will copy it later to the right place!

We will come back to mysql when we install antville.

(T) Setting up Tomcat and Java


Get the Java SDK from http://java.sun.com/ and install it following the install instructions.

Get Tomcat from http://jakarta.apache.org/tomcat/index.html and install it following the install instructions.

If this is all done and you can start up Tomcat we will continue to install hop as servlet.

Now we create some subdirectorys in the tomcat webapps dir:
#change to tomcat webappsdir
cd your/path/2/tomcat/webapps/

#create subdirectory for our hop/antville installation
mkdir antville

#change dir
cd antville

#create WEB-INF subdir
mkdir WEB-INF

#change dir
cd WEB-INF

#create 2 more subdirs
#first will hold the needed librarys
mkdir lib
Off course you can use your favorit File-Manager to create the needed directorys.

Now in the antville/WEB-INF dir, create a file called web.xml.

sample web.xml file
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
  <servlet>
    <servlet-name>hop</servlet-name>
    <display-name>hop</display-name>
    <description>The base hop servlet</description>

    <servlet-class>helma.servlet.StandaloneServletClient</servlet-class>

    <init-param>
      <param-name>application</param-name>
      <param-value>antville</param-value>
    </init-param>

    <init-param>
      <param-name>appdir</param-name>

      <param-value>/your/path/2/antville</param-value>
    </init-param>

    <init-param>
      <param-name>dbdir</param-name>
      <param-value>/your/path/2/xmldb/helma-1.2.4/db/antville</param-value>
    </init-param>

    <load-on-startup>1</load-on-startup>
  </servlet>

    <servlet-mapping>
      <servlet-name>hop</servlet-name>
      <url-pattern>/*</url-pattern>
    </servlet-mapping>

</web-app>
So Tomcat is configured but helma needs a little help to start as servlet.

(H) Setting up Helma


First of all you will need the helma distribution from http://helma.org/download/. You should use the newest one with the rhino javascript engine.

Unpack everything in one place so your directorystructure looks like this:
helmaDir\
helmaDir\lib
helmaDir\apps
... (and all the other dirs)
The part of recompiling source code is obsolete and has been deleted! If you still need it, try http://hopdev.helma.org/doczone/lamtha/?version=50#H.

(A) Setting up antville


Get antville from http://www.antville.org/ and follow the setup instructions.

In the file app.properties (without s) of the antville distribution set these two variables to absolute paths!
## url of weblog-images
imgUrl = /static/images/
## url of files
fileUrl = /static/files/

## path where uploaded images will be stored ..
imgPath = /your/path/2/apache/httpd/www/static/images/
## path where files will be stored

filePath = /your/path/2/apache/httpd/www/static/files/
This is importent because helma or antville has no directory context!

You also should set the baseURI, the logDir and and the smtp server properties.
baseURI = http://your.ip.or.your.domain/antville

smtp = your.smtp.server

logDir = /your/path/2/writeable/logdir
Don't add a :8080 to the baseURI, because this won't proxy antville throught httpd! Images and files will get loaded much faster with these settings!

As promised back to mysql. Log into mysql as root and insert the antville_mysql.sql from the db_support.zip. This will create all the needed tables and privileges.
mysql -u root -p < antville_mysql.sql

(Λ) Putting it all together



Copy all jar files from the helmaDir/lib directory to the tomcat/webapps/antville/WEB-INF/lib directory, except the servlet.jar. Tomcat comes with the newest version of this jar file. You also should copy the myssql-jdbc.jar file to the WEB-INF/lib dir.

After this long way home and if you set up the directory paths right (web.xml, app.properties, ...) you can fire up tomcat and try the following.

http://localhost/antville

And you shoud get the antville welcome page.(fpm)


Final Note


If you don't want to use apache for proxy, you just have to make some small changes.
baseURI = http://your.ip.or.your.domain:8080/antville

## path where uploaded images will be stored ..
imgPath = /your/path/2/tomcat/webapps/ROOT/static/images/

## path where files will be stored
filePath = /your/path/2/tomcat/webapps/ROOT/static/files/
Thats it :)

Contributed by Philipp Moser, <pm at fpm-edv.at>


Up: Deployment Guides
Previous: Connecting Apache and Helma via mod_jk (AJP13) Next: Configuring Helma with log4j

... comment


Page last modified on 2004-03-21 20:48 by phimos

 
rist, Tuesday, 9. March 2004, 01:36
when using an uptodate version of helma (currently 1.3) no tinkering with helma.jar is required and it should be copied into the lib folder like the other jars (tutorial got updated)

... link  

 
loode, Monday, 3. May 2004, 19:47
mod_rewrite, multi-site-hosting with antville
maybe it should be said, that for the way mod_rewrite is used here(with tomcat), mod_proxy is also needed.

to get antville running like antville.org(with many many vhosts) i suggest u read the following:
http://grazia.helma.at/pipermail/helma-user/2001-October/000791.html

i think its about connecting antville and apache via mod_jk, so i had to change some lines to get it working with my apache-tomcat setup:
change lines with engine/colletta stuff..
RewriteRule ^(.*)\.antville\.org(.*) /engine/coletta/antville/$1$2 [PT]
to something like this:
RewriteRule ^(.*)\.antville\.org(.*) http://yourdomain.tld:8080/antville/$1$2
[P]

and all the [PT] directives to [P]
[PT] didnt work with my tomcat. [P] does

u will need to update your DNS server!
in the zone file for your antville domain add a line like this one: (wildcard)
*.xxxxx.org. IN A your.ip.adr.here

and setting the cookidomain to ".yourdomain.tld" is also a good idea as shown here.(web.xml)
http://grazia.helma.at/pipermail/helma-user/2001-December/000877.html


..helmadir/apps/antville/app.properties should look something like this:
baseURI = /
rootPrototype=site
hrefSkin=href
#hrefFunction=processHref

then add a file "href.skin" to ..helmadir/apps/antville/site and to ..helmadir/apps/antville/root
in dir site write this in href.skin:
http://[Macro this.alias not allowed in sandbox].yourdomaingoesHere.tld[Macro param.path not allowed in sandbox]
and in root href.skin add this line:
http://www.yourdomaingoesHERE.tld[Macro param.path not allowed in sandbox]

link: http://grazia.helma.at/pipermail/antville-dev/2003-August/000138.html


just my 2 eurocents.

... link  


... comment