Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Installation & Hosting

Changing Location of Page/Media Content

Solved by Chris Cagle View solution

Started by Chris Cagle 7 years ago · 2 replies · 711 views
7 years ago

I am trying to install grav to an AWS Elastic Beanstalk environment (which are ephemeral). I have already attached an EFS store to the environment on mount /efs, but I am a bit confused how to redirect all the media & pages data to be served from a folder on that mount instead (i.e. /efs/grav/pages).

I found on another forum post that this can be done in Streams and setup.php, however there is precious little info on those.

The end result I'd like to have is that the theme, plugins & grav core get installed via git, then the UI (and admin) reads and saves all its content from /efs/grav/pages instead of the default location now, which is /var/app/current/grav/pages.

Any help anyone can provide would be very much appreciated!!

7 years ago

I thought I was able to get it working, but this setup.php is giving me a create folder error from grav.

JS
/**
 * Multisite setup for subsites accessible via sub-domains.
 */

use Grav\Common\Utils;

// Get subsite name from sub-domain
$environment = 'production';

return [
    'environment' => $environment,
    'streams' => [
        'schemes' => [
            'page' => [
                'type' => 'Stream',
                'force' => true,
                'paths' => [
                    '/efs/grav/pages'
                ]
            ],
            'backup' => [
                'type' => 'Stream',
                'force' => true,
                'paths' => [
                    '/efs/grav/backups'
                ]
            ],
        ]
    ]
];

Does anyone see where I'm going wrong?

7 years ago Solution

Ok, I found the solution after a lot of trial and error. The fix below allows Grav to be installed and working on an ephemeral environment such as AWS's Elastic Beanstalk. Hopefully this helps someone in the future that finds this thread through Google.

Step 1. Create an EFS store inside AWS.
Step 2. Attach EFS store to your environment... https://github.com/awsdocs/elastic-beanstalk-samples/blob/master/configuration-files/aws-provided/instance-configuration/storage-efs-mountfilesystem.config
Step 3. Move contents of /user/pages to /efs/grav/pages
Step 4. CHMOD /efs/grav/pages to allow for creation of pages from the Grav admin UI
Step 5. Edit /user/config/streams.yaml to look like this (mine was blank):
schemes:
page:
type: Stream
paths:

  • /efs/grav/pages
    Step 6. Nothing else... it shoudl work.
👍 1

Suggested topics

Topic Participants Replies Views Activity
Installation & Hosting · by antoinep, 16 hours ago
5 62 10 hours ago
Installation & Hosting · by Jürgen Dietrich, 7 months ago
0 63 7 months ago
Installation & Hosting · by rappluk, 8 months ago
0 63 8 months ago
Installation & Hosting · by N, 12 months ago
3 75 12 months ago
Installation & Hosting · by Youle, 1 year ago
1 62 1 year ago