Find the answer to your Linux question:
Results 1 to 4 of 4
Hi stuck on a problem, wondered if anyone had any ideas. I have a dedicated server with two sites ie site1 & site2. We have two sites which need to ...
  1. #1
    Just Joined!
    Join Date
    Jul 2010
    Posts
    1

    Sharing Images Between Two Sites On Same Server

    Hi stuck on a problem, wondered if anyone had any ideas.
    I have a dedicated server with two sites ie site1 & site2.

    We have two sites which need to share the same images folder, the situation is
    a shopping site (site1) with one category of products which we have decided to setup as dedicated site for (site2).

    Our system uploads the images to site1 directory ie:
    /home/site1/public_html/images/image1.jpg

    I don't want to duplicate the images into site2 images directory so is there a way
    of sharing them using the following url
    /home/site2/public_html/images/image1.jpg (which pulls site1 image)

    Hope this makes sense!

    Cheers

    Steve

  2. #2
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,100
    If the pictures are and stay on the same server
    and the permissions are set accordingly,
    then a bind mount should solve your problem.

    Basically you bind mount the source directory
    /home/site1/public_html/images
    to
    /home/site2/public_html/images

    For details, see
    man mount
    You must always face the curtain with a bow.

  3. #3
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,100
    Or, - if site2 is readonly for these images- then there is a simpler way:

    Just delete the (empty|redundant) images directory for site2
    and add an alias /images to the apache virtual host of site2, that points to /home/site1/public_html/images
    You must always face the curtain with a bow.

  4. #4
    Linux Newbie
    Join Date
    Apr 2010
    Location
    Novosibirsk, Russia
    Posts
    136

    Smile

    Symbolic links can do the same too...)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...