• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

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