Skip to content
OpenCms documentation
OpenCms documentation

Websites app

site

The websites app is the place where you can add, remove and configure the websites in your OpenCms installation. You configure, e.g., site name, hostnames and encryption modes.

Furthermore, you configure the access to the workplace server, default site and shared folder.

You can open the websites app from the launchpad:

Open the websites app from the launchpad

The main view of the websites app provides an overview on the existing websites.

The main view of the websites app

There are two global configuration options that you can set via the websites app. Click on the gear wheel () in the toolbar to open the dialog for global settings.

Dialog for the global site configuration

Here you configure the server url and encryption mode for accessing the workplace. You can configure multiple server urls.

As long as there's only one site configured, you can access the workplace via all server urls, independent of the configuration.

If for the server url (hostname + protocol, e.g. https://my-site.de) in the HTTP request getting to OpenCms no specific site is configured, the default site is served.

For a productive environment, we suggest an empty site returning only error pages, since anyone can map a domain to your server to get the default site served.As long as you do not add a security layer infront of OpenCms.

The shared folder is where you place contents shared between various sites. By default it is "/shared/".

You can only select existing folders directly below the root site to prevent misconfigurations.

Via the "Add site" option () in the toolbar, you can add a new site. If you click the option, a dialog appears:

The dialog shown when adding a site

The dialog has several tabs with many settings. Typically, the "Basic setup" options suffice to create a new site from scratch. If you have a site template that you like to copy when creating a new site, the "Create site options are the interesting ones.

Be aware that some inputs will auto-fill or manipulate other fields.

When you click "OK" in the dialog after filling in appropriate values, the following happens:

  • The site folder with some essential resources in is created (if not already present before).
  • The template property is set at the site's root folder.
  • The site is configured in the opencms-sites.xml configuration file (under {webapp home}/WEB-INF/config/)

When you use the "Create site options" to copy an existing site (template) as your new site, the complete site structure will be copied.

Each entry in the list of existing sites has a context menu with options for the site:

Edit the site's configuration. A dialog very similar to the one for adding a new site appears where you can change the site configuration.

Deletes the site. You can choose to only delete the configuration or also the resources.

Opens the explorer in the site.

Opens the page editor for the main page of the site.

OpenCms supports SSL-encrypted sites. The encryption is not done by OpenCms, but dependent on where you encrypt, the configuration option must be set accordingly.

The site is not secured at all it is only served for http:// requests.

The site is served for https:// requests only. This is the correct setting if your servlet container does the SSL encryption. Links to the site (from other sites) are always prefixed with https://.

The site is served for http:// and https:// requests. This is the setting when you do your SSL encryption in a proxy that communicates with the servlet container via http. Links to the site (from other sites) are always prefixed with https://.

Advanced mode where you could mix http and https for various folders of you site.

The mode is deprecated. Nowadays typically the whole site needs to be encrypted anyway. 

The websites app is mainly a tool for manipulating the opencms-sites.xml. If you like to have your site configuration automatically set up. You can adjust the file directly as well.