lunes, 14 de abril de 2014

LINUX-workaround xampp message "RSA server certificate CommonName (CN) `localhost' does NOT match server name"

Recientemente he instalado xampp versión 1.5.X en un server para realizar un backup a una wiki.
Los pasos de instalación de xampp para esta versión son sencillos. Sin embargo, al momento de levantar la aplicación, el servicio apache no se inicia exitosamente.

[root@localhost lampp]# /opt/lampp/lampp start
Starting XAMPP for Linux 1.5.4...
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Starting MySQL...
XAMPP: Starting ProFTPD...
XAMPP for Linux started.
[root@localhost lampp]# /opt/lampp/lampp status
Version: XAMPP for Linux 1.5.4
Apache is not running.
MySQL is running.
ProFTPD is running.
[root@localhost lampp]# 

Esto se evidencia cuando se intenta acceder al sitio http://localhost/xampp y la página de inicio no se carga correctamente.

Revisando el log de xampp, se despliega el siguiente mensaje de error:
[root@localhost ~]# tail -f /opt/lampp/logs/error_log 
[Mon Apr 14 10:05:45 2014] [notice] suEXEC mechanism enabled (wrapper: /opt/lampp/bin/suexec)
[Mon Apr 14 10:05:45 2014] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Apr 14 10:05:45 2014] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?

Luego de googlear en muchos foros, no encontré ninguna solución válida para mi problema, ya que este mensaje se puede referir a varias causas, entre ellas, una mala configuración del archivo /etc/hostnames, o el firewall del server (iptables). 

Después de varias lecturas en distintos foros, entendí que este mensaje de error se origina porque el certificado ssl utilizado por el servicio apache no esta correctamente firmado para el servidor en el cual se está levantando.

La solución definitva es generar nuevamente el certificado en el server para que sea correctamente reconocido y así el servicio se inicie correctamente.

Sin embargo, existe un workaround o solución de contingencia válido para este tipo de error, y que consiste en deshabilitar el levantamiento del módulo SSL en el servicio apache. Por supuesto que esto genera un riesgo en la seguridad del servicio apache. Pero si estamos en un ambiente de pruebas en muchos casos, no es importante ni imperativo mantener altos niveles de seguridad.

Por lo tanto, para deshabilitar el módulo SSL en el servicio apache se debe editar el comando de levantamiento del servicio que se encuentra de la shell /opt/lampp/lampp

[root@localhost lampp]# vi /opt/lampp/lampp

De esta forma se debe buscar la siguiente línea donde se comanda el inicio del servicio apache y se quita el atributo SSL.

Línea original:
/opt/lampp/bin/apachectl -k start -DSSL $xampp_apachedefine > /dev/null 2> /opt/lampp/logs/apachestart.log

Eliminar el atributo "-DSSL" para que quede de la siguiente forma:
/opt/lampp/bin/apachectl -k start $xampp_apachedefine > /dev/null 2> /opt/lampp/logs/apachestart.log

De esta forma al iniciar nuevamente todo xampp, se levanta el servicio apache también.
[root@localhost lampp]# /opt/lampp/lampp start
Starting XAMPP for Linux 1.5.4...
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Starting MySQL...
XAMPP: Starting ProFTPD...
XAMPP for Linux started.
[root@localhost lampp]# /opt/lampp/lampp status
Version: XAMPP for Linux 1.5.4
Apache is running.
MySQL is running.
ProFTPD is running.
[root@localhost lampp]# 

[root@localhost ~]# tail -f /opt/lampp/logs/error_log 
[Mon Apr 14 11:07:26 2014] [notice] suEXEC mechanism enabled (wrapper: /opt/lampp/bin/suexec)
[Mon Apr 14 11:07:26 2014] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Mon Apr 14 11:07:27 2014] [notice] Digest: generating secret for digest authentication ...
[Mon Apr 14 11:07:36 2014] [notice] Digest: done
[Mon Apr 14 11:07:37 2014] [notice] Apache/2.2.3 (Unix) DAV/2 mod_ssl/2.2.3 OpenSSL/0.9.8c PHP/5.1.6 mod_apreq2-20051231/2.5.7 mod_perl/2.0.2 Perl/v5.8.7 configured -- resuming normal operations

No hay comentarios:

Publicar un comentario