martes, 25 de junio de 2013

Fedora 18: Job for httpd.service failed (Resuelto)

Al intentar iniciar el servicio httpd en Fedora 18 nos damos cuenta que aunque el mismo no puede ser iniciado directamente por systemctl, el comando service lo envía a este para su configuración y posterior arranque. Lamentablemente, al menos en mi caso, systemctl no puede iniciarlo y devuelve el siguiente mensaje de error en la salida estándar.

[root@rainbow ~]# service httpd start
Redirecting to /bin/systemctl start  httpd.service
Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.

Al consultar los detalles como sugiere el mensaje, obtenemos lo siguiente.

[root@rainbow ~]# systemctl status httpd.service 
httpd.service - The Apache HTTP Server

   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
   Active: failed (Result: exit-code) since Tue 2013-06-25 13:34:14 AST; 6min ago
  Process: 19610 ExecStop=/usr/sbin/httpd $OPTIONS -k graceful-stop (code=exited, status=0/SUCCESS)
  Process: 19607 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"

Jun 25 13:34:12 rainbow httpd[19607]: AH00557: httpd: apr_sockaddr_info_get() failed for rainbow
Jun 25 13:34:12 rainbow httpd[19607]: AH00558: httpd: Could not reliably determine the server's fully qualified dom...essage
Jun 25 13:34:14 rainbow systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jun 25 13:34:14 rainbow httpd[19610]: AH00557: httpd: apr_sockaddr_info_get() failed for rainbow
Jun 25 13:34:14 rainbow httpd[19610]: AH00558: httpd: Could not reliably determine the server's fully qualified dom...essage
Jun 25 13:34:14 rainbow httpd[19610]: httpd (no pid file) not running
Jun 25 13:34:14 rainbow systemd[1]: Failed to start The Apache HTTP Server.
Jun 25 13:34:14 rainbow systemd[1]: Unit httpd.service entered failed state.

De todo este datalle, lo que nos da una pista para la solución del proble es la línea: Jun 25 13:34:14 rainbow httpd[19610]: AH00558: httpd: Could not reliably determine the server's fully qualified dom...essage

Esto se debe a que para su correcto funcionamiento httpd necesita que el nombre de host o hostname de nuestro sistema esté en un dominio, aunque este realmente no exista. Durante la instalación del sistema es posible especificar el dominio en el hostname, pero como casi siempre no formamos parte de un dominio, en hostname solo ponemos un nombre, ej. rainbow. En vez de rainbow.local, rainbow.mydomain.local, etc.

Pero en fin. La solución está precisamente en el hostname sin dominio, por lo que procedermos a colocar el mismo a nuestro hostname. En mi caso solo podré .local. Para los que están en un dominio real ya deben tenerlo, pero en caso que no, solo poner el nombre de su dominio como en los ejemplos anteriores.

[root@rainbow ~]# echo 'rainbow.local' > /etc/hostname 

Ahora podemos iniciar httpd y lo hará normalmente.

[root@rainbow ~]# service httpd start
Redirecting to /bin/systemctl start  httpd.service
[root@rainbow ~]# service httpd status
Redirecting to /bin/systemctl status  httpd.service

httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
   Active: active (running) since Tue 2013-06-25 13:48:47 AST; 2min 42s ago
  Process: 19610 ExecStop=/usr/sbin/httpd $OPTIONS -k graceful-stop (code=exited, status=0/SUCCESS)
 Main PID: 19775 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: name=systemd:/system/httpd.service
           ├─19775 /usr/sbin/httpd -DFOREGROUND
           ├─19776 /usr/sbin/httpd -DFOREGROUND
           ├─19777 /usr/sbin/httpd -DFOREGROUND
           ├─19778 /usr/sbin/httpd -DFOREGROUND
           ├─19779 /usr/sbin/httpd -DFOREGROUND
           └─19780 /usr/sbin/httpd -DFOREGROUND

Jun 25 13:48:45 rainbow.local httpd[19775]: AH00558: httpd: Could not reliably determine the server's fully qualifie...ssage
Jun 25 13:48:47 rainbow.local systemd[1]: Started The Apache HTTP Server.


Artículos relacionados



Widget by Hoctro | Jack Book

0 comments:

Publicar un comentario