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

384
Vistas
localhost doesn't work, after setup Virtualhosts

I think I made a rookie mistake. But can't fix it.

I set up two VirtualHosts in httpd. Content, each index.html, is located at /www/docs/Domain1 and ../Domain2 The .conf files from the two domains are located in /etc/httpd/conf.d/domain1.conf and /domain2.conf.

httpd.conf is adapted accordingly.

I expanded /etc/hosts with:

192.168.167.64 sales.test.pri sales 192.168.167.64 account.test.pri account

http://sales.test.pri and http://account.test.pri in browser works. The correct content is displayed.

With http://localhost or http://192.168.167.64, I still get the content from one of the VirtualHosts. Usually the content of /var/www/html/index.html should appear. That worked before setting up vHosts.

What am I doing wrong?

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

0

Apache will decide which VirtualHost to use with the IP, Port or domain name.

If it cannot match any VirtualHost, it will use the default one.

The default one is the first one it finds, as it reads the config file from top to bottom. So add another VirtualHost on top that points to /var/www/html/index.html. Or create a new VirtualHost for localhost of the IP address.

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