Archivos por Etiqueta: apache

Apache: PROXY protocol for Amazon ELB (Elastic Load Balancing)

If you want to use Apache 2.2 / 2.4 behind a Amazon ELB (Elastic Load Balancing), HAproxy, Stunnel, Stud o anything similar, you will have seen that in the logs appears IP of ELB instead of the remote client, and filter by IP is a double problem.

The module “remoteip” does not solve the problem. Amazon ELB, HAProxy and others support “PROXY protocol”, that helps to fix this issues working behind proxys.

The protocol look similar to:

PROXY TCP4 10.1.2.3 192.168.0.11 56324 443\r\n
GET / HTTP/1.1\r\n
Host: www.acme.com\r\n
Accept: */*\r\n
Connection: close\r\n
\r\n

But Apache currently does not support out-of-the-box. So following the philosophy of Do-It-Yourself, here is the source code (beta):

mod_myfixip.c in Github (for Apache 2.4)
mod_myfixip.c in Github (for Apache 2.2)

UPDATE (2015.01.17): Seems that AWS-ELB don’t always send PROXY header in only one packet / TCP-frame (in some cases data is received fragmented, now the module handle this behavior).

References:
ElasticLoadBalancing: Enable Proxy Protocol
PROXY protocol

Java: Could not generate DH keypair

Si te aparece este error, sigue leyendo…

javax.net.ssl.SSLException: java.lang.RuntimeException: Could not generate DH keypair
        at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:190)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1762)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1723)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1706)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1237)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1214)
        at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:133)

Leer más de esta entrada

Java: Collections

Algunas librerias muy buenas para la gestion de Colecciones en Java { Maps, Queues, Lists, Sorted, Native Types, Iterables with predicate (callbacks), Structures, Unions, Hashes, BloomFilters, IO-Utils… y más }. Algunas centradas en la optimización del uso de memoria, otras en velocidad y otras añadiendo funcionalidad a las java.util standard, todas ellas Open Source:

Maven: Primeros pasos

Los primero es lo primero… RTFM ;-)

Introducción a Maven 2 (Español)

Nuevas características de Maven 3 (Español)

Usando Plugins (Español)

Más documentacion de Maven (Ingles):

  • Maven: The Complete Reference [enlace]
  • Maven by Example[enlace]
  • Maven Cookbook [enlace]
  • Developing with Eclipse and Maven [enlace]
  • Repository Management with Nexus [enlace]
  • In/compatibilidades entre Maven 2 y 3 [enlace]
A %d blogueros les gusta esto: