Setup ============= Webspaces --------- The content management part of Sulu is built upon Webspaces. Each of these webspaces configure a content tree, which can be managed in different localizations. For the start you can just copy the delivered file: .. code-block:: bash cp app/Resources/webspaces/sulu.io.xml.dist app/Resources/webspaces/sulu.io.xml Basically you can name the file however you want, as long as it is ending with `.xml`. After copying you should adjust the file according to you installation. Basically you have to change the `key`-tag to a unique value across all webspaces of this installation, the name and the URLs. These values are written in squared brackets in the following example: .. code-block:: xml [name] [key] default example default Hauptnavigation Mainnavigation Footernavigation Footernavigation sulu.io sulu_io tree sulu.us www.sulu.io sulu.lo/{localization} stage.sulu.lo/{localization} sulu.lo/{localization} [url] localhost .. note:: You have to insert the name of your webspace at `[name]`, the key at `[key]`, and the URL of your installation at `[url]`. If you want to run Sulu in different environments you also have to change the URLs in the other environment tags. Sulu needs these URLs in order to match the given requests to a certain portal and webspace. Otherwise it would not be possible to know the content of which webspace should be loaded. Templates --------- All created pages are based on templates, which have also to be configured. So you need some templates to add pages to the system. Therefore, you have to add some XML-files to the specified folder. These files describe the structure of the pages, i.e. what kind of content the pages can consist of. For the start you can just copy some of the delivered files: .. code-block:: bash cp app/Resources/pages/default.xml.dist app/Resources/pages/default.xml cp app/Resources/pages/overview.xml.dist app/Resources/pages/overview.xml cp app/Resources/snippets/default.xml.dist app/Resources/snippets/default.xml With this configuration you will be able to create default pages, just containg the most basic content types (a title, an URL, links to other pages, images, and a text editor), and overview pages, which can aggregate multiple pages. Complete the installation ------------------------- After the installation you have to clear the caches, add some empty folders and set the appropriate permissions to the cache folders: Use the following commands for Linux: .. code-block:: bash rm -rf app/cache/* rm -rf app/logs/* mkdir app/data sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs uploads/media web/uploads/media app/data sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs uploads/media web/uploads/media app/data Or these commands for Mac OSX: .. code-block:: bash rm -rf app/cache/* rm -rf app/logs/* mkdir app/data APACHEUSER=`ps aux | grep -E '[a]pache|[h]ttpd' | grep -v root | head -1 | cut -d\ -f1` sudo chmod +a "$APACHEUSER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs uploads/media web/uploads/media app/data sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs uploads/media web/uploads/media app/data Or these commands for Windows (with IIS web server): .. code-block:: powershell rd app\cache\* -Recurse -Force rd app\logs\* -Recurse -Force md app\data $rule = New-Object System.Security.AccessControl.FileSystemAccessRule -ArgumentList @("IUSR","FullControl","ObjectInherit, ContainerInherit","None","Allow") $folders = "app\cache", "app\logs", "app\data", "uploads\media", "web\uploads\media" foreach ($f in $folders) { $acl = Get-Acl $f; $acl.SetAccessRule($rule); Set-Acl $f $acl; } Thanks to the `MassiveBuildBundle`_ we can complete the installation with another single command, which executes some build targets. These targets cover the initialization of the database and PHPCR (based on the previously created configuration files) and loads the fixtures: .. code-block:: bash app/console sulu:build prod If you want to also create a user with the credentials admin/admin you can also execute the following command: .. code-block:: bash app/console sulu:build dev .. note:: If you omit the build target as the last parameter you will see a list of all available build targets. .. warning:: The name of the build targets should not be confused with the symfony environments, although they are most likely to be executed in the ones named after them. Create a new user ----------------- In order to login into Sulu you need to create a user. Before you can do that you have to create the administrator role. You can easily add this role with the following command: .. code-block:: bash $ app/console sulu:security:role:create Name the role and choose `Sulu` as the system. Afterwards you just have to enter the following command on the command line, which will guide you through the creation in an interactive manner: .. code-block:: bash $ app/console sulu:security:user:create Just follow the instructions. Afterwards you'll be able to login into the Sulu Backend, which is accessible by on one of your configured URLs on the site `/admin`. .. _`MassiveBuildBundle`: https://github.com/massiveart/MassiveBuildBundle