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.
-
Become root
:~$ sudo -i
-
edit the php.ini file
PHP 7:
:~$ nano /etc/php/7.0/apache2/php.ini
PHP 5:
:~$ nano/etc/php5/apache2/php.ini
-
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
-
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
-
Comment out these values in .htaccess
# php_value upload_max_filesize 513M
# php_value post_max_size 513M
# php_value memory_limit 512M
-
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.
-
Open you nginx config
sudo nano /etc/nginx/sites-available/your-nginx-host.conf
-
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;
-
Save and restart nginx
$~: serivce nginx restart