• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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