[Solved] wget connection refused on localhost

I am a moderate level Linux user and I have a site I am trying to get some command to work on so I can get cron working. Here is the command (trying from command line):

/usr/bin/wget -O - -d http://localhost/cron.php?cron_key=turtl3

When I run this, I get a "connection refused" message.

I do have an HTTP auth user/pass set up on the server, so I also tried this:

/usr/bin/wget -O - -d http://user:[email protected]/cron.php?cron_key=turtl3

but it doesn't work either. I have been Googleing and trying to find a way past this for a couple of hours. Any suggestions on how to troubleshoot this?

2 Replies

Looks like if you are using HTTP auth, you need to include the IP address instead of "localhost." So, this worked:

/usr/bin/wget -O - -d http://user:[email protected]/cron.php?cron_key=turtl3

@gregstout:

When I run this, I get a "connection refused" message.
Are you really getting "connection refused" instead of something like "401 Unauthorized"?

If so, it sounds like your web server is not listening on the localhost (127.0.0.1) IP address, which doesn't really have anything to do with HTTP authentication.

If you are running Apache, look in your config for a "BindAddress" or "Listen" directive. If you have a specific IP(s) listed there, then Apache will only listen on those IP(s).

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct