In this step we set up Magnolia until to the point where the Magnolia instance:
- Provides content apps with bootstrapped content.
- Is ready to deliver
json
from these content apps which can be consumed via JavaScript on the client site.
Installation
Installing the base: - magnolia-community-demo-bundle
We will start by installing a typical Magnolia bundle that includes a Tomcat server. Download the bundle and install Magnolia.
Do not start the Tomcat server yet, we will add some additional modules and change a Magnolia property first.
Adding additional modules
During the workshop we will need the following modules. These modules are not included in the webapp bundle we just downloaded, so we must add them now.
magnolia-rest-tools-2.2.5-bundle.zip You must unzip and drop all the files from the resulting folder to the WEB-INF/lib folder(s) | The magnolia-rest-tools module is not required on a productive system but is very useful during development. | |
This Magnolia Maven module contains two content apps and also provides bootstrapped content. | ||
Optional | ||
Download the files and add them into the $<your-magnolia-installation>/apache-tomcat-x.y/webapps/magnoliaAuthor/WEB-INF/lib
folder.
Setting the magnolia.resources.dir
property
During the workshop we will create some lightmodules, they should reside within the directory which is set with the Magnolia property
magnolia.resources.dir
.
You can use the default value which points to $<your-magnolia-installation>/apache-tomcat-x.y/webapps/<context>
(where context is magnoliaAuthor or magnoliaPublic). However, it is better to change this value to point to another location such as:
- Mac OS X
/Users/johndoe/dev/lightmodules
- Windows
C:\Users\johndoe\dev\lightmodules
Starting Tomcat
Now we can start the Tomcat server. Note that the first time you start the Magnolia instance it installs a number of things itself.
Go to the magnolia-x.y/apache-tomcat-x.y/bin
directory and type:
./magnolia_control.sh start
Note: In case you get an error due to a low "max open files" limit, you may try executing the command with
the --ignore-open-files-limit
option:
./magnolia_control.sh start --ignore-open-files-limit
Detailed instructions:
If the "too many open files" error appears, use the following command to start the Tomcat server:
./magnolia_control.sh start --ignore-open-files-limit |
Configuring REST
Set apiBasePath for magnolia-rest-tools
When using magnolia-rest-tools
, we have to set the apiBasepath
. The default value is most likely not correct for your Magnolia instance.
Grant permissions for the custom content app
The Camera-collection module bootstraps the camera-rest role.
Open the Security app, go to Roles and look at the camera-rest role.
Add the role:
- to superuser in the author context.
- to anonymous in the public context.