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/09/27 17:03]
miquel [Actualització d'HTTP a HTTPS amb certificats LetsEncrypt - Setembre 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 95: Line 95:
   * [[informatica:servidor_internet_2009_debian_10_part_4 | Actualització a Debian 10.12 - Part 4]]   * [[informatica:servidor_internet_2009_debian_10_part_4 | Actualització a Debian 10.12 - Part 4]]
  
-===== Actualització d'HTTP a HTTPS amb certificats LetsEncrypt - Setembre de 2022 =====+===== Actualització d'HTTP a HTTPS - Setembre de 2022 =====
  
 Cal convertir el servidor HTTP en HTTPS. He descartat les opcions de fer-ho amb un certificat auto-signat (self-signed) o amb un certificat aconseguit a través del Servei d'Informàtica perquè el primer no és acceptat per defecte pels navegadors i perquè el segon mecanisme implica força burocràcia i no sembla que sigui automatitzable. Cal convertir el servidor HTTP en HTTPS. He descartat les opcions de fer-ho amb un certificat auto-signat (self-signed) o amb un certificat aconseguit a través del Servei d'Informàtica perquè el primer no és acceptat per defecte pels navegadors i perquè el segon mecanisme implica força burocràcia i no sembla que sigui automatitzable.
Line 101: Line 101:
 Això ens deixa l'opció de fer servir certificats emesos per [[https://letsencrypt.org/ | Let’s Encrypt,]] una Autoritat de Certificació sense ànim de lucre que actualment proporciona certificats TLS a 260 milions de llocs web. Això ens deixa l'opció de fer servir certificats emesos per [[https://letsencrypt.org/ | Let’s Encrypt,]] una Autoritat de Certificació sense ànim de lucre que actualment proporciona certificats TLS a 260 milions de llocs web.
  
-Aquesta pàgina conté la descripció detallada del procés d'obtenció dels certificats i la configuració del servidor HTTPS amb Apache a Debian 10.12 "buster":+Aquestes pàgines contenen la descripció detallada del procés d'obtenció dels certificats i la configuració del servidor HTTPS amb Apache a Debian 10.12 "buster": 
 + 
 +  * [[informatica:servidor_internet_2009_http_to_https_letsencrypt | Canvi del servidor web d'HTTP a HTTPS. Obtenció d'un certificat de Let's Encrypt.]] No he pogut fer servir aquesta opció perquè per fer-la servir hauria de tenir control del domini "uab.cat"
 +  * [[informatica:servidor_internet_2009_http_to_https_rediris | Canvi del servidor web d'HTTP a HTTPS. Obtenció d'un certificat a través de la UAB i RedIris.]] Aquesta és l'opció per defecte a la UAB. Cal generar un fitxer CSR (Certificate Signing Request) i enviar-ho perquè el signi la Certificate Authority contractada per RedIris. 
 +  * [[informatica:servidor_internet_2009_http_to_https_apache | Canvi del servidor web d'HTTP a HTTPS. Canvis a Apache.]] 
 + 
 +===== El servidor es posa a hibernar - Octubre de 2022 ===== 
 + 
 +Divendres 2022-10-21, després de reiniciar el servidor perquè una actualització de seguretat (**''dbus''?**) ho exigia, el servidor va començar a aturar-se sense motiu. Després d'investigar el tema, vaig trobar que un canvi a la configuració del gestor gràfic ''gdm3'' feia que el servidor entrés en hibernació transcorreguts 1200 segons. 
 + 
 +Per més detalls consultar, 
 + 
 +  * [[https://www.google.com/search?q=networkmanager+info+manager+sleep+sleep+requested+%28sleeping+no+enabled+yes | Google Search: networkmanager info manager sleep sleep requested (sleeping no enabled yes)]] 
 +  * [[https://askubuntu.com/questions/1271282/how-to-stop-networkmanager-to-put-ubuntu-server-to-sleep | network manager - How to stop NetworkManager to put Ubuntu server to sleep? - Ask Ubuntu]] 
 +  * [[https://bbs.archlinux.org/viewtopic.php?id=274383 | How to disable NetworkManager triggering sleep.target? / Applications & Desktop Environments / Arch Linux Forums]] 
 +  * [[https://wiki.archlinux.org/title/GDM#GDM_auto-suspend_.28GNOME_3.28.29 | GDM - ArchWiki]] 
 +  * [[https://otremba.net/wiki/Energiespareinstellungen_(Debian)]] 
 +  * [[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_http_to_https_letsencrypt | Canvi del servidor web d'HTTP a HTTPS amb Let's Encrypt.]] No he pogut fer servir aquesta opció perquè per fer-la servir hauria de tenir control del domini "uab.cat". 
-  * [[informatica:servidor_internet_2009_http_to_https_rediris | Canvi del servidor web d'HTTP a HTTPS amb RedIris.]] Aquesta és l'opció per defecte a la UAB. Cal generar un fitxer CSR (Certificate Signing Request) i enviar-ho perquè el signi la Certificate Authority. 
  
  
informatica/servidor_internet_2009.1664291025.txt.gz · Last modified: 2022/09/27 17:03 by miquel