Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Amazon Scalability Rate Topic   - - - - -

 
  • sdetweil
  • Advanced Member
  • Trial users
  • Join Date: 13-Apr 15
  • 86 posts

Posted 25 September 2017 - 01:58 PM #1

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



 
  • poppedweb
  • Advanced Member
  • Members
  • Join Date: 02-Aug 16
  • 146 posts

Posted 25 September 2017 - 06:51 PM #2

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!



 
  • sdetweil
  • Advanced Member
  • Trial users
  • Join Date: 13-Apr 15
  • 86 posts

Posted 09 October 2017 - 03:29 PM #3

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... 



 
  • poppedweb
  • Advanced Member
  • Members
  • Join Date: 02-Aug 16
  • 146 posts

Posted 09 October 2017 - 03:34 PM #4

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,



 
  • sdetweil
  • Advanced Member
  • Trial users
  • Join Date: 13-Apr 15
  • 86 posts

Posted 09 October 2017 - 03:57 PM #5

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/',


 
  • sdetweil
  • Advanced Member
  • Trial users
  • Join Date: 13-Apr 15
  • 86 posts

Posted 10 October 2017 - 02:17 PM #6

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.. 



 
  • sdetweil
  • Advanced Member
  • Trial users
  • Join Date: 13-Apr 15
  • 86 posts

Posted 10 October 2017 - 02:19 PM #7

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'

 



 
  • poppedweb
  • Advanced Member
  • Members
  • Join Date: 02-Aug 16
  • 146 posts

Posted 10 October 2017 - 03:34 PM #8

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
),


 
  • sdetweil
  • Advanced Member
  • Trial users
  • Join Date: 13-Apr 15
  • 86 posts

Posted 11 October 2017 - 04:03 AM #9

 

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.. 



 
  • poppedweb
  • Advanced Member
  • Members
  • Join Date: 02-Aug 16
  • 146 posts

Posted 11 October 2017 - 05:34 AM #10

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



 
  • sdetweil
  • Advanced Member
  • Trial users
  • Join Date: 13-Apr 15
  • 86 posts

Posted 11 October 2017 - 10:24 AM #11

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



 
  • poppedweb
  • Advanced Member
  • Members
  • Join Date: 02-Aug 16
  • 146 posts

Posted 11 October 2017 - 02:24 PM #12

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 -/cscart-images /var/www/html/test.com/images

 

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



 
  • sdetweil
  • Advanced Member
  • Trial users
  • Join Date: 13-Apr 15
  • 86 posts

Posted 12 October 2017 - 02:14 PM #13

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 <directory> 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