elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Arreglado, de nuevo, el registro del warzone (wargame) de EHN


+  Foro de elhacker.net
|-+  Sistemas Operativos
| |-+  GNU/Linux (Moderador: MinusFour)
| | |-+  apache virtualhosts no funcionan (Failed to start Network Name Resolution)
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: apache virtualhosts no funcionan (Failed to start Network Name Resolution)  (Leído 2,745 veces)
gAb1


Desconectado Desconectado

Mensajes: 731


Ver Perfil
apache virtualhosts no funcionan (Failed to start Network Name Resolution)
« en: 2 Agosto 2016, 00:53 am »

Hola, estoy intentando configurar un servidor web apache con virtualhosts pero la configuración que tengo no funciona correctamente.

Estoy en arch linux por lo que el document root es /srv/http. He creado varios archivos para cada dominio/subdominios (vhost) para tener la configuración bien organizada y poder activar/desactivar facilmente cada uno desde el httpd.conf. El archivo conf/extra/httpd-vhosts.conf solo tiene un bloque * con un documentroot a /srv/http/default (por si accedes usando los name servers que se muestre la página default).

El problema es que todos los dominios/subdominios llevan al document root de apache, que es /srv/http, en lugar del document root del dominio, especificado en cada bloque <VirtualHosts> correspondiente. Por lo que cuando accedo con el dominio o subdominio, se muestra /srv/http y puedo navegar por todas las carpetas de cada dominio/subdominio e incluso las carpetas que deberían ser privadas, como framework o files (desde la barra escribiendo los nombres).

La configuración de apache importante es la siguiente:

Código
  1. DocumentRoot "/srv/http"
  2. <Directory "/srv/http">
  3.    Options -Indexes +FollowSymLinks
  4.  
  5.    AllowOverride None
  6.  
  7.    Require all granted
  8. </Directory>
  9.  
  10. ...
  11.  
  12. # Virtual hosts
  13. Include conf/extra/httpd-vhosts.conf
  14. # Enabled Vhosts
  15. Include conf/vhosts/domain.dom
  16. Include conf/vhosts/sub1.domain.dom
  17. Include conf/vhosts/sub2.domain.dom

Si comento #Require all granted o lo cambio a all denied da error 403... ¿como hago para que no sea accesible el documentroot mediante el navegador?

Asi són los bloques <VirtualHosts>, uno para el puerto 80 (http) y otro exactamente igual, incluyendo la configuración SSL, para el puerto 443 (https):

Código
  1. # conf/extra/httpd-vhosts.conf
  2. <VirtualHost *>
  3.    ServerName default.localhost
  4.    DocumentRoot "/srv/http/default"
  5. </VirtualHost>
  6.  
  7. # conf/vhosts/domain.dom
  8. <VirtualHost domain:80>
  9.    ### Igual que abajo pero sin la configuración SSL
  10. </VirtualHost>
  11.  
  12. <VirtualHost domain.com:443>
  13.    ServerAdmin webmaster@domain.com
  14.    DocumentRoot "/srv/http/domain.com/www"
  15.    ServerName domain.com:443
  16.    ServerAlias www.domain.com:443
  17.    Protocols h2 h2c
  18.  
  19.    <Directory "/srv/http/domain.com/www">
  20.        Require all granted
  21.  
  22.        <IfModule mod_rewrite.c>
  23.            RewriteEngine On
  24.            RewriteBase /
  25.            RewriteCond %{REQUEST_FILENAME} !-d
  26.            RewriteCond %{REQUEST_FILENAME} !-f
  27.            RewriteRule ^index\.php$ - [L]
  28.            RewriteRule . index.php [L]
  29.        </IfModule>
  30.    </Directory>
  31.  
  32.    <IfModule dir_module>
  33.        DirectoryIndex index.php
  34.    </IfModule>
  35.  
  36.    #SSLEngine on
  37.    #SSLCertificateFile "/etc/httpd/conf/apache.crt"
  38.    #SSLCertificateKeyFile "/etc/httpd/conf/apache.key"
  39.    ErrorLog "/var/log/httpd/domain.com-error_log"
  40.    CustomLog "/var/log/httpd/domain.com-access_log" common
  41. </VirtualHost>

Gracias.


« Última modificación: 3 Agosto 2016, 16:56 pm por gAb1 » En línea

gAb1


Desconectado Desconectado

Mensajes: 731


Ver Perfil
Re: configuración apache y virtualhosts no funciona
« Respuesta #1 en: 3 Agosto 2016, 16:53 pm »

Vale, es posible que sea un problema con un servicio del sistema (systemd-resolved) que no se incia correctamente:

Citar
# systemctl status systemd-resolved.service
● systemd-resolved.service - Network Name Resolution
Loaded: loaded (/etc/systemd/system/systemd-resolved.service; enabled; vendor preset: enabled)
Active: failed (Result: start-limit-hit) since Tue 2016-08-02 23:39:01 UTC; 1h 5min ago
Docs: man:systemd-resolved.service(8)
Process: 3455 ExecStart=/usr/lib/systemd/systemd-resolved (code=exited, status=1/FAILURE)
Main PID: 3455 (code=exited, status=1/FAILURE)
Status: "Shutting down..."

Aug 02 23:39:01 scw-28a908 systemd[1]: Failed to start Network Name Resolution.
Aug 02 23:39:01 scw-28a908 systemd[1]: systemd-resolved.service: Unit entered failed state.
Aug 02 23:39:01 scw-28a908 systemd[1]: systemd-resolved.service: Failed with result 'exit-code'.
Aug 02 23:39:01 scw-28a908 systemd[1]: systemd-resolved.service: Service has no hold-off time, scheduling restart.
Aug 02 23:39:01 scw-28a908 systemd[1]: Stopped Network Name Resolution.
Aug 02 23:39:01 scw-28a908 systemd[1]: systemd-resolved.service: Start request repeated too quickly.
Aug 02 23:39:01 scw-28a908 systemd[1]: Failed to start Network Name Resolution.
Aug 02 23:39:01 scw-28a908 systemd[1]: systemd-resolved.service: Unit entered failed state.
Aug 02 23:39:01 scw-28a908 systemd[1]: systemd-resolved.service: Failed with result 'start-limit-hit'.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

-- Subject: Unit systemd-resolved.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li ... temd-devel
--
-- Unit systemd-resolved.service has begun starting up.
Aug 03 00:50:21 scw-28a908 systemd-resolved[3752]: Failed to increase capabilities: Operation not permitted
Aug 03 00:50:21 scw-28a908 systemd[1]: systemd-resolved.service: Main process exited, code=exited, status=1/FAILURE
Aug 03 00:50:21 scw-28a908 systemd[1]: Failed to start Network Name Resolution.
-- Subject: Unit systemd-resolved.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li ... temd-devel
--
-- Unit systemd-resolved.service has failed.
--
-- The result is failed.
Aug 03 00:50:21 scw-28a908 systemd[1]: systemd-resolved.service: Unit entered failed state.
Aug 03 00:50:21 scw-28a908 systemd[1]: systemd-resolved.service: Failed with result 'exit-code'.
Aug 03 00:50:21 scw-28a908 systemd[1]: systemd-resolved.service: Service has no hold-off time, scheduling restart.
Aug 03 00:50:21 scw-28a908 systemd[1]: Stopped Network Name Resolution.
-- Subject: Unit systemd-resolved.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li ... temd-devel
--
-- Unit systemd-resolved.service has finished shutting down.
Aug 03 00:50:21 scw-28a908 systemd[1]: Starting Network Name Resolution...
-- Subject: Unit systemd-resolved.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li ... temd-devel
--
-- Unit systemd-resolved.service has begun starting up.
Aug 03 00:50:21 scw-28a908 systemd-resolved[3756]: Failed to increase capabilities: Operation not permitted
Aug 03 00:50:21 scw-28a908 systemd[1]: systemd-resolved.service: Main process exited, code=exited, status=1/FAILURE
Aug 03 00:50:21 scw-28a908 systemd[1]: Failed to start Network Name Resolution.

El problema empezó justo despues actualizar el sistema por primera vez, la imagen (iso) tiene unos 2 meses creo, y claro habian varias actualizaciones. Fue reiniciar y empezar los problemas.

¿Alguna idea por qué ocurre esto?

Gracias.


« Última modificación: 3 Agosto 2016, 16:58 pm por gAb1 » En línea

gAb1


Desconectado Desconectado

Mensajes: 731


Ver Perfil
Re: apache virtualhosts no funcionan (Failed to start Network Name Resolution)
« Respuesta #2 en: 10 Agosto 2016, 05:19 am »

Solucionado con la ultima versión de systemd (231) https://github.com/systemd/systemd/issues/3484#issuecomment-239595447
« Última modificación: 14 Agosto 2016, 13:46 pm por gAb1 » En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Amarok 2.4.1 “Resolution”
Noticias
wolfbcn 0 1,222 Último mensaje 9 Mayo 2011, 12:59 pm
por wolfbcn
instalacion apache... en la casilla network domain puse asdf ...
Desarrollo Web
jhonatanAsm 2 2,050 Último mensaje 27 Mayo 2012, 04:48 am
por jhonatanAsm
Servicio no-ip, virtualhosts y entorno lamp virtualizado desde W7
Redes
Littl3 3 2,266 Último mensaje 31 Marzo 2013, 18:00 pm
por HdM
Ayuda con VirtualHosts en Debian
GNU/Linux
sagmont 3 1,922 Último mensaje 3 Abril 2014, 23:43 pm
por dato000
Problema de conexión virtualbox. (activation of network connection failed)
Hacking Wireless
TheFerret 1 2,168 Último mensaje 6 Abril 2019, 05:34 am
por orion999
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines