N
N
neonox2013-11-11 16:33:41
linux
neonox, 2013-11-11 16:33:41

2 Users, 2 Sites, 1 Shared Folder

Good day to all.

There are:
- VPS server
- two users (site1, site2)
- two sites (site1, site2)

Site1 is owned by user site1, similar to site2.

Sites are online stores with the same products, but designed for different regions. Server resources are not elastic, and product images take up >4 GB (per site). Therefore, I want to somehow optimize this whole thing and create 1 folder, images from which both sites will take.
Tell me how to make it beautiful and so as not to damage safety.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
U
Urvin, 2013-11-11
@neonox

http://img.domain3.ru/product_sku_0.jpg
http://img.domain3.ru/product_sku_1.jpg
http://img.domain3.ru/product_sku_2.jpg
...

M
Mylistryx, 2013-11-11
@Mylistryx

RewriteRule ^images/(.*) http://site3.ru/images/$1
Under Apache - something like that. Didn't check!

A
Alexander, 2013-11-11
@syschel

As an option, move the folder with pictures to a higher level for both folders (sites), or put a third folder next to them.
And then setting up nginx

server 
{
    server_name site1.ru;
    
    <b>location /images/  
        {
        root /home/images;
    }</b>
}

server 
{
    server_name site2.ru;
    
    <b>location /images/  
        {
        root /home/images;
    }</b>
}

As a result, both sites will pull files from the same folder. But in the browser address everywhere will be
site1.ru/images/*
site2.ru/images/*
Just keep in mind that both users must get the rights to the folder. Otherwise, they will not be able to save files there and read them. Well, or there will be conflicts if one is flooded, and the other tries to display.
Well, or if you are not friends with ngings at all, then the same situation is through symlinks . That is, you also create a shared folder for media somewhere, and in the folder of each site, specify a shortcut to this ass, naming the shortcut the same way. As a result, when accessed as a folder on the site, the files will be given by the server from the shared folder. The user won't even see it.

V
Victor Taran, 2013-11-27
@shambler81

uh guys what are you thinking here? make a regular soft link and that's it!
man ln

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question