1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Maximum file size for upload in single domain

Discussion in 'Plesk for Linux - 8.x and Older' started by kuhle, Sep 12, 2006.

  1. kuhle

    kuhle Guest

    0
     
    I would like to increase the maximum file size that can be uploaded for one particular domain. Can anyone tell me how to do it?

    I know the php.ini file for the line that says:

    ; Maximum allowed size for uploaded files.
    upload_max_filesize = 2M

    ... but this is server-wide, and I do not want to increase it to 100MB server-wide!!! Does anyone know if this can be set on a per domain basis?
     
  2. jamxUK

    jamxUK Guest

    0
     
    Edit the vhost.conf file in the conf folder of the domain you want to change the upload size.

    Add
    <Directory /var/www/vhosts/<domain_name>/httpdocs>
    php_admin_value upload_max_filesize [size_here]M
    </Directory>

    Then run:
    /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=<domain_name>

    Regards,

    Jay
     
  3. kuhle

    kuhle Guest

    0
     
    Thanks for the help, but I am not sure that I have got this right.

    I have looked in:
    /home/httpd/vhosts/domain.com/conf

    In there, I have created a file, with a single line:
    php_admin_value upload_max_filesize 100M

    but that does not seem to have done it.

    I can't seem to find "the vhost.conf file in the conf folder of the domain you want to change" unless it was what I have done above.

    Can you help further??
     
  4. Who-m3

    Who-m3 Guest

    0
     
    You need your <Directory /.....dir..here> and </Directory> tags before and after the vhost.conf file. This file, as mentioned in the previous posts, will be in the conf/ directory of your domain (You'll see httpd.include there already, do NOT modify it, add your own vhost.conf, add the lines you need, and issue the command he said for you to issue above.. you'll be done.).
     
  5. kuhle

    kuhle Guest

    0
     
    Thank you both for your help.

    The httpd.include file is at:
    /home/httpd/vhosts/domain.com/conf

    I did not amend that file at all.

    In there, I have added the vhost.conf file which says:

    <Directory /var/www/vhosts/domain.com/httpdocs>
    php_admin_value upload_max_filesize 100M
    </Directory>

    I did not ave the <Directory ....> stuff before. I had only put the single line. Cross fingers it will be OK now!!

    If any of that is wrong, please let me know. It will be tested today!!
     
  6. breun

    breun Golden Pleskian

    29
     
    Joined:
    Jun 28, 2005
    Messages:
    1,647
    Likes Received:
    0
    Make sure to also adjust post_max_size (default 8M) and memory_limit (default 32M) in this case. If you set your upload_max_filesize to 100M you still won't be be able to upload a 100M file, as you can only post 8M.
     
  7. kuhle

    kuhle Guest

    0
     
    Breun,

    Thank you very much for that. Currently the file has the following, and if you could kindly tell me exactly what I have to add for the memory_limit, I would be really grateful ... sorry, I am not terribly technical!

    -----------
    # cat /home/httpd/vhosts/domain.com/conf/vhost.conf
    <Directory /home/httpd/vhosts/domain.com/httpdocs>
    php_admin_value upload_max_filesize 100M
    php_admin_value post_max_size 100M
    </Directory>
    # /etc/init.d/httpd reload
    Reloading httpd: [ OK ]
    -----------

    Thanks
     
  8. breun

    breun Golden Pleskian

    29
     
    Joined:
    Jun 28, 2005
    Messages:
    1,647
    Likes Received:
    0
    You don't have to be technical, just search the docs.

    http://www.php.net/ini.core#ini.file-uploads says:

    That post_max_size link tells you:

    So set memory_limit to something larger than 100M...
     
  9. johnboypro

    johnboypro Guest

    0
     
    Answer...

    I believe this might help some people...

    I had tried unsuccessfully to add the following into the vhost.conf file:

    <Directory /home/httpd/vhosts/domain.com/httpdocs>
    php_admin_value upload_max_filesize 100M
    php_admin_value post_max_size 100M
    </Directory>

    However, what I didn't realize is that you must have a line in your httpd.include file that includes the vhost.conf file in order for it to detect the settings, etc...

    Everything works perfectly after I did the following:


    1. Create the vhost.conf file in /home/httpd/vhosts/yourdomain.com/conf/ and add the lines of code that you want...

    2. Go into your PLESK control panel and make a change to your domain 'setup' configuration... You can just choose to change something simple, and then change it back.

    **This resets the httpd.include file, which will now show a line at the bottom: Include /home/httpd/vhosts/yourdomain.com/conf/vhost.conf

    There is probably a shorter way to do step two, but this is the only way I know how to do it right now...

    Basically, the httpd.include file automatically detects the vhost.conf file if it exists and includes it...

    Hope this helps...

    John
     
  10. breun

    breun Golden Pleskian

    29
     
    Joined:
    Jun 28, 2005
    Messages:
    1,647
    Likes Received:
    0
    The normal/easy way to include your newly created vhost.conf files is to run /usr/local/psa/admin/bin/websrvmng -av.
     
  11. Who-m3

    Who-m3 Guest

    0
     
    That was covered previously.
     
Loading...