Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 06-05-2012, 05:16 PM   #1
Registered: Jun 2008
Posts: 233

Rep: Reputation: 6
curl won't connect my website...

sorry for this question, i'm pretty sure it sounds quite stupid...
but i really can't find how to solve it...
i have a script that checks if a directory exists on my web site. if it doesn't it creates it with lftp.

the problem is that the command
curl --head ""
doesn't work anymore. it worked fine until yesterday and it still works on other computers in my office, but it doesn't work on the server.
i tried and reinstall curl, but nothing happens.

the weird thing is i can download any other webpage (i.e. but i can't get my web site (that is online, obviously).

thanks for your help....
Old 06-05-2012, 05:56 PM   #2
LQ Guru
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 8,299

Rep: Reputation: 3372Reputation: 3372Reputation: 3372Reputation: 3372Reputation: 3372Reputation: 3372Reputation: 3372Reputation: 3372Reputation: 3372Reputation: 3372Reputation: 3372
Posting the console output would help.
Old 06-05-2012, 06:16 PM   #3
Registered: Jun 2008
Posts: 233

Original Poster
Rep: Reputation: 6
i didn't post it because i didn't want to advertise my website... and the issue was only with that site!
anyway, i solved just rebooting the host of the virtual server... now curl works a charm like before...
very strange, i'll post if it happens again.

thank you, anyway...
Old 06-11-2012, 08:57 AM   #4
Registered: Jun 2008
Posts: 233

Original Poster
Rep: Reputation: 6
ok, here is what i got after MANY debug attempts...

on my site there is a livechat service.
on my laptop i have a script with some wget commands that make me visible by website visitors and alert me if a chat is requested.
most of wget commands are executed when the script is launched... chat alert is based on a sigle wget command executed every 30 secs.

on my server (which is under the same public ip) i have many scripts that occasionally connect to my website and upload/download some pages.

what happens is VERY strange:
when the laptop script signs me into the live chat service everything works fine on the laptop, but my website can't be reached on the server.
wget, lynx and even firefox won't find it... i.e.:
teo@server:/tmp$ lynx -dump
Looking up  '' first

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

lynx: Can't access startfile
if i sign off from livechat, after a few minutes everything returns ok on server, as well.

this is the login function:
# log in livehelp
function log_in() {
    wget -q -O - --keep-session-cookies --save-cookies=$cookie_file --post-data='proccess=yes&myusername='${username}'&mypassword='${passwd}'&matchip=Y&adminsession=Y' "$baseURL/login.php" > $redirect_file
    redirect=$(grep "cslhOPERATOR" $redirect_file | awk -F '"' '{print $2}')

    wget -q -O - --load-cookies=$cookie_file --keep-session-cookies "$baseURL/$redirect" > /dev/null # $__tempDir/check.html
    wget -q -O - --load-cookies=$cookie_file --keep-session-cookies --post-data='status=Y' "$baseURL/admin_rooms.php" > /dev/null # $__tempDir/check.html
    wget -q -O - --load-cookies=$cookie_file --keep-session-cookies --post-data='department='"$department"'&username='"$username" "$baseURL/admin_users_refresh.php" > $users_file
can you help me and debug this issue? i really can't figure out what could cause it...
Old 06-11-2012, 10:20 AM   #5
Registered: Jun 2008
Posts: 233

Original Poster
Rep: Reputation: 6
anothe piece of the puzzle:
while wget, lynx and ff fail to connect on server, ping works fine:
teo@server:/tmp$ ping ""
PING ( 56(84) bytes of data.
64 bytes from ( icmp_req=1 ttl=63 time=33.1 ms
64 bytes from ( icmp_req=2 ttl=63 time=32.6 ms
64 bytes from ( icmp_req=3 ttl=63 time=33.1 ms
--- ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 32.693/32.999/33.168/0.216 ms
teo@server:/tmp$ wget
--2012-06-11 17:13:45--
Connecting to||:80... failed: Connection timed out.

--2012-06-11 17:14:07--  (try: 2)
Connecting to||:80... ^C


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
Curl won't work on 10.04.1 LTS, but works on 9.10 celerina Ubuntu 1 09-11-2010 03:43 PM
curl(7) cannot connect to host nitin.cool4urchat Fedora 3 12-20-2009 06:04 AM
Net connect - Curl error 6 goingtopot Linux - Newbie 0 06-28-2006 04:57 PM
Why is my curl returning error 7 can't connect for everything? DangNewbie Linux - Software 12 05-08-2006 12:21 PM
Wget and cURL can't connect umberleigh Linux - Newbie 0 09-21-2004 05:59 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:26 PM.

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