Quick Guide to OpenCMS


Like Zope, OpenCMS is another open-source Content Management System to handle the contents of a web site. It is based on Tomcat, Apache's server-based Java module, and MySQL as its database. Although it doesn't come with a WYSIWYG dedicated client either, unlike Zope, OpenCMS allows users to edit files through Internet Explorer's DHTML ActiveX edit tool, which is a step in the right direction. This, however, restricts your users to Internet Explorer 5.x and above. Here's what the admin screen looks like.


You'll need to download and install the different packages below in the the following order, preferably checking that each step is completed successfully before moving on to the next. Note that Tomcat comes with its own web server, but it's also possible to use Tomcat as a module for Apache. My experience shows that you should not download the latest JDK and Tomcat because they're not necessarily the greatest: I got core dumps, and exceptions in log files. A working combination is JDK 1.3.1-02  and Tomcat 4.0.

  1. Java SDK from Sun's or IBM's site. I used the Java2 SDK (JDK) 1.3.1 "RPM package" for Linux, which is actually a script ending in .bin that you must run to extract an actual RPM. Once that is done, install it through the usual "rpm -Uvh" command, and create a JAVA_HOME variable to point to /usr/java/j2sdk1.3.1 where this RPM package installs files.
  2. Tomcat: I used release 4 of Tomcat, as recommended on OpenCMS's site. Unpack the binary tarball somewhere, and set an environment variable CATALINA_HOME to point to that directory. Also set CATALINA_OPTS=-Dfile.encoding=ISO8859_1 to make sure Tomcat uses the right charset.
  3. Launch Tomcat through $CATALINA_HOME/bin/startup.sh, wait a few seconds for Java and Tomcat to start, and and aim your browser at http://mylinux:8080 (where mylinux is where Tomcat is installed.)

    If everything works, you should be welcomed with a "If you're seeing this page via a web browser, it means you've setup Tomcat successfully." If you cannot connect, run "netstat -tuplan | grep 8080" to check if Tomcat is listening on that port, and take a look at the file(s) in $CATALINA_HOME/logs/ .

    Note: As explained in the welcome page, the default page is $CATALINA_HOME/webapps/ROOT/index.html. To shutdown Tomcat, run $CATALINA_HOME/bin/shutdown.sh . Also, and contrary to what is explained in RUNNING.txt, it is NOT recommended to use a package from the nightly build. Those are highly unstable, so you should use a release version instead. 
  4. MySQL:
    1. Server
    2. Client

    Important: On production servers, remember to set a password for MySQL's root password through /usr/bin/mysqladmin -u root -p password 'new-password', and change OpenCMS's default password "admin" for the Admin account.

  5. Extract the opencms.war file from the OpenCMS tarball (I used opencms_4.4.6_major.zip), and copy this file into $CATALINA_HOME/webapps/. Start or restart Tomcat so that this new application is available.
  6. Make sure the MySQL server process is running (ps aux | grep -i sql)
  7. Aim your browser at http://mylinux:8080/opencms/ocsetup . If you are running Tomcat and MySQL on the same host, default options are fine.
  8. Once you're through with the wizard, you will be redirected to http://mylinux:8080/opencms/opencms/system/workplace/action/login.html. Log on as Admin/admin .
  9. Download the shareware version of the LeEdit OCX control as source code editor. Unzip the ledit211.zip package, and go to the leocx/ sub-directory where you can run setup32.exe
  10. Customize Internet Explorer:
    1. Make sure it accepts cookies
    2. Select Tools | Internet Options, and click on the "Security" tab. Select the "Trusted sites" icon, and click on "Sites...". Uncheck "Require server verification (https:) for all sites in this zone", type the URL of the server where OpenCMS is running (eg. http://mylinux.acme.com:8080), and click on Add...
    3. Back in the main Security tab, with "Trusted sites" still selected, click on "Custom level...", and select Enable for all items in the ActiveX section. It is safe to use ActiveX controls with these settings since their use is allowed only for the "Trusted sites", and ActiveX remains disabled for all other web sites.
  11. Go have a beer or fun with your girlfriend, in no particular order.


After installing opencms.war and starting Tomcat, Java/Tomcat just shuts down and I can't connect

Use release versions of Tomcat instead of nightly builds...  

In the OpenCMS setup wizard, I left the default settings, but OpenCMS fails creating its tables in MySQL

Resource broker = mysql, Database Server Connection = root (no password), OpenCms Connection = root (no password), Connection String = jdbc:mysql://localhost:3306/, Database = opencms

Creating database ... Failed Creating database ("java.sql.SQLException: Server configuration denies access to data source")

Make sure that

  1. you set a fully-qualified hostname to the host where OpenCMS is running (eg. mylinux.acme.com)
  2. the host is allowed to connect to the MySQL server (eg. To create a user: grant all privileges on *.* to root@localhost)
  3. in the "jdbc:mysql://localhost:3306/" string above, change localhost to the host's fully-qualified hostname, eg. mylinux.acme.com, and hit http://mylinux:8080/opencms/ocsetup again.

Is it possible to let road warriors work on a web site with no Internet access?

(From Massimiliano Alessandri)
Support for disconnected mode on your home computer can be achieved in the following way:
1) Install the whole platform on your home computer
2) Use the export function to produce a zip file containing the entire site on the server.
3) Download it and bring it to your home computer.
4) Use the import function to load it into the development system.
5) After finishing working, use the export function on your development system to pack your work into a zip file (you may also choose to export only modified files)
6) Use the import function on the production system.
Steps 2-6 will be repeated ciclically.

Your sales people will have access to the platform installed on their notebooks, so they will be able to browse your knowledge databases as if they had Internet access.
(From Jean-Guillaume Birot)
Or use the static export function to make a local copy of the web site.

Needless to say, deploying JDK + Tomcat + Mysql + OpenCMS on all laptops is quite a lot of work, and this scheme above doesn't deal with the issue of handling concurrent changes if more than one person has made changes to a site while in disconnected mode...