Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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!@test.example.com/sub/dir/file-name.php'
--2010-07-07 10:11:55--  http://Username:*password*@test.example.com/sub/dir/file-name.php
Resolving test.example.com... 000.000.000.000
Connecting to test.example.com|000.000.000.000|:80... failed: Connection timed out.
Retrying.

[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
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.