User Tools

Site Tools


informatica:servidor_internet_2009

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
informatica:servidor_internet_2009 [2022/10/24 13:52]
miquel [El servidor es posa a hibernar - Octubre de 2022]
informatica:servidor_internet_2009 [2022/11/28 15:11] (current)
miquel [La grandària màxima per pujar fitxers ha disminuït - Novembre de 2022]
Line 118: Line 118:
   * [[https://wiki.archlinux.org/title/GDM#GDM_auto-suspend_.28GNOME_3.28.29 | GDM - ArchWiki]]   * [[https://wiki.archlinux.org/title/GDM#GDM_auto-suspend_.28GNOME_3.28.29 | GDM - ArchWiki]]
   * [[https://otremba.net/wiki/Energiespareinstellungen_(Debian)]]   * [[https://otremba.net/wiki/Energiespareinstellungen_(Debian)]]
-  * [[https://blog.michael.franzl.name/tag/debian-2/ ]]+  * [[https://blog.michael.franzl.name/tag/debian-2/ | “Green Energy” complication: gdm3 suspends machine after 20 minutes: A solution.]] 
 +  * [[https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=896083]] 
 + 
 +===== La grandària màxima permesa pels fitxers a penjar ha disminuït - Novembre de 2022 ===== 
 + 
 +Dilluns 2022-11-07, la Míriam indica que no pot pujar fitxers ZIP d'uns 40 MB i que només pot pujar fitxers de mida petita. 
 + 
 +Comprovo el fitxer de registre del servidor web i trobo un missatge d'error on posa que la mida del fitxer supera el límit actual de 8 MB (8388608 bytes): 
 + 
 +<code apache> 
 +Mon Nov 07 09:59:03.630161 2022] [:error] [pid 455409] [client 158.109.55.158:57523] 
 +PHP Warning:  POST Content-Length of 45493887 bytes exceeds the limit of 8388608 bytes 
 +in Unknown on line 0, referer: https://sermn.uab.cat/pydio/ws-my-files/ 
 +</code> 
 + 
 +Abans de l'actualització del PHP a 7.x i reinstal·lació del PHP 5.6, el límit s'havia incrementant fins 2 GB: 
 + 
 +<code> 
 +# grep -e "upload_max_filesize" -e "post_max_size" /etc/php5/apache2/php.ini  
 +post_max_size = 2048M 
 +upload_max_filesize = 2500M 
 +</code> 
 + 
 +però les versions actuals tornen a tenir els valors per defecte: 
 + 
 +<code> 
 +# grep -e "upload_max_filesize" -e "post_max_size" /etc/php/*/apache2/php.ini 
 +/etc/php/5.6/apache2/php.ini:post_max_size = 8M 
 +/etc/php/5.6/apache2/php.ini:upload_max_filesize = 2M 
 +/etc/php/7.3/apache2/php.ini:post_max_size = 8M 
 +/etc/php/7.3/apache2/php.ini:upload_max_filesize = 2M 
 +/etc/php/8.1/apache2/php.ini:; post_max_size = 8M 
 +/etc/php/8.1/apache2/php.ini:; upload_max_filesize = 2M 
 +</code> 
 + 
 +He canviat els paràmetres rellevants a totes les versions, tenint present les instruccions al manual (veure referències) i, després de reiniciar el servidor, el límit torna a ser de 2 GB (FIXME ho he comprovat): 
 + 
 +<WRAP info> 
 +The ''MAX_FILE_SIZE'' item cannot specify a file size greater than the file size that has been set in the ''upload_max_filesize'' in the ''php.ini'' file. The default is 2 megabytes. 
 + 
 +If a memory limit is enabled, a larger ''memory_limit'' may be needed. Make sure you set ''memory_limit'' large enough. 
 + 
 +If ''max_execution_time'' is set too small, script execution may be exceeded by the value. Make sure you set ''max_execution_time'' large enough. 
 + 
 +Note: ''max_execution_time'' only affects the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using ''system()'', the ''sleep()'' function, database queries, time taken by the file upload process, etc. is not included when determining the maximum time that the script has been running.  
 + 
 +Warning: ''max_input_time'' sets the maximum time, in seconds, the script is allowed to receive input; this includes file uploads. For large or multiple files, or users on slower connections, the default of 60 seconds may be exceeded. 
 + 
 +If ''post_max_size'' is set too small, large files cannot be uploaded. Make sure you set ''post_max_size'' large enough. 
 + 
 +''post_max_size int'' must be larger than ''upload_max_filesize''
 + 
 +</WRAP> 
 + 
 +<code> 
 +# grep -e "memory_limit" -e "upload_max_filesize" -e "post_max_size" /etc/php/*/apache2/php.ini 
 +/etc/php/5.6/apache2/php.ini:memory_limit = 256M 
 +/etc/php/5.6/apache2/php.ini:post_max_size = 2150M 
 +/etc/php/5.6/apache2/php.ini:upload_max_filesize = 2060M 
 + 
 +/etc/php/7.3/apache2/php.ini:memory_limit = 128M 
 +/etc/php/7.3/apache2/php.ini:post_max_size = 2150M 
 +/etc/php/7.3/apache2/php.ini:upload_max_filesize = 2060M 
 + 
 +/etc/php/8.1/apache2/php.ini:memory_limit = 128M 
 +/etc/php/8.1/apache2/php.ini:post_max_size = 2150M 
 +/etc/php/8.1/apache2/php.ini:upload_max_filesize = 2060M 
 +</code> 
 + 
 +i en el fitxer de configuració d'Apache ''/etc/apache2/sites-enabled/sermn_uab_cat-3-https.conf'' afegeixo 
 + 
 +<code apache> 
 +#### File upload limit set to 2200 MBytes 
 +LimitRequestBody 2306867200 
 +</code> 
 + 
 +Faig unes proves amb fitxers de diverses mides i veig que: 
 + 
 +  * un fitxer de 200 MB es transfereix en aprox. 22 segons 
 +  * un fitxer de 400 MB es transfereix en aprox. 48 segons 
 +  * un fitxer de 600 MB es transfereix en aprox. 1:17 minuts 
 +  * un fitxer de 800 MB es transfereix en aprox. 1:50 minuts 
 +  * un fitxer de 1024 MB (1 GB) es transfereix en aprox. 2:10 minuts 
 +  * un fitxer de 2048 MB (2 GB) es transfereix en aprox. 4:13 minuts 
 + 
 +==== Referències ==== 
 + 
 +  * [[https://kinsta.com/knowledgebase/the-uploaded-file-exceeds-the-upload_max_filesize-directive-in-php-ini/ | How to Fix the uploaded file exceeds the upload_max_filesize directive in php.ini Error.]] 
 +    * [[https://www.php.net/manual/en/ini.core.php#ini.post-max-size | PHP Manual - post_max_size]] 
 +    * [[https://www.php.net/manual/en/features.file-upload.common-pitfalls.php | PHP Manual - Common Pitfalls]] 
 +  * [[https://support.cpanel.net/hc/en-us/articles/6994682816023-Requested-content-length-is-larger-than-the-configured-limit-of-1073741824-Apache-2-4-54-413-error-code- | Requested content-length is larger than the configured limit of 1073741824 ( Apache 2.4.54 , 413 error code ) – cPanel]] 
 +    * [[https://httpd.apache.org/docs/2.4/mod/core.html#limitrequestbody | limitrequestbody - core - Apache HTTP Server Version 2.4.]] 
 + 
 + 
  
informatica/servidor_internet_2009.1666612357.txt.gz · Last modified: 2022/10/24 13:52 by miquel