7

I am trying to access localhost by my IP address. My IP address is/was 217.164.79.62 (It is set to be automatically assigned so it keeps changing).

When I visit http://localhost/, I get the XAMPP homepage.

However, when I visit http://217.164.79.62/, I get the following message:

The server 217.164.79.62:80 requires a username and password.

User Name:
Password:

How do I get the username and password?

Zaz
  • 783
  • 1
  • 6
  • 17
Malte Werschy
  • 105
  • 1
  • 1
  • 2

4 Answers4

15

To access the server from itself, use http://localhost/ or http://127.0.0.1/.

To access the server from a separate computer on the same network, use http://192.168.X.X where X.X is your server's local IP address. You can find the sever's local IP address (assuming it's Linux) by running hostname -I.

Zaz
  • 783
  • 1
  • 6
  • 17
  • 1
    127.0.0.1 works on this computer but it does not work on other computers. `http://217.164.79.62/` works on any computer in my network but requests username and password... ;( Sorry for taking so long. I hadn't expected answers this quickly. :D – Malte Werschy Dec 05 '10 at 06:29
  • @Malte Werschy: Sorry, I must have missed your reply until now. I've updated my answer with information about local IPs (`192.168.X.X`) which should hopefully allow you to bypass whatever security policy is denying you access. – Zaz Dec 31 '10 at 19:45
  • Problem solved. I can access the computer by using 192.168.254.4. :D Thanks for all the help! :D – Malte Werschy Dec 05 '10 at 07:28
7

http://localhost is NOT the same as http://217.164.79.62

The localhost address is 99.999% of the time mapped to the IP address 127.0.0.1 and is totally inaccessible from anywhere except your local machine

What you're finding when you're entering http://217.164.79.62 is that your modem/router device owns that IP address, so you're getting the login screen for it.

Mark Henderson
  • 68,316
  • 31
  • 175
  • 255
  • So i need the password of the modem? – Malte Werschy Dec 05 '10 at 06:58
  • 1
    @Malte - no, you clearly didn't read what I wrote. You don't want to use `217.164.79.62` - you want to use `127.0.0.1`. If you're trying to get other people to see your site (you don't mention this in your question), then this is another matter alltgoether. – Mark Henderson Dec 05 '10 at 09:26
5

Do you have a Modem/router type device to connect to the internet? It sounds like you are connecting to the configuration interface for this.

Alternatively: On what platform do you use XAMPP? Could you post the output of ipconfig in Windows or sudo ifconfig in Linux/MacOS?

--- Edit

OK, so with the info you gave here, it is now clear what the problem is (and that this belongs on superuser.com instead of Serverfault).

When you try to connect to your public IP address, you are in fact reaching your router, not your XP box. If you really would want to connect to the XAMPP server with this public IP address, you would need to configure your router to forward port 80 to your XP machine so that it is accessible from the outside (you will find how that is done in the routers documentation). However, this is a terrible idea if you just want to test things and don't need others to access it. Instead, you would either use 127.0.0.1, which would only work on your XP box, or 192.168.254.4, which would be accessible from any computer in your home LAN.

Could you edit your original question and tell us why you want to use the IP address instead of http://localhostin the first place?

NB: The info you gave on the router/modem stated that it's firewall is deactivated. This is normally a really bad idea, I would strongly recommend turning it on. How this is done will also be explained in the documentation.

Sven
  • 97,248
  • 13
  • 177
  • 225
  • Yes I do have a modem. The ip address of the modem is 192.168.254.254. The data report of the modem is: System Type: SpeedStream 6520 Series DSL Connection Information: UP Router IP Address: 192.168.254.254 WAN IP Address: 217.164.79.62 Firewall: Off Config Part #: 003-a193-G02 Firmware Part #: 004-E752-A64 MAC Address: 00:13:A3:D0:FB:2A Up Time: 0 days, 21 hours, 6 minutes, 36 seconds I use xampp on windows xp. the output of ipconfig is: Windows IP Configuration Ethernet adapter Local Area Connection: Conection-specific DNS Sufix . : domain.invalid Continued in next post. – Malte Werschy Dec 05 '10 at 06:41
  • What is it with this formatting? Am I doing something wrong? How do I get {enter_key}? Anyway continued report is: IP Address: 192.168.254.4 Subnet Mask: 255.255.255.0 IP Address: fe80::203:dff:fe44:41df%4 Default Gateway: 192.168.254.254 Ethernet adapter Wireless Network Connection: Media State: Media disconnected Tunnel adapter Teredo Tunneling Pseudo-Interface: Connection-specific DNS Sufix: {Continued} – Malte Werschy Dec 05 '10 at 06:49
  • IP Address: fe80::ffff:ffff:fffd%6 Default Gateway: Tunnel adapter Automatic Tunneling Pseudo-Interface: Connection-specific DNS Suffix: IP Address: fe80:ffff:ffff:fffd%6 Default Gateway: Tunnel adapter Automatic Tunneling Pseudo-Interface: Connection-specific DNS Suffix: domain.invalid IP Address: fe80::5efe:192.168.254.4%2 Default Gateway: I am really sorry for this formatting. ;( I just don't know how to do it better... ;( – Malte Werschy Dec 05 '10 at 06:56
  • 1
    Malte, I edited my answer with some more infos. Also, it should be possible for you to edit your question to append infos like the above. Doing this in the question instead of a comment makes it easier to format and easier to find. – Sven Dec 05 '10 at 12:14
1

It sounds like you are trying to connect to your modem. That means you haven't configured in your modem for your static IP...if you don't have a static IP, you can't route to port 80 with this IP address...and this shows, you can't log in to localhost with this ip...use 127.0.0.1 to connect localhost instead of this, if you don't have a static IP and if you haven't configured your router...

Metin Mert
  • 11
  • 1