• Dear Pleskians! The Plesk Forum will be undergoing scheduled maintenance on Monday, 7th of July, at 9:00 AM UTC. The expected maintenance window is 2 hours.
    Thank you in advance for your patience and understanding on the matter.

How do I call a file from one domain from another domain ?

W

WebDork

Guest
I have a gallery script hosted on: http://www.domain1.com

I want to be able to use the images from that script on another domain...

So call: /var/www/vhosts/domain1.com/httpdocs/images

from http://www.domain2.com/ with a rewritten php gallery.

It seems that open base prevents this. If we turn it off for domain 2 it works fine.

Does this however open up big security issues ? Is there a smarter way of doing it ?
 
In this case, $domain1 and $domain2 are your domains. We want to open access from $domain2 to files in $domain1...

Create a vhost.conf in /var/www/vhosts/$domain2/conf with the following content:
PHP:
<Directory /var/www/vhosts/$domain2/httpdocs>
<IfModule sapi_apache2.c>
                php_admin_flag engine on
                php_admin_flag safe_mode off
                php_admin_value open_basedir "/var/www/vhosts/$domain2/httpdocs:/var/www/vhosts/$domain1/httpdocs/images:/tmp"
        </IfModule>
        <IfModule mod_php5.c>
                php_admin_flag engine on
                php_admin_flag safe_mode off
                php_admin_value open_basedir "/var/www/vhosts/$domain2/httpdocs:/var/www/vhosts/$domain1/httpdocs/images:/tmp"
        </IfModule>
</Directory>

It should do the trick...
More info (in french) here:
http://support.oxegena.ch/index.php?2006/08/27/2-configurer-la-restriction-open_basedir-apache
 
Back
Top