Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

First off, I am not a Linux guy, but I have to pretend to be one sometimes as a web developer.

So, we have a Red Hat server and I'm using wget in crontab to run some PHP scripts.

We've been doing this for some time now and it's been working fine.

I tried to add another script using wget to run a PHP script behind HTTP authentication. However, despite the fact that the URL works fine and the username and password are correct, we are getting Connection Timed Out errors each time.

What might cause wget to work for unauthenticated URLs, but not authenticated ones?

I've tried --user=/--password=, --http-user=/--http-password and Username:Password@ in the URL and all three fail the same way.

Here's the command in question:

[blahblah user]# wget -t 5 -O /dev/null 'http://Username:Password1!'
--2010-07-07 10:11:55--  http://Username:*password*
Connecting to||:80... failed: Connection timed out.

[Repeat ad nauseum]

Any thoughts? Again, wget works, the file with authentication works, but wget calling the file with authentication does not work.

UPDATE: Actually, I get the same timeout if I access the authenticated URL without authentication. Could that mean that Apache is rejecting wget requests for authentication outright? (I'm really treading into speculation territory here. I know almost nothing about Apache configuration.)

share|improve this question

You say you tried --user= and --http-user=, did your tests include --password= and --http-password-? (Forgive me if that was implicit in your question, but this would make a difference if not)

What about trying --ask-password?

share|improve this answer
I apologize, I was implying --password= and --http-password=. I've updated the original question. --ask-password doesn't appear to be an option for me according to wget --help. – RadicalBender Jul 7 '10 at 16:41

Aha! The problem turned out to be with the firewall in front of the server. Our hosting company says DNS doctoring should solve it.

Thanks for everyone's help.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .