To make OpenCms work as expected on your server you should follow the hints given on this page.

In particular, we tell how to

  • get rid of the first "/opencms" in the "/opencms/opencms/" part in URLs of OpenCms webpages,
  • configure OpenCms to work with the Apache webserver

We assume you have already installed Tomcat as servlet container.

Deployment

To make OpenCms work properly with Apache, install it as ROOT web application. To do so, rename the opencms.war file to ROOT.war. This is necessary to remove all OpenCms specific path parts (i.e., http://www.example.com/opencms/opencms/index.html) from the visible URLs.

After renaming the war file, deploy it by pasting it into Tomcat's webapps/ folder.

Setup

When OpenCms is deployed, it has to be set up. For a typical local installation, the setup wizard is used. If you can reach this wizard on your webserver, you can use it as well. Therefore, follow the instructions for the local installation and adjust the database configuration accordingly.

The more convienent way will be to use the setup script for setting up OpenCms. You provide a configuration and then run the script. Here you learn about the details.

Configuration

This configuration is only valid if OpenCms has been installed as the ROOT web application in Tomcat.

Edit the file WEB-INF/config/opencms-importexport.xml in your OpenCms installation. Remove the ${SERVLET_NAME} macro, such that the originally containing the macro look as shown below:

<rendersettings>
    <rfs-prefix>${CONTEXT_NAME}/export</rfs-prefix>
    <vfs-prefix>${CONTEXT_NAME}</vfs-prefix>
    ...
</rendersettings>

Now, the site configuration in the file WEB-INF/config/opencms-system.xml have to be adjusted. As configured below, you have a secure site to access the workplace server and an unsecured site for accessing the default site. The configuration corresponds to the Apache webserver configuration described in the documentation.

<sites>
    <workplace-server>https://opencms.example.com</workplace-server>
    <default-uri>/sites/default/</default-uri>
    <site server="http://www.example.com" uri="/sites/default/"/>
    ...
</sites>
If you entered the correct settings using the auto-setup, no adjustment will be necessary (as long as you stay with the one default site).

For each configured sites virtual hosts have to be configured in the Apache web server. Note that you need to configure only one virtual host for secure, and one for unsecure sites. All sites can be added as aliases to that virtual hosts.

The OpenCms workplace should be accessed using a specific URL for the workplace. It is recommended to secure the OpenCms workplace using SSL.