Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

394
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda