Segfault > IT > Webserver > OpenCMS

If you're using the gentoo distribution make sure to follow these instructions to set up Firefox with Java support - this will be needed e.g. when you'll try to upload a file (the browser will try to display a java applet).
Be as well aware that for OpenCMS version 7.0.5 file upload is broken (read this) when doing that from localhost. If you're affected you will see the error message "Error creating Zip-File, see Java Console" when trying to do so - the workaround is not to connect from localhost.

Ok, first of all you will need on your server tomcat. Therefore emerge tomcat.

Once the installation has finished, start it up with /etc/init.d/tomcat-6 start. By accessing http://localhost:8080/ you should see Tomcat's homepage.

In order to be able to access the "Status" and "Tomcat manager" links on the left side you will need to add credentials to Tomcat's configuration, in the case of Gentoo located under /etc/tomcat-6/tomcat-users.xml. Example:

  1. <?xml version='1.0' encoding='utf-8'?>
  2. <tomcat-users>
  3. <role rolename="manager"/>
  4. <role rolename="admin"/>
  5. <user username="tomcat" password="tomcatpwd" roles="admin,manager"/>
  6. </tomcat-users>

You might have to restart Tomcat once you set the usernames and passwords.

Check as well the file permission and eventually do a chmod o-rwx * in /etc/tomcat-6/ (all files and dir should be owned by the user tomcat.). After that check that you can access the "Tomcat Manager" on the left.

Now download OpenCMS - in my case I downloaded the binary distribution (from
Unpack it and you should see a .war file in it.

Go in the browser to the Tomcat Manager and in the secion WAR file to deploy search for the ".war" file you just uncompressed and click on Deploy.
After the operation completes you should see in the Tomcat Manager in the "Applications" section a new line stating "OpenCMS".

You should now be able to access the setup of OpenCMS with http://localhost:8080/opencms/setup - do this quick check to see if you're still on track.

If that went well the next step is to install MySQL if you don't have it running yet.
The only thing to be changed for OpenCMS is in the config file (/etc/mysql/my.cnf) the variable "max_allowed_packet" to be set to "32M" instead of the default "1M".

In MySQL create a user for OpenCMS and assign him the needed privileges (in my example the OpenCMS DB will be called "opencms"):

  1. mysql -u root -p
  2. create user <youruser>@localhost identified by '<yourpassword>';
  3. grant select,delete,insert,update on opencms.* to <youruser>;
  4. grant create on opencms.* to <youruser>;
  5. grant drop on opencms.* to <youruser>;

Once you're done with that you can go on with the web-setup of OpenCMS.

In the web-setup, after the license agreement, check that all the checks have turned up green.
If that's the case insert into the next screen the informations concerning the DB. Everything should turn up green.
Go on and at the end OpenCMS will perform the installation generate all the index files - this could last a while.

If you completed the installation successfully you will see a new window popping up showing you the URL of the installation (in my case http://localhost:8080/opencms/opencms/system/login/). You should be able to login using Admin/admin.

At this point you can read this if you wish to use OpenCMS/Tomcat through Apache.