Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have two ecommerce websites, selling music digital downloads, on the same VPS, currently using cPanel/WHM (but thinking of switching to Virtualmin). They have separate domains and IPs of course. They both share from the same set of music files, so I have duplicate copies in each website directory, which takes up a lot of disk space. How might I go about sharing the same set of music files across both sites, allowing PHP access, so that it does not break my shopping cart's functionality of serving customers the downloads after they have paid for them? I thought of maybe using symlinks or something, but I don't know if it's possible, or if it would have to somehow circumvent built-in security features of the server. I'm new to VPS management.

share|improve this question

1 Answer 1

I'd build a sub-domain for each site music.domain.com and point each to a single directory containing all the music. You'd have more control that way, without appearing to go to another site for the music.

This does mean that you'd have to have two SSL certs, so it may be cheaper to buy a new domain and do it that way.

share|improve this answer
    
I'm not sure how I could make a subdomain solution work... The music files are are served to the customers by PHP scripts that read the files and send headers to tell the browser to download them... So, I believe I need some way for the php scripts in each of the sites to access the same files, like via symbolic links appearing as directories in their own directory trees. Is that possible? –  Lee Fentress May 22 '12 at 16:10
    
@LeeFentress it's definitely possible, but you'd really need to ask the php gurus over at StackOverFlow or the Apache gurus at ServerFault for the how. But you could certainly setup sym links on the server to mirror the directory structure from one site to the other. –  toomanyairmiles May 22 '12 at 17:57
    
why not let first site refer to music files in the other site with sufficient authorization? –  AgA Oct 25 '12 at 8:07
    
I don't see how subdomains come into play here. You're not going to want to put any digital download products inside of the webroot of an Apache vhost. This is purely an issue of filesystem security/permissions. If he's running both sites off of a single user, then it's a simple matter of pointing both shopping carts to the same directory (if possible) or symlinking them. If he's running the sites under different chrooted users and the shopping cart requires a certain directory structure, it might be more complicated. I'd just use a single Magento install to manage both stores. –  Lèse majesté Feb 22 '13 at 13:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.