Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

385
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!