Cannot access server with IP

  • (2 Pages)
  • +
  • 1
  • 2

19 Replies - 1438 Views - Last Post: 09 April 2020 - 12:02 PM

#1 Atharron   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 202
  • Joined: 23-April 14

Cannot access server with IP

Posted 07 April 2020 - 04:29 PM

I used this guide primarily to install PHP. I had a few problems (which I already posted about, but this is a separate question so I created a new topic), and after some fiddling about, it works. I can now run PHP scripts using localhost.

However, this guide also says I should be able to access the server by using my IP. I follow the instructions and I enter into the address bar http://##.##.##.## But instead of showing me the default page as the guide says it should, I get a prompt asking for username and password. The guide never said this would happen, let alone what username and password this referred to.

As I primarily got this in order to test PHP scripts before uploading them to an external server, I'm not certain this is at all relevant. However, does this mean that anyone should be able to access my server if they knew my IP, username, and password?

Also, is there any way of getting rid of that prompt, and if not, what username and password is it referring to?

Is This A Good Question/Topic? 0
  • +

Replies To: Cannot access server with IP

#2 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6865
  • View blog
  • Posts: 31,644
  • Joined: 10-May 07

Re: Cannot access server with IP

Posted 07 April 2020 - 04:34 PM

I would check that it's the same server/service.

If you look in the access logs, do you see your computer making the attempt?

If you stop the httpd service, & refresh the ip url, if the same prompt comes up then it's not from this tutorial
Was This Post Helpful? 0
  • +
  • -

#3 Atharron   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 202
  • Joined: 23-April 14

Re: Cannot access server with IP

Posted 07 April 2020 - 05:12 PM

I'm sorry, I don't know how to do any of that (except maybe refreshing the page). And I've not even heard of httpd. Can you please explain what you mean by these terms?
Was This Post Helpful? 0
  • +
  • -

#4 ArtificialSoldier   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2732
  • View blog
  • Posts: 8,011
  • Joined: 15-January 14

Re: Cannot access server with IP

Posted 07 April 2020 - 08:14 PM

httpd is the executable process that is the Apache web server. If you go into a console, and type "top" you'll see a list of everything running and how much CPU time and memory it's using, similar to the Windows task manager. If you see httpd in that list of things running, that's Apache listening for web requests.

If you followed the guide above, then you can probably use sudo systemctl stop apache2 to stop the web server. If you do that, and then try to go the IP address again and see the same login prompt, then the problem is not Apache because Apache isn't running. You should be able to verify using sudo systemctl status apache2 (I think, most of my experience isn't Ubuntu).

So, if Apache is not running, and you still get the login prompt, then the problem isn't with anything you set up with that guide, something else is receiving that request and sending the login prompt.

That would be the first thing to check.

Also, look for any other information on the login box. Look for anything that tells you what might be asking you to log in. Maybe you'll only see your IP address, maybe you'll see something else.
Was This Post Helpful? 2
  • +
  • -

#5 Atharron   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 202
  • Joined: 23-April 14

Re: Cannot access server with IP

Posted 08 April 2020 - 12:30 AM

So I did what you said and got this output:

[email protected]:~$ sudo systemctl stop apache2
[email protected]:~$ sudo systemctl status apache2
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: 
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: inactive (dead) since Wed 2020-04-08 08:09:33 BST; 7min ago
  Process: 7207 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS
  Process: 1156 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCE
 Main PID: 1249 (code=exited, status=0/SUCCESS)

Apr 08 08:04:43 Johns-Ubuntu systemd[1]: Starting The Apache HTTP Server...
Apr 08 08:04:43 Johns-Ubuntu apachectl[1156]: AH00558: apache2: Could not reliab
Apr 08 08:04:43 Johns-Ubuntu systemd[1]: Started The Apache HTTP Server.
Apr 08 08:09:33 Johns-Ubuntu systemd[1]: Stopping The Apache HTTP Server...
Apr 08 08:09:33 Johns-Ubuntu apachectl[7207]: AH00558: apache2: Could not reliab
Apr 08 08:09:33 Johns-Ubuntu systemd[1]: Stopped The Apache HTTP Server.




Checking back on my browser, I still get the same pop up. I checked on both Brave and Firefox just in case it was the browser causing the problem.

Firefox says:
http://##.##.##.## is requesting your username and password. The site says: “DSL-3782”


Brave says:
http://##.##.##.## Your connection to this site is not private.


Just out of curiosity, I tried it on my phone as well. I do not get the pop up, instead, all I get is a blank page. Not even a 404 error.

I then typed apache2 into the terminal and got this message:

[email protected]:~$ apache2
[Wed Apr 08 08:24:00.708823 2020] [core:warn] [pid 8255] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot



Line 80 of apache2.conf says the following:
DefaultRuntimeDir ${APACHE_RUN_DIR}

This post has been edited by Atharron: 08 April 2020 - 12:32 AM

Was This Post Helpful? 0
  • +
  • -

#6 ArtificialSoldier   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2732
  • View blog
  • Posts: 8,011
  • Joined: 15-January 14

Re: Cannot access server with IP

Posted 08 April 2020 - 10:52 AM

So, it's not Apache taking that request and asking for you to login. It's your DSL-3782 modem that is asking you to login. If you haven't changed the default username and password on your modem, you should probably do that immediately before someone else does.
Was This Post Helpful? 0
  • +
  • -

#7 Atharron   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 202
  • Joined: 23-April 14

Re: Cannot access server with IP

Posted 08 April 2020 - 10:55 AM

How do I do that? I don't even know what the default username and password are.
Was This Post Helpful? 0
  • +
  • -

#8 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15743
  • View blog
  • Posts: 63,068
  • Joined: 12-June 08

Re: Cannot access server with IP

Posted 08 April 2020 - 11:05 AM

Look up your router and modem models.
Get their documentation from online, and the name/password should be in those.
Was This Post Helpful? 0
  • +
  • -

#9 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6865
  • View blog
  • Posts: 31,644
  • Joined: 10-May 07

Re: Cannot access server with IP

Posted 08 April 2020 - 11:33 AM

Are you trying to load your server IP or your external IP?
Was This Post Helpful? 0
  • +
  • -

#10 Atharron   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 202
  • Joined: 23-April 14

Re: Cannot access server with IP

Posted 08 April 2020 - 11:49 AM

View Postmodi123_1, on 08 April 2020 - 11:05 AM, said:

Look up your router and modem models.
Get their documentation from online, and the name/password should be in those.


Where would I find that info? Are we talking about the actual physical Wifi router? Or something else inside my computer?


Quote

Are you trying to load your server IP or your external IP?


I have no idea.
Was This Post Helpful? 0
  • +
  • -

#11 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15743
  • View blog
  • Posts: 63,068
  • Joined: 12-June 08

Re: Cannot access server with IP

Posted 08 April 2020 - 12:00 PM

Hardware has a manufacture and model number. Typically on a sticker on the bottom.

Pick up your device, flip it over, search for the model number in google, and read the 'setup guide' at the manufacturer's website. Most will explain how to log into your modem (or router depending on which you are looking up), and some may even have default credentials to enter.

Of course this is assuming you have some sort of access to both in, say, a home setup. If you do not then that's SOL.
Was This Post Helpful? 1
  • +
  • -

#12 ArtificialSoldier   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2732
  • View blog
  • Posts: 8,011
  • Joined: 15-January 14

Re: Cannot access server with IP

Posted 08 April 2020 - 12:08 PM

Assuming that "DSL-3782" only refers to one product, and it's the one asking for the login, this is what you have:

https://eu.dlink.com...sl-modem-router
Was This Post Helpful? 0
  • +
  • -

#13 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6865
  • View blog
  • Posts: 31,644
  • Joined: 10-May 07

Re: Cannot access server with IP

Posted 08 April 2020 - 01:22 PM

View PostAtharron, on 08 April 2020 - 01:49 PM, said:

Quote

Are you trying to load your server IP or your external IP?


I have no idea.

How are you connecting to the server to install & configure Apache? If you are connecting via SSH, then that's the same IP/address that you should be putting into the url address.
Was This Post Helpful? 0
  • +
  • -

#14 Atharron   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 202
  • Joined: 23-April 14

Re: Cannot access server with IP

Posted 08 April 2020 - 01:59 PM

I don't know what SSH is.

I found my IP by using the instructions in the guide I linked above:

$sudo apt install curl

$curl http://icanhazip.com


Was This Post Helpful? 0
  • +
  • -

#15 ArtificialSoldier   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2732
  • View blog
  • Posts: 8,011
  • Joined: 15-January 14

Re: Cannot access server with IP

Posted 08 April 2020 - 02:59 PM

If you're just using this for local development, you can access Apache and your PHP stuff with http://localhost/ as long as you're using the same computer. If you want to access your web server from a different computer on your home network, then you need to know your webserver's local IP address. You can type ifconfig to get a printout of the various network interfaces and which IP address is assigned to each one. That's really all you need for development on your local network. If you want to make your web server available on the internet then there's plenty of other stuff you need to learn.

Other than all of that, download your modem/router's user guide, figure out what the default login information is, see if it works to login, and if it does then change it.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2