Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

157
Vistas
Apache virtual host not receiving request

I have a Raspberry Pi with Apache 2.4 running on it. I have a site: www.mysite.nl which I want to host on the Pi.

I have created a virtual host with the following code:

<VirtualHost *:80> 
ServerName mysite.nl 
ServerAlias www.mysite.nl
DocumentRoot /var/www/mysite.nl/public_html
ErrorLog ${APACHE_LOG_DIR}/mysite.nl_error.log
CustomLog ${APACHE_LOG_DIR}/mysite.nl_access.log combined
</VirtualHost>

I have resolved the DNS to point at my router's public IP, and since my ISP provides static IP this shouldn't be an issue, and I have forwarded port 80 on the router to the static IP of the Raspberry Pi, 192.168.2.23. I have made sure that Apache listens on port 80.

I have enabled the site with a2ensite and disabled the default virtual host config file. But when I go to www.mysite.nl my browser will timeout and apache seems to fail to serve the site. If I check my access log I see nothing (0 lines of information), which tells me that the connection never arrived. Also nothing in the error log.

I have double-checked my DNS to point at the public IP of my router, but I have no clue where this goes wrong. I would like to receive information where it can wrong so that if I go to mysite.nl it will serve the index.html in /var/www/mysite.nl/public_html

Edit: Adding 192.168.2.23 mysite.nl to the host file works for PC inside network, but using an IP outside the network still wouldn't let me connect with mysite.nl. So Apache does serve web page, but not for external IP

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Most routers will not like that.

The path would go from your internal pc, to your router, then back in to the pi.

Try adding www.mysite,nl with its internal ip address to your hosts file.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda