Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Is there a way for vhost X to write files to vhost Y? Here is my setup:

www.domain.com points to x.x.x.x IP address, using /httpdocs as directory www.domain1.com points to x.x.x.x IP address, using /httpdocs/www.domain1.com as directory www.domain2.com points to x.x.x.x IP address, using /httpdocs/www.domain2.com as directory

All websites are linked to the same database.

I would like that if a user uploads a file to domain1.com, the file is actually stored on domain2.com (/httpdocs/www.domain2.com/uploads). Is this possible?

Thanks for your help.

share|improve this question

1 Answer 1

Yes it is. Just set the upload dir (in your script) to "/httpdocs/www.domain2.com/uploads" (check the permissions if apache can write there), and upload the file there.

share|improve this answer
I have set the path, but I cannot 'see' the path. Using scandir (PHP) on /var/www/vhosts/www.domain.com/www.domain1.com/ shows true from domain1, and false from domain2. I have also tried with just /httpdocs/www.domain1.com/ using full permissions (as a test) r/w/x. Still cannot see it. –  Aeisor May 25 '12 at 10:42
I've figured it out. I added /var/www/vhosts/domain.com/httpdocs/www.domain2.com/ to the open_basedir for domain1.com Thanks for your help anyway. –  Aeisor May 25 '12 at 10:56

Your Answer


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.