SlideShare uma empresa Scribd logo
1 de 27
Apache ha muerto  Viva LIGHTTPD! [email_address] * No creo realmente que el Apache haya muerto, pero si que ahora hay mas opciones, algunas mucho mas interesantes, como Lighty. El titulo de la presentacion es para provocar, nomas.
Características ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
La  filosofía   Lighty ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Cuando si, cuando no ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Quien usa Lighttpd ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Módulos  disponibles ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Problemas y soluciones ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Configuración condicional ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
FastCGI ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Apache mod_php vs FastCGI ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
1 servidor HTTP, 3 servidores PHP FastCGI FastCGI FastCGI HTTP
Balanceo de Carga PHP ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Un servidor por "zona" $HTTP["url"] =~ " ^/forum " { proxy-core.protocol = "fastcgi" proxy-core.backends = ( " 10.0.0.1:1000 ") } $HTTP["url"] =~ " ^/torrents " { proxy-core.protocol = "fastcgi" proxy-core.backends = ( " 10.0.0.99:1000 ") }
Distribuyendo la carga  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Distribuyendo la carga $HTTP["url"] =~ "php$" { proxy-core.protocol = "fastcgi" proxy-core.backends = ( "10.0.0.1:1000" ) } else $HTTP["url"] =~ "^/images/[0-4]/" { proxy-core.protocol = "http" proxy-core.backends = ( "10.0.0.2:80" ) } else $HTTP["url"] =~ "^/images/[5-9]/" { proxy-core.protocol = "http" proxy-core.backends = ( "10.0.0.3:80" ) } The web is a pipe!
Sirviendo downloads "protegidos" ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sirviendo archivos "protegidos" ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Solución  Lighty recanchera ,[object Object],[object Object],[object Object],[object Object],[object Object],<?php if (usuario_registrado())  header(&quot;X-Sendfile: /opt/files/pescaditos.exe&quot;);
Scripteando las tripas de Lighty ,[object Object],[object Object],[object Object],[object Object],[object Object]
Un archivo al azar En PHP, PHP+X-Sendfile y LUA <?php header(&quot;Content-Type: image/png&quot;); print file_get_contents(&quot;imgs/&quot;.rand(0,9).&quot;.png&quot;); <?php header(&quot;Content-Type: image/png&quot;); header(&quot;X-Sendfile: &quot;.getcwd(). &quot;/imgs/&quot;.rand(0,9).&quot;.png&quot;); lighty.env[&quot;request.uri&quot;]=&quot;/imgs/&quot; ..  math.random(9) .. &quot;.png&quot; return lighty.RESTART_REQUEST
magnet, minibenchmark ,[object Object],[object Object],[object Object],[object Object]
magnet: cache html  ,[object Object],[object Object],[object Object],[object Object]
magnet: cache html  Guardar el output HTML en el archivo temporal: <?php function cache_html(){ function write_html($text){ $info = stat($_SERVER[&quot;SCRIPT_FILENAME&quot;]);  file_put_contents(&quot;/tmp/&quot;.$info['ino'].&quot;.html&quot;,$text); return false; } ob_start(&quot;write_html&quot;); }
magnet: cache html  Devolver el contenido del archivo temporal si existe y terminar la ejecucion (PHP): <?php function show_cached(){ $info = stat($_SERVER[&quot;SCRIPT_FILENAME&quot;]); $cache_file = &quot;/tmp/&quot;.$info['ino'].&quot;.html&quot;; if (file_exists($cache_file)){ print file_get_contents($cache_file); exit; } }
magnet: cache html  Devolver el contenido del archivo temporal si existe y terminar la ejecucion (LUA): info = lighty.stat(lighty.env[&quot;physical.path&quot;]) cache_path = &quot;/tmp/&quot;..info[&quot;st_ino&quot;]..&quot;.html&quot; cache_info = lighty.stat(cache_path) if (cache_info) then lighty.env[&quot;physical.path&quot;] = cache_path end
magnet: cache html  ,[object Object],[object Object],[object Object]
Ayuda, por dios! ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Creative Commons  Attribution-Noncommercial Share Alike 2.5  Argentina License

Mais conteúdo relacionado

Mais procurados

Curso TIC de PHP y MSQL Parte 1
Curso TIC de PHP y MSQL Parte 1Curso TIC de PHP y MSQL Parte 1
Curso TIC de PHP y MSQL Parte 1
Wilian
 

Mais procurados (20)

Servidor http
Servidor httpServidor http
Servidor http
 
Presentacion ventajas y desventajas de un servidor compartido
Presentacion ventajas y desventajas de un servidor compartidoPresentacion ventajas y desventajas de un servidor compartido
Presentacion ventajas y desventajas de un servidor compartido
 
Servidor http(web)
Servidor http(web)Servidor http(web)
Servidor http(web)
 
Cuadro comparativo de apache y iis
Cuadro comparativo de apache y iisCuadro comparativo de apache y iis
Cuadro comparativo de apache y iis
 
Servicios de red amp
Servicios de red   ampServicios de red   amp
Servicios de red amp
 
Tabla comparativa servidores web
Tabla comparativa servidores webTabla comparativa servidores web
Tabla comparativa servidores web
 
Qué es un servidor web
Qué es un servidor webQué es un servidor web
Qué es un servidor web
 
Mapa Conceptual de los Servidor Apache y IIS.
Mapa Conceptual de los Servidor Apache y IIS.Mapa Conceptual de los Servidor Apache y IIS.
Mapa Conceptual de los Servidor Apache y IIS.
 
Cliente web
Cliente web Cliente web
Cliente web
 
¿Cómo elegir servidor web?
¿Cómo elegir servidor web?¿Cómo elegir servidor web?
¿Cómo elegir servidor web?
 
Servidor WEB y FTP
Servidor WEB y FTPServidor WEB y FTP
Servidor WEB y FTP
 
Recuperacion
RecuperacionRecuperacion
Recuperacion
 
Servidor web
Servidor webServidor web
Servidor web
 
Servidores web
Servidores webServidores web
Servidores web
 
Curso TIC de PHP y MSQL Parte 1
Curso TIC de PHP y MSQL Parte 1Curso TIC de PHP y MSQL Parte 1
Curso TIC de PHP y MSQL Parte 1
 
Clientes web
Clientes webClientes web
Clientes web
 
Mantenimiento Servidor de correo
Mantenimiento Servidor de correo Mantenimiento Servidor de correo
Mantenimiento Servidor de correo
 
CUADRO COMPARATIVO TIPOS DE SERVIDORES Y EL MANEJO DE SUS DATOS
CUADRO COMPARATIVO TIPOS DE SERVIDORES Y EL MANEJO DE SUS DATOS CUADRO COMPARATIVO TIPOS DE SERVIDORES Y EL MANEJO DE SUS DATOS
CUADRO COMPARATIVO TIPOS DE SERVIDORES Y EL MANEJO DE SUS DATOS
 
Cuadro comparativo 2
Cuadro comparativo 2Cuadro comparativo 2
Cuadro comparativo 2
 
Cliente web y servidor web
Cliente web y servidor webCliente web y servidor web
Cliente web y servidor web
 

Semelhante a Apache ha muerto, Viva Lighttpd

PHP.pdf PHP.pdf PHP.pdf PHP.pdf PHP.pdf PHP.pdf
PHP.pdf PHP.pdf PHP.pdf PHP.pdf PHP.pdf PHP.pdfPHP.pdf PHP.pdf PHP.pdf PHP.pdf PHP.pdf PHP.pdf
PHP.pdf PHP.pdf PHP.pdf PHP.pdf PHP.pdf PHP.pdf
Raaulroodriguez
 
Aspnet40 Cache Extensibility
Aspnet40 Cache ExtensibilityAspnet40 Cache Extensibility
Aspnet40 Cache Extensibility
Christian Strevel
 
Scripting para Pentesters v1.0
Scripting para Pentesters v1.0Scripting para Pentesters v1.0
Scripting para Pentesters v1.0
wcuestas
 

Semelhante a Apache ha muerto, Viva Lighttpd (20)

Curso de php
Curso de phpCurso de php
Curso de php
 
Performance en Drupal 7
Performance en Drupal 7Performance en Drupal 7
Performance en Drupal 7
 
Rendimiento extremo en php
Rendimiento extremo en phpRendimiento extremo en php
Rendimiento extremo en php
 
High performance Web Sites
High performance Web SitesHigh performance Web Sites
High performance Web Sites
 
Introducción a PHP5
Introducción a PHP5Introducción a PHP5
Introducción a PHP5
 
PHP.pdf PHP.pdf PHP.pdf PHP.pdf PHP.pdf PHP.pdf
PHP.pdf PHP.pdf PHP.pdf PHP.pdf PHP.pdf PHP.pdfPHP.pdf PHP.pdf PHP.pdf PHP.pdf PHP.pdf PHP.pdf
PHP.pdf PHP.pdf PHP.pdf PHP.pdf PHP.pdf PHP.pdf
 
ROA - Resource Oriented Architecture
ROA - Resource Oriented ArchitectureROA - Resource Oriented Architecture
ROA - Resource Oriented Architecture
 
Java 7- Java Day Guatemala
Java 7- Java Day GuatemalaJava 7- Java Day Guatemala
Java 7- Java Day Guatemala
 
Aspnet40 Cache Extensibility
Aspnet40 Cache ExtensibilityAspnet40 Cache Extensibility
Aspnet40 Cache Extensibility
 
Http al descubierto
Http al descubiertoHttp al descubierto
Http al descubierto
 
Http al descubierto
Http al descubiertoHttp al descubierto
Http al descubierto
 
Sacándole el jugo a apache
Sacándole el jugo a apacheSacándole el jugo a apache
Sacándole el jugo a apache
 
Scripting para Pentesters v1.0
Scripting para Pentesters v1.0Scripting para Pentesters v1.0
Scripting para Pentesters v1.0
 
Hacking uploaders
Hacking uploadersHacking uploaders
Hacking uploaders
 
Symfony2: Optimización y rendimiento
Symfony2: Optimización y rendimientoSymfony2: Optimización y rendimiento
Symfony2: Optimización y rendimiento
 
Bulma 441
Bulma 441Bulma 441
Bulma 441
 
PHP IUTE
PHP IUTEPHP IUTE
PHP IUTE
 
Plone en La Jornada
Plone en La JornadaPlone en La Jornada
Plone en La Jornada
 
PHP en el 2015
PHP en el 2015PHP en el 2015
PHP en el 2015
 
DiseñO Pagina Web
DiseñO Pagina WebDiseñO Pagina Web
DiseñO Pagina Web
 

Último

senati-powerpoint_5TOS-_ALUMNOS (1).pptx
senati-powerpoint_5TOS-_ALUMNOS (1).pptxsenati-powerpoint_5TOS-_ALUMNOS (1).pptx
senati-powerpoint_5TOS-_ALUMNOS (1).pptx
nathalypaolaacostasu
 
SENTENCIA COLOMBIA DISCRIMINACION SELECCION PERSONAL.pdf
SENTENCIA COLOMBIA DISCRIMINACION SELECCION PERSONAL.pdfSENTENCIA COLOMBIA DISCRIMINACION SELECCION PERSONAL.pdf
SENTENCIA COLOMBIA DISCRIMINACION SELECCION PERSONAL.pdf
JaredQuezada3
 
Comparativo DS 024-2016-EM vs DS 023-2017-EM - 21.08.17 (1).pdf
Comparativo DS 024-2016-EM vs DS 023-2017-EM - 21.08.17 (1).pdfComparativo DS 024-2016-EM vs DS 023-2017-EM - 21.08.17 (1).pdf
Comparativo DS 024-2016-EM vs DS 023-2017-EM - 21.08.17 (1).pdf
AJYSCORP
 
3ro - Semana 1 (EDA 2) 2023 (3).ppt. edx
3ro - Semana 1 (EDA 2) 2023 (3).ppt. edx3ro - Semana 1 (EDA 2) 2023 (3).ppt. edx
3ro - Semana 1 (EDA 2) 2023 (3).ppt. edx
Evafabi
 

Último (20)

implemenatcion de un data mart en logistica
implemenatcion de un data mart en logisticaimplemenatcion de un data mart en logistica
implemenatcion de un data mart en logistica
 
DERECHO EMPRESARIAL - SEMANA 01 UNIVERSIDAD CESAR VALLEJO
DERECHO EMPRESARIAL - SEMANA 01 UNIVERSIDAD CESAR VALLEJODERECHO EMPRESARIAL - SEMANA 01 UNIVERSIDAD CESAR VALLEJO
DERECHO EMPRESARIAL - SEMANA 01 UNIVERSIDAD CESAR VALLEJO
 
DECRETO-2535-DE-1993-pdf.pdf VIGILANCIA PRIVADA
DECRETO-2535-DE-1993-pdf.pdf VIGILANCIA PRIVADADECRETO-2535-DE-1993-pdf.pdf VIGILANCIA PRIVADA
DECRETO-2535-DE-1993-pdf.pdf VIGILANCIA PRIVADA
 
Sostenibilidad y continuidad huamcoli robin-cristian.pptx
Sostenibilidad y continuidad huamcoli robin-cristian.pptxSostenibilidad y continuidad huamcoli robin-cristian.pptx
Sostenibilidad y continuidad huamcoli robin-cristian.pptx
 
____ABC de las constelaciones con enfoque centrado en soluciones - Gabriel de...
____ABC de las constelaciones con enfoque centrado en soluciones - Gabriel de...____ABC de las constelaciones con enfoque centrado en soluciones - Gabriel de...
____ABC de las constelaciones con enfoque centrado en soluciones - Gabriel de...
 
Manual para las 3 clases de tsunami de ventas.pdf
Manual para las 3 clases de tsunami de ventas.pdfManual para las 3 clases de tsunami de ventas.pdf
Manual para las 3 clases de tsunami de ventas.pdf
 
senati-powerpoint_5TOS-_ALUMNOS (1).pptx
senati-powerpoint_5TOS-_ALUMNOS (1).pptxsenati-powerpoint_5TOS-_ALUMNOS (1).pptx
senati-powerpoint_5TOS-_ALUMNOS (1).pptx
 
Presentacion encuentra tu creatividad papel azul.pdf
Presentacion encuentra tu creatividad papel azul.pdfPresentacion encuentra tu creatividad papel azul.pdf
Presentacion encuentra tu creatividad papel azul.pdf
 
SENTENCIA COLOMBIA DISCRIMINACION SELECCION PERSONAL.pdf
SENTENCIA COLOMBIA DISCRIMINACION SELECCION PERSONAL.pdfSENTENCIA COLOMBIA DISCRIMINACION SELECCION PERSONAL.pdf
SENTENCIA COLOMBIA DISCRIMINACION SELECCION PERSONAL.pdf
 
DISEÑO DE ESTRATEGIAS EN MOMENTOS DE INCERTIDUMBRE
DISEÑO DE ESTRATEGIAS EN MOMENTOS DE INCERTIDUMBREDISEÑO DE ESTRATEGIAS EN MOMENTOS DE INCERTIDUMBRE
DISEÑO DE ESTRATEGIAS EN MOMENTOS DE INCERTIDUMBRE
 
2024 - 04 PPT Directiva para la formalizacion, sustento y registro del gasto ...
2024 - 04 PPT Directiva para la formalizacion, sustento y registro del gasto ...2024 - 04 PPT Directiva para la formalizacion, sustento y registro del gasto ...
2024 - 04 PPT Directiva para la formalizacion, sustento y registro del gasto ...
 
ADMINISTRACIÓN DE CUENTAS POR COBRAR CGSR.pptx
ADMINISTRACIÓN DE CUENTAS POR COBRAR CGSR.pptxADMINISTRACIÓN DE CUENTAS POR COBRAR CGSR.pptx
ADMINISTRACIÓN DE CUENTAS POR COBRAR CGSR.pptx
 
Comparativo DS 024-2016-EM vs DS 023-2017-EM - 21.08.17 (1).pdf
Comparativo DS 024-2016-EM vs DS 023-2017-EM - 21.08.17 (1).pdfComparativo DS 024-2016-EM vs DS 023-2017-EM - 21.08.17 (1).pdf
Comparativo DS 024-2016-EM vs DS 023-2017-EM - 21.08.17 (1).pdf
 
Caja nacional de salud 0&!(&:(_5+:;?)8-!!(
Caja nacional de salud 0&!(&:(_5+:;?)8-!!(Caja nacional de salud 0&!(&:(_5+:;?)8-!!(
Caja nacional de salud 0&!(&:(_5+:;?)8-!!(
 
TEORÍAS DE LA MOTIVACIÓN Recursos Humanos.pptx
TEORÍAS DE LA MOTIVACIÓN Recursos Humanos.pptxTEORÍAS DE LA MOTIVACIÓN Recursos Humanos.pptx
TEORÍAS DE LA MOTIVACIÓN Recursos Humanos.pptx
 
Fabricación de Cremas en Industria Farmacéutica
Fabricación de Cremas en Industria FarmacéuticaFabricación de Cremas en Industria Farmacéutica
Fabricación de Cremas en Industria Farmacéutica
 
Analisis del art. 37 de la Ley del Impuesto a la Renta
Analisis del art. 37 de la Ley del Impuesto a la RentaAnalisis del art. 37 de la Ley del Impuesto a la Renta
Analisis del art. 37 de la Ley del Impuesto a la Renta
 
2 Tipo Sociedad comandita por acciones.pptx
2 Tipo Sociedad comandita por acciones.pptx2 Tipo Sociedad comandita por acciones.pptx
2 Tipo Sociedad comandita por acciones.pptx
 
3ro - Semana 1 (EDA 2) 2023 (3).ppt. edx
3ro - Semana 1 (EDA 2) 2023 (3).ppt. edx3ro - Semana 1 (EDA 2) 2023 (3).ppt. edx
3ro - Semana 1 (EDA 2) 2023 (3).ppt. edx
 
4 Tipos de Empresa Sociedad colectiva.pptx
4 Tipos de Empresa Sociedad colectiva.pptx4 Tipos de Empresa Sociedad colectiva.pptx
4 Tipos de Empresa Sociedad colectiva.pptx
 

Apache ha muerto, Viva Lighttpd

  • 1. Apache ha muerto Viva LIGHTTPD! [email_address] * No creo realmente que el Apache haya muerto, pero si que ahora hay mas opciones, algunas mucho mas interesantes, como Lighty. El titulo de la presentacion es para provocar, nomas.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11. 1 servidor HTTP, 3 servidores PHP FastCGI FastCGI FastCGI HTTP
  • 12.
  • 13. Un servidor por &quot;zona&quot; $HTTP[&quot;url&quot;] =~ &quot; ^/forum &quot; { proxy-core.protocol = &quot;fastcgi&quot; proxy-core.backends = ( &quot; 10.0.0.1:1000 &quot;) } $HTTP[&quot;url&quot;] =~ &quot; ^/torrents &quot; { proxy-core.protocol = &quot;fastcgi&quot; proxy-core.backends = ( &quot; 10.0.0.99:1000 &quot;) }
  • 14.
  • 15. Distribuyendo la carga $HTTP[&quot;url&quot;] =~ &quot;php$&quot; { proxy-core.protocol = &quot;fastcgi&quot; proxy-core.backends = ( &quot;10.0.0.1:1000&quot; ) } else $HTTP[&quot;url&quot;] =~ &quot;^/images/[0-4]/&quot; { proxy-core.protocol = &quot;http&quot; proxy-core.backends = ( &quot;10.0.0.2:80&quot; ) } else $HTTP[&quot;url&quot;] =~ &quot;^/images/[5-9]/&quot; { proxy-core.protocol = &quot;http&quot; proxy-core.backends = ( &quot;10.0.0.3:80&quot; ) } The web is a pipe!
  • 16.
  • 17.
  • 18.
  • 19.
  • 20. Un archivo al azar En PHP, PHP+X-Sendfile y LUA <?php header(&quot;Content-Type: image/png&quot;); print file_get_contents(&quot;imgs/&quot;.rand(0,9).&quot;.png&quot;); <?php header(&quot;Content-Type: image/png&quot;); header(&quot;X-Sendfile: &quot;.getcwd(). &quot;/imgs/&quot;.rand(0,9).&quot;.png&quot;); lighty.env[&quot;request.uri&quot;]=&quot;/imgs/&quot; .. math.random(9) .. &quot;.png&quot; return lighty.RESTART_REQUEST
  • 21.
  • 22.
  • 23. magnet: cache html Guardar el output HTML en el archivo temporal: <?php function cache_html(){ function write_html($text){ $info = stat($_SERVER[&quot;SCRIPT_FILENAME&quot;]); file_put_contents(&quot;/tmp/&quot;.$info['ino'].&quot;.html&quot;,$text); return false; } ob_start(&quot;write_html&quot;); }
  • 24. magnet: cache html Devolver el contenido del archivo temporal si existe y terminar la ejecucion (PHP): <?php function show_cached(){ $info = stat($_SERVER[&quot;SCRIPT_FILENAME&quot;]); $cache_file = &quot;/tmp/&quot;.$info['ino'].&quot;.html&quot;; if (file_exists($cache_file)){ print file_get_contents($cache_file); exit; } }
  • 25. magnet: cache html Devolver el contenido del archivo temporal si existe y terminar la ejecucion (LUA): info = lighty.stat(lighty.env[&quot;physical.path&quot;]) cache_path = &quot;/tmp/&quot;..info[&quot;st_ino&quot;]..&quot;.html&quot; cache_info = lighty.stat(cache_path) if (cache_info) then lighty.env[&quot;physical.path&quot;] = cache_path end
  • 26.
  • 27.