Page 1 of 1

cannot connect to localhost

PostPosted: 28. November 2012 19:40
by lollylegs
:mrgreen: I have tried for days to get xampp to connect to localhost.
1. xampp installs perfectly.
2. netstats -anltp | grep "LISTEN" shows apache listening on 80
3. Disabled firewall
But when I type http://localhost all I get is a google page of localhost listings instead of 'IT WORKS' or the Xampp Welcome Page.
What am I doing wrong please
Would appreciate any help
Regards Marea (Australia)

Re: cannot connect to localhost

PostPosted: 28. November 2012 21:01
by WilliL
Hi,
does a call in Browser '127.0.0.1' instead of 'localhost' work?

check hosts file ( c:\windows\system32\drivers\etc\HOSTS)
there should be a line like:
127.0.0.1 localhost

maybe its commented out by a '#'

Re: cannot connect to localhost

PostPosted: 29. November 2012 00:03
by lollylegs
Hi WilliL
Thanks for replying
I have tried 127.0.0.1 same thing
I am new to ubuntu and have tried to find "HOST" file there to no avail
I have also changed ServerName in httpd.conf to localhost:80 hoping it would make a difference

Re: cannot connect to localhost

PostPosted: 29. November 2012 01:05
by JonB
The firewall (assuming iptables) should make no difference AFAIK.

You should use su or sudo for these explorations:

A. - have you looked in the Apache error log? (opt/lampp/logs/error_log)

B. - the hosts file is found in the root of the filesystem under /etc usually.
This should let you take a look - (or you can use an editor if you want to make changes)

Code: Select all
cd /etc
cat hosts


C. - you may want to try a different browser (or turn off the Google browser suggestions) so you can get to the 'real error message' whihc might be a 403 or 404.
Depending on the linux desktop installed you might have Firefox or Konqueror available. In Google Settings > Advanced, these are what you want to turn off to keep Larry & Sergey from making you nuts when debugging:

Use a web service to help resolve navigation errors
Use a prediction service to help complete searches and URLs typed in the address bar


D. Although the 'It Works' looks promising, you should be re-directed to the XAMPP Welcome Page when XAMPP/lampp is working correctly.

E. Is the owner of the /opt/lampp hierarchy nobody:root? If its root:root, your logged in Linux user will pull a 403 or 404 usually.

Good Luck with XAMPP -
:)