Page 1 of 1

Newbie question: can't access localhost

PostPosted: 12. November 2007 23:51
by Trevor Jordan
I've downloaded Xampp and started Apache both from the Xampp control panel and using the batch file) but can't access http://localhost nor 127.0.0.1 with any my browsers (IE7, Opera 9 and Firefox 2, all running under Windows XP MCE with SP2). Windows firewall is off, and it doesn't help to disable my firewall and my virus protection (both by Iolo). What cann I try next, please?

PostPosted: 12. November 2007 23:53
by Scory
Any messages? What happens? Nothing? White Screen? Blue Screen? Reboot?

Greets
Scory

PostPosted: 13. November 2007 00:00
by Izzy
Try this:
Open in your text editor and edit the Windows host file by dragging it into the editor and add this line if it does not exist.
127.0.0.1 localhost - usually a tab not a space between the items.

Save the file and restart Apache and try again.

host file location C:\WINDOWS\system32\drivers\etc\
The host file has no extension and is why you need to drag it into the editor.



===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================

PostPosted: 13. November 2007 00:08
by Trevor Jordan
Thanks for such prompt replies. The hosts file already had the entry 127.0.0.1 localhost. The error message was the standard

'Error! Could not connect to remote server

You tried to access the address http://localhost/, which is currently unavailable. Please make sure that the Web address (URL) is correctly spelled and punctuated, then try reloading the page.

No proxy in use, all fifrewalls and virus protection off, port check shows all the ports free.

PostPosted: 13. November 2007 00:16
by Izzy
Are there any clues in the Apache error.log or access.log
xampp\apache\logs\

How are you starting Apache?
Control Panel or by the apache-start.bat
The latter will give you error messages if any exists.


===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================

PostPosted: 13. November 2007 00:21
by Trevor Jordan
Nothing in the access log. The error log contains multiple blocks (from multiple attempts to run it, I suspect) of the following:

[Mon Nov 12 21:48:49 2007] [notice] Apache/2.2.6 (Win32) DAV/2 mod_ssl/2.2.6 OpenSSL/0.9.8e mod_autoindex_color PHP/5.2.4 configured -- resuming normal operations
[Mon Nov 12 21:48:49 2007] [notice] Server built: Sep 21 2007 00:29:38
[Mon Nov 12 21:48:49 2007] [notice] Parent: Created child process 284
[Mon Nov 12 21:48:54 2007] [notice] Child 284: Child process is running
[Mon Nov 12 21:48:54 2007] [crit] (OS 10022)An invalid argument was supplied. : Child 284: setup_inherited_listeners(), WSASocket failed to open the inherited socket.
[Mon Nov 12 21:48:54 2007] [crit] Parent: child process exited with status 3 -- Aborting.

PostPosted: 13. November 2007 00:35
by Izzy
Your server is not starting and is why localhost is going nowhere.

It may be a Winsock issue so try adding this to the end of the xampp\apache\conf\httpd.conf file:
Win32DisableAcceptEx

Save the file and restart apache.

Backup any ini or conf files before editing so you can revert if you make a typo.


===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================

PostPosted: 13. November 2007 01:06
by Izzy
Also try this as you may have a sticking service issue:

Stop Apache, MySQL if they are running.

Close/Exit the control panel.

Open a command prompt
Click start
Click on Run...
Type: cmd.exe

Remove old or sticking services.
Apache
Type:
sc delete apache2.2
Click OK

Close the command console

Start the control panel and try install your services again or use the bat files provided in the various component's directories.


BTW - sc is an acceptable abbreviation for sc.exe Windows Service Controller and will delete any stray services that won't shut down by any normal means, among other services commands.

Microsoft explains the Service Controller Commands here.


===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================

PostPosted: 13. November 2007 01:10
by Izzy
This has also been known to fix this issue.

Open any internet connection in your Windows Control Panel>Network Connections
Click on Networking
Highlight Internet Protocol (TCP/IP)
Click on Properties>Advanced...>WINS tab
Uncheck Enable LMHOSTS lookup
Click OK>OK>OK
Done.


===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================

PostPosted: 13. November 2007 11:13
by Trevor Jordan
Sorry, but the http.conf tip, the Windows Service Controller tip and the LMHOSTS tip all failed to work for me. I'm still getting site unavailable (ie Apache not starting) though Xampp control panel says briefly that it is then very quickly reverts to being off again.

PostPosted: 13. November 2007 11:20
by Izzy
OK, lets try starting Apache using the C:\xampp\apache_start.bat file by just double click on it and it should stay open, if it does not stay open, follow the next paragraph - it will give you an error message why Apache will not start.

Open a command prompt in your xampp directory or cd to the C:\xampp directory if that is where your xampp is installed and type the command apache_start.bat - this will keep the command console open so you can read the errors that will be preventing Apache from starting.

You can copy and paste the result here if you can't spot a solution.

To copy and paste click on the little icon top left of the console window and it will reveal a context menu with the edit commands to use.


===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================

PostPosted: 13. November 2007 11:44
by Trevor Jordan
It's on G:\ (a USB drive because I want to use it on more than one machine) and g:\xampp> apache_start.bat brings up the introductory lines then:#

Apache 2 is starting ...
[Tues Nov 13 10:34:47 2007] [notice] Disabled use of AcceptEx() Winsock2 API

then just the g:\xampp> prompt.

I kept the Xampp control panel open during this and "Running" appearted briefly against Apache then disappeared again. It lkooks as though Apache starts but is then shutdown, but then I am a mere beginner in all this, and I am most grateful for your time, patience and expertise.

PostPosted: 13. November 2007 12:03
by Izzy
In my promo below is a launcher called DTX.exe.

May I suggest you visit the site mentioned and download this launcher, configure the simple ini file and see if that helps as your situation on a USB drive is different to the normal running of things.

Use DTX in place of the XAMPP Control Panel.

Here is a link to a thread from some time ago that might help.
http://community.apachefriends.org/f/viewtopic.php?t=20141

Would you kindly post back if you find the solution so others trying to find a solution to similar issues might be helped.



===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================

PostPosted: 13. November 2007 12:31
by Trevor Jordan
I'm afraid DTX did the same: happily launched mysql but wouldn't start Apache, though this time there was a huge error file which I don't understand.

I've now tried to load and run Apache on another machine and installed to that machine and not to a USB drive, and still the same happens: I can't access localhost, so it's not Xampp that's not working here, it seems to be Apache. Are there any alternatives I might try?