LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-27-2009, 10:35 AM   #1
linea
LQ Newbie
 
Registered: May 2009
Location: Seattle
Distribution: Mandrake
Posts: 13

Rep: Reputation: 0
curl: (7) couldn't connect to host // wget --> failed: Connection refused.


Hi all,

I am quite a newbie. I have Mandriva 2009 Spring installed on a Thinkpad T40. All works well but since last week I have broken somehow curl and wget :

Quote:
[tompot@localhost]$ wget http://www.yahoo.com
--2009-05-28 08:08:58-- http://www.yahoo.com/
Connecting to 217.19.195.242:80... failed: Connection refused.
Quote:
[tompot@localhost]$ curl http://www.yahoo.com
curl: (7) couldn't connect to host
One clue I have is, since I installed XAMPP, I have created the xampp service and might have modified something else for curl and wget.

Please, don't hesitate to refer me to another solved thread to reseach.

Thank you
 
Old 05-27-2009, 11:36 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,962
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
Hi

welcome to LQ!

Is the URL still accessible via ordinary browser? What's the
network topology, are you behind a proxy/firewall? What do
you see when you
Code:
telnet www.yahoo.com 80
?


Cheers,
Tink
 
Old 05-27-2009, 12:32 PM   #3
linea
LQ Newbie
 
Registered: May 2009
Location: Seattle
Distribution: Mandrake
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks Tinkster,

I forgot to mention
  • I have still perfect access to the internet (all url) via http and ftp with FF 3.0.10.
  • lynx doesn't seem to be working :
    Quote:
    [tompot@localhost]$ lynx http://www.yahoo.com

    Looking up 217.19.195.242
    Making HTTP connection to 217.19.195.242
    Alert!: Unable to connect to remote host.

    lynx: Can't access startfile http://www.yahoo.com/
  • Telnet isn't installed on my config.
  • but dig seems to work :
    Quote:
    dig www.yahoo.com

    ; <<>> DiG 9.6.0-P1 <<>> www.yahoo.com
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35081
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0

    ;; QUESTION SECTION:
    ;www.yahoo.com. IN A

    ;; ANSWER SECTION:
    www.yahoo.com. 241 IN CNAME www.wa1.b.yahoo.com.
    www.wa1.b.yahoo.com. 4 IN CNAME www-real.wa1.b.yahoo.com.
    www-real.wa1.b.yahoo.com. 23 IN A 209.131.36.158

    ;; Query time: 21 msec
    ;; SERVER: 68.87.69.146#53(68.87.69.146)
    ;; WHEN: Thu May 28 10:23:56 2009
    ;; MSG SIZE rcvd: 94
  • Network is local wifi with 3 machines + printer. Sisco router.


Where should I start looking ?

Last edited by linea; 05-27-2009 at 12:48 PM.
 
Old 05-27-2009, 01:01 PM   #4
linea
LQ Newbie
 
Registered: May 2009
Location: Seattle
Distribution: Mandrake
Posts: 13

Original Poster
Rep: Reputation: 0
I tried Konqueror. Same probleme as Lynx not access to any url.

Either somehting special with my firefox config for http and the filezilla for ftp.
Or Firefox is messing up the mandriva build-in browsers.
 
Old 05-27-2009, 02:02 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,962
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
I don't think ff has that power ... if you don't have telnet - how about netcat?
Is SE Linux enabled, and your FF the only browser permitted out on ports 80
and/or 443?

You could also try to run curl or wget under strace, log info ot a file and
see where you get errors/permission problems ...


Cheers,
Tink
 
1 members found this post helpful.
Old 05-27-2009, 03:34 PM   #6
linea
LQ Newbie
 
Registered: May 2009
Location: Seattle
Distribution: Mandrake
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
I don't think ff has that power ... if you don't have telnet - how about netcat?
Is SE Linux enabled, and your FF the only browser permitted out on ports 80
and/or 443?

You could also try to run curl or wget under strace, log info ot a file and
see where you get errors/permission problems ...
No telnet, no netcat either
SELinux is RH distro isn't it ? I am Mandriva.--> no idea about ports opened for which browser.

I am looking at the strace output... won't be easy

For info while I try to understand the raw output, here is the -c output :
Quote:
strace -c wget www.yahoo.com
--2009-05-28 13:31:34-- http://www.yahoo.com/
Connecting to 217.19.195.242:80... failed: Connection refused.
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
81.97 0.001000 1000 1 1 connect
15.74 0.000192 192 1 execve
2.30 0.000028 1 25 fstat64
0.00 0.000000 0 13 read
0.00 0.000000 0 3 write
0.00 0.000000 0 37 13 open
0.00 0.000000 0 27 close
0.00 0.000000 0 3 time
0.00 0.000000 0 1 1 access
0.00 0.000000 0 3 brk
0.00 0.000000 0 2 ioctl
0.00 0.000000 0 4 munmap
0.00 0.000000 0 1 uname
0.00 0.000000 0 5 mprotect
0.00 0.000000 0 1 _llseek
0.00 0.000000 0 7 rt_sigaction
0.00 0.000000 0 1 rt_sigprocmask
0.00 0.000000 0 1 getrlimit
0.00 0.000000 0 35 mmap2
0.00 0.000000 0 6 4 stat64
0.00 0.000000 0 2 futex
0.00 0.000000 0 1 set_thread_area
0.00 0.000000 0 1 set_tid_address
0.00 0.000000 0 1 set_robust_list
0.00 0.000000 0 2 socket
0.00 0.000000 0 1 bind
0.00 0.000000 0 1 getsockname
0.00 0.000000 0 1 sendto
0.00 0.000000 0 3 recvmsg
------ ----------- ----------- --------- --------- ----------------
100.00 0.001220 190 19 total
Quote:
strace -c curl www.yahoo.com
curl: (7) couldn't connect to host
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
64.90 0.007394 130 57 read
26.33 0.003000 45 66 21 open
8.77 0.000999 999 1 execve
0.00 0.000000 0 35 write
0.00 0.000000 0 47 close
0.00 0.000000 0 5 time
0.00 0.000000 0 4 2 access
0.00 0.000000 0 1 pipe
0.00 0.000000 0 2 times
0.00 0.000000 0 4 brk
0.00 0.000000 0 2 1 ioctl
0.00 0.000000 0 2 getrusage
0.00 0.000000 0 2 gettimeofday
0.00 0.000000 0 6 munmap
0.00 0.000000 0 1 uname
0.00 0.000000 0 19 mprotect
0.00 0.000000 0 25 select
0.00 0.000000 0 1 poll
0.00 0.000000 0 2 rt_sigaction
0.00 0.000000 0 1 rt_sigprocmask
0.00 0.000000 0 1 getrlimit
0.00 0.000000 0 78 mmap2
0.00 0.000000 0 7 6 stat64
0.00 0.000000 0 44 fstat64
0.00 0.000000 0 4 fcntl64
0.00 0.000000 0 2 futex
0.00 0.000000 0 1 set_thread_area
0.00 0.000000 0 1 set_tid_address
0.00 0.000000 0 12 clock_gettime
0.00 0.000000 0 1 set_robust_list
0.00 0.000000 0 1 socket
0.00 0.000000 0 1 1 connect
0.00 0.000000 0 1 setsockopt
0.00 0.000000 0 1 getsockopt
------ ----------- ----------- --------- --------- ----------------
100.00 0.011393 438 31 total
 
Old 06-01-2009, 11:28 AM   #7
linea
LQ Newbie
 
Registered: May 2009
Location: Seattle
Distribution: Mandrake
Posts: 13

Original Poster
Rep: Reputation: 0
Angry

My search didn't bring me anywhere

Can someone help me ?
 
Old 06-01-2009, 11:45 AM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,962
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
Not with that amount of info. I'd highly recommend installing
either telnet or nc (nc being the predfered choice because it's
far more versatile).


Cheers,
Tink
 
Old 06-01-2009, 11:50 AM   #9
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
Whats in /etc/hosts? Firefox used to do funny things resolving via hosts, especially if you have some proxy set up. Is that all clear?
 
Old 06-02-2009, 01:06 AM   #10
linea
LQ Newbie
 
Registered: May 2009
Location: Seattle
Distribution: Mandrake
Posts: 13

Original Poster
Rep: Reputation: 0
Thank you.

Quote:
Originally Posted by jamescondron View Post
Whats in /etc/hosts? Firefox used to do funny things resolving via hosts, especially if you have some proxy set up. Is that all clear?
Give me :
Quote:
[root@localhost etc]# more hosts
127.0.0.1 localhost

Quote:
Not with that amount of info. I'd highly recommend installing
either telnet or nc (nc being the predfered choice because it's
far more versatile).


Cheers,
Tink
I managed to install netcat. Here is what it gives :
Quote:
[root@localhost etc]# netcat -v www.yahoo.com 80
www.yahoo.com [209.131.36.158] 80 (http) open
read(net): Connection reset by peer
 
Old 06-02-2009, 01:32 AM   #11
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,962
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
Hummm ... still doesn't make any sense. Is there a proxy
somewhere that firefox knows about, and other browsers
don't?
 
Old 06-02-2009, 01:38 PM   #12
linea
LQ Newbie
 
Registered: May 2009
Location: Seattle
Distribution: Mandrake
Posts: 13

Original Poster
Rep: Reputation: 0
Lightbulb

Excellent Tink, you got me on the way.
I feel like a moron now.

I changed proxy settings on drake gui...
Now wget and curl is working.

However netcat is still giving me the same thing.

In my mother tongue I'd say "Touche pas ca p'tit con".

Thanks a lot Tink.
 
Old 05-21-2012, 12:56 PM   #13
Mcdo
LQ Newbie
 
Registered: May 2012
Posts: 1

Rep: Reputation: Disabled
Did you use a proxy?

curl and wget try to download things through proxy even if the proxy is unavailable. so the simplest way is to export http_proxy="" and put it into your .bash_profile.

Last edited by Mcdo; 05-21-2012 at 12:58 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bind9: NDC command failed : rndc: connect failed: connection refused Boudewijn Linux - Networking 19 01-02-2014 07:19 AM
rndc: connect failed: connection refused mahmoud Linux - Newbie 2 06-07-2006 02:23 AM
rndc: connect failed: connection refused jkmartha Linux - Software 0 06-20-2005 01:35 AM
rndc: connect failed: connection refused Justalk Linux - Software 2 06-28-2004 03:45 PM
rndc: connect failed: connection refused Atroxic Linux - Networking 1 10-24-2003 01:01 PM


All times are GMT -5. The time now is 09:43 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration