• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

problem with vhost.conf and file uploads

C

cyberpunkdreams

Guest
Hi,

I've got a bit of a problem with the virtual hosts on my server, which I am almost certain was caused by me messing around with it without properly knowing what I was doing.

What happened was that I couldn't upload files via a web form (my own system, which does work fine on my development system) due to various restrictions and whatnot, and after some research I figured I ought to add these to the vhost.conf file for that virtual server (where example.com would be the URL of the site):

php_admin_value open_basedir /home/httpd/vhosts/example.com/httpdocs:/tmp
php_admin_value upload_tmp_dir /home/httpd/vhosts/example.com/httpdocs/tmp

Then I ran '/usr/local/psa/admin/sbin/websrvmng -a -v' to get it all working. I also did the same to each new virtual server I set up, thinking I was avoiding future problems.

However, what's happened is that if I now try to do an upload to one of these servers (say, trying to do an attachment with Horde web mail), it fails, as the system is trying to upload the file to a tmp directory that belongs to one of the other virtual hosts. I've tried various things to fix it, and the fixes work for a short while, before the problem re-occurs. The virtual host it chooses seems to be random.

I figure that I've done something very stupid and naive and (hopefully) easy to fix, but I can't figure out what!

Any solutions would be greatly appreciated.

Thanks very much
Rob
 
You should wrap them in <Directory> so they are treated for the specific domain only.


eg:

<Directory /home/httpd/vhosts/example.com/httpdocs>
php_admin_value open_basedir /home/httpd/vhosts/example.com/httpdocs:/tmp
php_admin_value upload_tmp_dir /home/httpd/vhosts/example.com/httpdocs/tmp
</Directory>

Give that a try
 
Thanks! I haven't tried it yet, but I think that's almost certain to solve my problem. I had just assumed that the vhost.conf file only applied to the directory it was in my default.

thanks again
Rob
 
Back
Top