If you are running Plesk and you want to run something from a directory outside of the httpdocs directory you can do this simply by adding a vhost.conf file.  You will need to create the vhost.conf file in conf/ in your websites main directory.

cd /var/www/vhosts/domain.com/conf/

You can create this with your favourite editor.

vim vhost.conf

<Directory /var/www/vhosts/domain.com/httpdocs>
php_admin_value open_basedir /tmp:/var/www/vhosts/domain.com
</Directory>

Save this file and then we just have to edit the httpd.include file.

Once the file is open you just need to add this line:

ErrorDocument 501 /error_docs/not_implemented.html
ErrorDocument 502 /error_docs/bad_gateway.html
Include /var/www/vhosts/domain.com/conf/vhost.conf
</VirtualHost>

Save this file and you just have to reconfigure plesk

/usr/local/psa/admin/sbin/websrvmng -u –vhost-name=domain.com

Now you should be able to access folders outside your main httpdocs folder. If you need to do this for https connections you can follow all the same steps but you will need to create a vhost_ssl.conf file instead of the vhost.conf file.

Sorry, comments are closed.