1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice

problem with vhost.conf and file uploads

Discussion in 'Plesk for Linux - 8.x and Older' started by cyberpunkdreams, Dec 21, 2005.

  1. cyberpunkdreams

    cyberpunkdreams Guest


    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
  2. mikk

    mikk Basic Pleskian

    Jan 29, 2005
    Likes Received:
    You should wrap them in <Directory> so they are treated for the specific domain only.


    <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

    Give that a try
  3. cyberpunkdreams

    cyberpunkdreams Guest

    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