To be able to upload big files in ownClouds WebUI you have to change some settings in the Apache php.ini – and ownClouds .htaccess file. This is a pretty easy task to accomplish, and here is a gudie on how to do it.

You can also find more information here.

  1. Become root
    :~$ sudo -i
  2. edit the php.ini file

    PHP 7:

    :~$ nano /etc/php/7.0/apache2/php.ini

    PHP 5:

    :~$ nano/etc/php5/apache2/php.ini
  3. Change these values in php.ini

    Bold values are the most important

    upload_max_filesize = 16000M
    post_max_size = 16400M
    output_buffering = 0

    Optional values

    max_input_time 7200
    max_execution_time 7200

    The value 7200 is in seconds = 2 hours. This value is good to set high if you have a low bandwith connection as it will take longer time to upload

    memory_limit = 1024M
    upload_tmp_dir = /var/www/owncloud/data/upload-tmp

    Don’t forget to create that dir before you use it as tmp

    :~$ mkdir /var/www/owncloud/data/upload-tmp

    And set correct permissions to the new dir

    $~: chown -R www-data:www-data /var/www/owncloud/data/upload-tmp
  4. Go to ownclouds .htaccess file

    Please note that if you are using the pre-configured ownCloud VM, you don’t have to do the things in step 5 – 6. The built in script takes care of it for you after every update.

    :~$ nano /var/www/owncloud/.htaccess
  5. Comment out these values in .htaccess
    # php_value upload_max_filesize 513M
    # php_value post_max_size 513M
    # php_value memory_limit 512M
  6. restart apache
    :~$ service apache2 restart

    Now you can upload files in WebUI that are 16GB.

If you run a Nginx reverse proxy

You have to add a setting to pass all the data directly to the backend Apache server. In our case we only made the Nginx VM 4 GB in size, and that would limit our upload to around 2 GB as the system is around 2 GB. With proxy_request_buffering set to off, we’re not limited by the size of the Nginx server, as all the data is sent directly to the backend server.

  1. Open you nginx config
    sudo nano /etc/nginx/sites-available/your-nginx-host.conf
  2. Add Proxy Request
    location / {
    proxy_pass_header Authorization;
    proxy_pass http://$upstream;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    proxy_buffering off;
    proxy_request_buffering off;
  3. Save and restart nginx
    $~: serivce nginx restart


 PRO TIP

Secure your ownCloud against brute-force attempts. Configure Fail2ban!

Install ownCloud and host your own private cloud. Download  the pre-configured ownCloud VM today!

Make secure backups of your server with QNAP and Rsync, complete guide.