opencms days 2013 - site management tool

22
Rüdiger Kurz, Alkacon Software WORKSHOP TRACK The OpenCms 9 Site Manager Tool 09.10.2013

Upload: alkacon-software-gmbh

Post on 20-May-2015

1.324 views

Category:

Technology


0 download

DESCRIPTION

Adding new sites or domains to an OpenCms installation used to be a tedious task that required editing the OpenCms XML configuration as well as configuring the webserver to recognize the new site URL. OpenCms 9 features the new site manager tool, which allows Administrators to create new and manage existing sites with a simple GUI based interface. This new tool will automatically update the OpenCms configuration as well as the webserver configuration, without the need to restart OpenCms. In this workshop session, Rüdiger will start with a default OpenCms installation and use the site manager to remove the /opencms/opencms path prefix from the URL. He will then add some new sites and domains to the server configuration. He will also explain how to adopt the standard scripts shipped with the site manager for other webserver configurations.

TRANSCRIPT

Page 1: OpenCms Days 2013 - Site Management Tool

Rüdiger Kurz, Alkacon Software

WORKSHOP TRACK

The OpenCms 9

Site Manager Tool

09.10.2013

Page 2: OpenCms Days 2013 - Site Management Tool

● Managing sites with OpenCms 9

● Multiple Sites in OpenCms (+DEMO)

● Web-Server Configuration (+DEMO)

● What does happen behind the walls

● Virtual Host Template files

● Configure Settings and Defaults

2

Agenda

Page 3: OpenCms Days 2013 - Site Management Tool

Multiple Sites in OpenCms

3

Page 4: OpenCms Days 2013 - Site Management Tool

● One OpenCms installation can be used to

maintain multiple websites

● Every site has its own set of resources and

can be addressed with an URL by the public

● Optional server aliases and a secure server

(https) can be configured for each site

● This information is stored in the OpenCms XML

configuration (opencms-system.xml)

4

Sites in OpenCms

Page 5: OpenCms Days 2013 - Site Management Tool

● To add new or to manage existing sites

administrative server knowledge and

permissions were required

● Edit the OpenCms XML configuration

● Configure the Web-Server’s files manually

● Restart the servlet container

● The simple Site Manager’s UI helps to

decrease the configuration complexity

5

Requirements of former days

Page 6: OpenCms Days 2013 - Site Management Tool

6

Site Management Tool intro

Demo

Demo Demo

Demo

デモ

Page 7: OpenCms Days 2013 - Site Management Tool

7

Web-Server Configuration

Page 8: OpenCms Days 2013 - Site Management Tool

● OpenCms requires a specific Apache

configuration to

● Access a site with a nice web address

● Get rid of /opencms/opencms in the URL

● Serve static resources directly by Apache

● Configure the Web-Server is as well as editing

the OpenCms configuration a painstaking task

● Therefore OpenCms 9 supports generating

Web-Server configurations on-the-fly

8

Integrate Apache in front

Page 9: OpenCms Days 2013 - Site Management Tool

● Prepare Apache Web-Server

● mod_proxy, mod_proxy_http, mod_rewrite and mod_jk

● Include a directory where for the virtual host files

● Create ONE virtual “by hand” for the OpenCms

workplace server

● Prepare Apache Tomcat

● Enable AJP connector and set session cookie path to

“/”, if OpenCms is not running as ROOT

● Prepare OpenCms (opencms-importexport.xml)

and replace the RFS and the VFS prefixes with

9

Environment preparation

<rfs-prefix>/export</rfs-prefix>

<vfs-prefix></vfs-prefix>

Page 10: OpenCms Days 2013 - Site Management Tool

10

Web-Server configuration

Demo

Demo Demo

Demo

デモ

Page 11: OpenCms Days 2013 - Site Management Tool

Configure Settings and Defaults

11

Page 12: OpenCms Days 2013 - Site Management Tool

12

Configure Settings and Defaults

Page 13: OpenCms Days 2013 - Site Management Tool

13

Configure Settings and Defaults

Module parameters: “org.opencms.workplace.tools.sites”

Page 14: OpenCms Days 2013 - Site Management Tool

Virtual Host Template files

14

Page 15: OpenCms Days 2013 - Site Management Tool

15

String Template based generation

<VirtualHost *:80>

DocumentRoot "$DOCUMENT_ROOT$"

ServerName $SERVER_NAME_WITH_PORT$

$ALIAS_DIRECTIVE$ $SERVER_ALIASES$

[...]

</VirtualHost>

● By default the distribution contains an Apache

virtual host “String template” that is working

with OpenCms out of the box …

Page 16: OpenCms Days 2013 - Site Management Tool

16

String Template based generation

$CONFIG_FILENAME$

$LOGGING_DIRECTORY$

$WEBAPP_NAME$

$DOCUMENT_ROOT$

$CONTEXT_PATH$

$SERVLET_PATH$

$DEFAULT_ENCODING$

$SERVER_URL$

$SERVER_NAME_WITH_PORT$

$SERVER_PROTOCOL$

$SERVER_NAME$

$SERVER_ALIASES$

$SECURE_URL$

$SECURE_SERVER_NAME$

$SECURE_SRV_WITH_PORT$

$SECURE_SERVER_PORT$

$SECURE_SERVER_PROTOCOL$

$ALIAS_DIRECTIVE$

$SITE_TITLE$

$ERROR_PAGE$

● Such a template file can contain „macros“, that

will be replaced when executing the „Update

Web-Server“ action

Page 17: OpenCms Days 2013 - Site Management Tool

● Generated configuration files are written to a

specified location on the server's RFS

● As a very last step you can let the servlet

container execute a Shell-Script

17

String Template based generation

cp ~Web-Server.tmp

/etc/apache2/sites-enabled/happy.managers.org

** only added for illustration purposes (something equivalent is done in Java) **

#!/bin/bash

# simple script reloading the apache web server

/etc/init.d/apache2 reload

Page 18: OpenCms Days 2013 - Site Management Tool

● In a default OpenCms installation you'll find the

example files on the server at

<OPENCMS_HOME>/WEB-INF/server-scripts

18

String Template based generation

available-macros.txt (with explanation in it)

script.bat (Restarts the Apache on Windows)

script.sh (reloads /etc/init.d/apache2 on Unix)

vhost.template (for none secure sites)

vhost-secure.template (for secure sites)

worker.conf (example for mod_jk)

worker.properties (ajp13 config)

Page 19: OpenCms Days 2013 - Site Management Tool

Conclusion

19

Page 20: OpenCms Days 2013 - Site Management Tool

● Administrators can now create new sites and

manage existing sites using a simple GUI

● Global settings like the workplace server, the

default URI or the shared folder location can be

selected using the new Admin-Tool

● Automated configuration update by OpenCms

● Generate Web-Server files 100% dynamically

… automatically run a script after generation

… and getting rid of /opencms/opencms/

… without deep knowledge about the Web-Server

● No servlet container restart required anymore

20

Today’s benefits

Page 21: OpenCms Days 2013 - Site Management Tool

21

Any Questions?

Fragen? Questions ?

Questiones?

¿Preguntas? 質問

Page 22: OpenCms Days 2013 - Site Management Tool

Rüdiger Kurz

Alkacon Software GmbH

http://www.alkacon.com

http://www.opencms.org

Thank you very much for your

attention! 22