#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    37
    Rep Power
    3

    Strange Apache problem.. localhost don't work localhost.dev does!


    Hello,
    so I tried adding another virtualhost (dan) to C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\extra\httpd-vhosts.conf, and adding 127.0.0.1 and localhost.dan to my HOSTS file.

    So, it didn't work. And I tried loading my other 2 hosts: localhost and localhost.dev. Localhost.dev works when I load it in any web browser. My problem is that localhost doesn't work. It says:
    Code:
    No connection could be made because the target machine actively refused it.
    I don't understand why localhost.dev works but localhost doesn't. So I would really appreciate any help on this, as my apache knowledge is extremely limited.

    HOSTS file:
    Code:
    127.0.0.1 localhost
    127.0.0.1 localhost.dev
    httpd-vhosts.conf
    Code:
    <VirtualHost *:80>
      DocumentRoot E:/Documents/website
      ServerName localhost
    </VirtualHost>
    
    <VirtualHost *:80>
      DocumentRoot E:\Documents\dev_website
      ServerName localhost.dev
    </VirtualHost>
    Cheers,
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    37
    Rep Power
    3
    Solved.

    It turns out that because I have Apache and MySQL services starting manually, localhost didn't load because it is MySQL driven. So, simply starting MySQL solved the problem, and I've also added the extra virtual host.

IMN logo majestic logo threadwatch logo seochat tools logo