Amazon Scalability

i want to setup a multi-vendor store using amazon Elastic beanstalk. to do this, i must separate the code and data.

addons would be in code

store product files would be in data.

both would be stored on AWS EFS volumes and shared between EB instances.

the apache server would point to the efs volume for the php scripts.

this way, when eb says scale up, the new instance is really the web server and DB (on an RDS volume) connection, no CS cart product at all.

but currently the assumption is that product images and extra files, etc all live in the same http file tree as the scripts...

anyone have any guidance?

Sam

i want to setup a multi-vendor store using amazon Elastic beanstalk. to do this, i must separate the code and data.

addons would be in code

store product files would be in data.

both would be stored on AWS EFS volumes and shared between EB instances.

the apache server would point to the efs volume for the php scripts.

this way, when eb says scale up, the new instance is really the web server and DB (on an RDS volume) connection, no CS cart product at all.

but currently the assumption is that product images and extra files, etc all live in the same http file tree as the scripts...

anyone have any guidance?

Sam

You can just change the data directories if that is your only problem, this can be changed in the config.local.php. If you have any more questions feel free to ask them!

You can just change the data directories if that is your only problem, this can be changed in the config.local.php. If you have any more questions feel free to ask them!

thanks..

it looks like the images and var folders (which change for product content) of the CS-cart install need to be on a separate volume from the code(which doesn't change very often).

I think I see where I can change var (in config.php)... but not images.

i have a design using docker images for the web server component, the separate volumes for the product code cannot have symbolic links, so I would need to use docker volumes (fixed mount points) instead...

thanks..

it looks like the images and var folders (which change for product content) of the CS-cart install need to be on a separate volume from the code(which doesn't change very often).

I think I see where I can change var (in config.php)... but not images.

i have a design using docker images for the web server component, the separate volumes for the product code cannot have symbolic links, so I would need to use docker volumes (fixed mount points) instead...

I said config.local.php not config.php. Take a look:

$config['storage'] = array(
    'images' => array(
        'prefix' => 'images',
        'dir' => $config['dir']['root'],
        'cdn' => true
    ),
    'downloads' => array(
        'prefix' => 'downloads',
        'secured' => true,
        'dir' => $config['dir']['var']
    ),
    'assets' => array(
        'dir' => & $config['dir']['cache_misc'],
        'prefix' => 'assets',
        'cdn' => true
    ),
    'custom_files' => array(
        'dir' => & $config['dir']['var'],
        'prefix' => 'custom_files'
    )
);

It litterally says 'images'.

Best wishes,

I said config.local.php not config.php. Take a look:

$config['storage'] = array(
    'images' => array(
        'prefix' => 'images',
        'dir' => $config['dir']['root'],
        'cdn' => true
    ),
    'downloads' => array(
        'prefix' => 'downloads',
        'secured' => true,
        'dir' => $config['dir']['var']
    ),
    'assets' => array(
        'dir' => & $config['dir']['cache_misc'],
        'prefix' => 'assets',
        'cdn' => true
    ),
    'custom_files' => array(
        'dir' => & $config['dir']['var'],
        'prefix' => 'custom_files'
    )
);

It litterally says 'images'.

Best wishes,

thx.. missed that.

var looks more troublesome.. as the config.php uses the hard coded '/var/' for the subfolders.

for example

'database' => DIR_ROOT . '/var/database/',
'var' => DIR_ROOT . '/var/',

I said config.local.php not config.php. Take a look:

$config['storage'] = array(
    'images' => array(
        'prefix' => 'images',
        'dir' => $config['dir']['root'],
        'cdn' => true
    ),
    'downloads' => array(
        'prefix' => 'downloads',
        'secured' => true,
        'dir' => $config['dir']['var']
    ),
    'assets' => array(
        'dir' => & $config['dir']['cache_misc'],
        'prefix' => 'assets',
        'cdn' => true
    ),
    'custom_files' => array(
        'dir' => & $config['dir']['var'],
        'prefix' => 'custom_files'
    )
);

It litterally says 'images'.

Best wishes,

I tried to change the config.local.php entries for images, but it doesn't work.

if I mount the folder in the images location then it works fine.. so the actual folder content is correct (permissions, etc)..

here is the change I made to the config.local.php

'images' => array(
'prefix' => 'images',
'dir' => '/cart-images',
'cdn' => true
),

advice welcomed.

I don't see any access or errors list for apache web server..

I tried to change the config.local.php entries for images, but it doesn't work.

if I mount the folder in the images location then it works fine.. so the actual folder content is correct (permissions, etc)..

here is the change I made to the config.local.php

'images' => array(
'prefix' => 'images',
'dir' => '/cart-images',
'cdn' => true
),

advice welcomed.

I don't see any access or errors list for apache web server..

my folder is '/cart-images/images'

I tried to change the config.local.php entries for images, but it doesn't work.

if I mount the folder in the images location then it works fine.. so the actual folder content is correct (permissions, etc)..

here is the change I made to the config.local.php

'images' => array(
'prefix' => 'images',
'dir' => '/cart-images',
'cdn' => true
),

advice welcomed.

I don't see any access or errors list for apache web server..

I suppose this (not tested)

'images' => array(
   'prefix' => 'images',
   'dir' => $config['dir']['root'] . '/cart-images/',
   'cdn' => true
),

I suppose this (not tested)

'images' => array(
   'prefix' => 'images',
   'dir' => $config['dir']['root'] . '/cart-images/',
   'cdn' => true
),

thanks.. but the new path is OUTSIDE the web root folder. i want to make a solution that can work with anyones cs-cart implementation without knowing what the web root is..

thanks.. but the new path is OUTSIDE the web root folder. i want to make a solution that can work with anyones cs-cart implementation without knowing what the web root is..

So then you enter the full path of something e.g.

C:\Data\Images

So then you enter the full path of something e.g.

C:\Data\Images

which is what I did,

'dir' => '/cart-images',

this is a linux machine hosting cs-cart

which is what I did,

'dir' => '/cart-images',

this is a linux machine hosting cs-cart

With this you would write to the linux root folder, also make sure to have the correct permissions. If this seems to much of a hassle you could also just create a symbolic link:

# Source Link
ln -s /cscart-images /var/www/html/test.com/images

This way you won't have to edit all the permissions.

With this you would write to the linux root folder, also make sure to have the correct permissions. If this seems to much of a hassle you could also just create a symbolic link:

This way you won't have to edit all the permissions.

thanks.. links will not work.. unless the path is IDENTICAL on both the host and remote system (remember this is using a remote volume for the code and images)...

anyhow, finally got it..

first was a permissions issue, missing a directive to the web server to allow access outside the documentroot..

second was a path problem

I had used the default documentroot (/var/www/html) and mounted that on a remote volume which was hosted at /cart-images

the volume mounting mapping is 100% .. so when a request came for ../../../cart-images.. well, on the remote volume there is NOT ../../.., so the request would fail.. same for the code path.. confused on relative directories...

once the actual folder depth (and folder NAMES) matched the virtual host EXPECTED path depth and names.. all works..

so, I have a load balancer over multiple (identical) http servers, which mount separate remote volumes for the code and images.. sharing the code and data.. the mysql config points to a single backend database server

and there is a bug in the cs-cart code when the image path is outside the document root path.

when saving the product images, the code tries to determine if the folder of the path exists.

it parses the path with / and then walks thru each part top down, creating folders on the way.

but.. the first element of the array after parse is ''. and of course it fails to find or create a directory using that name..

So, in this case the loop should skip handling of '' empty path elements.

/app/functions/fn.fs.php

fn_mkdir:

foreach ($dir_arr as $k => $v) {
$path .= (empty($k) ? '' : '/') . $v;
if(empty($path)){ // check for empty path element
continue; // skip this one if empty
}
clearstatcache();