Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies


Difficulty accessing localhost

3:43 pm on Feb 24, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 26, 2006
votes: 0


I just downloades XAMMPP, the server software produced by Apachefriends. However, each time I try accessing localhost I'm told"Access to localhost was refused." What could be the cause?

2:30 pm on Feb 26, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 29, 2002
votes: 0

With XAMMPP a lot of stuff is done for you, so the problem could be in many places...

First, you can't use "localhost" as a name unless it appears in your hosts file, so check that first -- if you use instead of localhost and it works, either use the IP or correct your hosts file.

Several Apache httpd.conf directives control interface binding, by default it will bind to all TCP/IP interfaces, but check if any of these directives have a value:

# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
#Listen 80


# BindAddress: You can support virtual hosts with this option. This directive
# is used to tell the server which IP address to listen to. It can either
# contain "*", an IP address, or a fully qualified Internet domain name.
# See also the <VirtualHost> and Listen directives.
#BindAddress *

The above directives are commented out to bind to all addresses (including -- the listen port is specified with the Port directive:

# Port: The port to which the standalone server listens.
#Port 80

if Port is commented out it defaults to 80.

ServerName also impacts how the server responds:

# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e., use
# "www" instead of the host's real name).
# Note: You cannot just invent host names and hope they work. The name you
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address (e.g., []
# anyway, and this will make redirections work in a sensible way.
#ServerName new.host.name
ServerName *

ServerName should be "*" unless you understand how it works with any other value.