0

I had an older version on XAMPP and it was working fine. I uninstalled it to install the new version.Since then local host has stopped working. XAMPP control panel says Apache and MySQL running.Can some one help please? I have got this in the httpd-vhosts.conf,do i make any changes here?

##<VirtualHost *:80>
    ##ServerAdmin postmaster@dummy-host.localhost
    ##DocumentRoot "C:/xampp/htdocs/dummy-host.localhost"
    ##ServerName dummy-host.localhost
    ##ServerAlias www.dummy-host.localhost
    ##ErrorLog "logs/dummy-host.localhost-error.log"
    ##CustomLog "logs/dummy-host.localhost-access.log" combined
##</VirtualHost>

##<VirtualHost *:80>
    ##ServerAdmin postmaster@dummy-host2.localhost
    ##DocumentRoot "C:/xampp/htdocs/dummy-host2.localhost"
    ##ServerName dummy-host2.localhost
    ##ServerAlias www.dummy-host2.localhost
    ##ErrorLog "logs/dummy-host2.localhost-error.log"
    ##CustomLog "logs/dummy-host2.localhost-access.log" combined
##</VirtualHost>

Thank You

manraj82
  • 5,929
  • 24
  • 56
  • 83
  • what you get when visit this page [http://localhost](http://localhost/) can you access it via going to 127.0.0.1 ? – Muntasir Mar 20 '11 at 22:10
  • Ive had skype installed while i had the earlier versio.But I still went to Skype>tools>options>advanced>connections>unchecked use port 80 and 443 alternatives for incoming connections – manraj82 Mar 20 '11 at 22:10
  • @Muntasir wow its working in 127.0.0.1 !! thanks for that but why didnt it work on localhost? am i doing something wrong?? – manraj82 Mar 20 '11 at 22:12
  • when i visit the page http://localhost/ i get "Internet Explorer cannot display the webpage" – manraj82 Mar 20 '11 at 22:14

2 Answers2

0

As you can access it using 127.0.0.1 and not 'localhost', locate httpd-vhosts.conf, usually in C:/xampp/apache/conf/extra/ and make sure you have the following listed as a virtual host:

  <VirtualHost *>
    DocumentRoot "C:\xampp\htdocs"
    ServerName localhost
  </VirtualHost>

Then restart Apache from the XAMPP control panel.

Kit
  • 4,095
  • 7
  • 39
  • 62
  • i have posted the listing in the httpd-vhosts.conf i have above,could you please tell me where i need to make the changes? – manraj82 Mar 20 '11 at 22:24
  • @manraj82 - Yeah, paste the lines in my answer at the end of the `httpd-vhosts.conf`. The existing lines are just examples commented out with a `##`. Restart Apache from the Xammp control and see if it works. – Kit Mar 20 '11 at 22:27
  • Sorry mate no luck,did exactly like u said but not working.still working in 127.0.0.1 – manraj82 Mar 20 '11 at 22:34
  • You could also try making sure the DocumentRoot is pointing to your correct files and check out the Apache logs to see if there was an error: `C:/xampp/apache/logs/error.log`. Lastly you could try adding the line stated by @Munstasir to the hosts file here: `C:/Windows/System32/drivers/etc/hosts`. Again restart Apache.Good luck. – Kit Mar 20 '11 at 22:38
0

you can also fix it by editing your host file usually located in %systemroot%\system32\drivers\etc\hosts

first of all backup your hosts file

comment this line by adding # at the beginning of the line(if its already their)

#::1 localhost 

add this line in the end of the file

127.0.0.1       localhost

save it and restart your pc

if you face any problem just restore your hosts file

Muntasir
  • 1,130
  • 1
  • 8
  • 9
  • ::1 localhost This i what i have got at the moment,if i edit to ur advice will it mess up my IIS server.I have stopped it now to run apache – manraj82 Mar 20 '11 at 22:38
  • ::1 Localhost is the equivalent to 127.0.0.1 Localhost but in ipv6 protocol , you can add 127.0.0.1 Localhost this line also and that will be ipv4 , if something goes wrong with iss just revert back – Muntasir Mar 20 '11 at 22:43