LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


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

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


hi,
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
Code:
curl --head "http://www.mywebsite.com/tmp/"
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. http://www.google.com) but i can't get my web site (that is online, obviously).

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

Rep: Reputation: 2979Reputation: 2979Reputation: 2979Reputation: 2979Reputation: 2979Reputation: 2979Reputation: 2979Reputation: 2979Reputation: 2979Reputation: 2979Reputation: 2979
Posting the console output would help.
 
Old 06-05-2012, 07:16 PM   #3
masavini
Member
 
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, 09:57 AM   #4
masavini
Member
 
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.:
Code:
teo@server:/tmp$ lynx -dump www.li-tech-shop.it
Looking up  'www.li-tech-shop.it' first

Looking up www.li-tech-shop.it
Making HTTP connection to www.li-tech-shop.it
Alert!: Unable to connect to remote host.

lynx: Can't access startfile http://www.li-tech-shop.it/
teo@server:/tmp$
if i sign off from livechat, after a few minutes everything returns ok on server, as well.

this is the login function:
Code:
# 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, 11:20 AM   #5
masavini
Member
 
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:
Code:
teo@server:/tmp$ ping "www.li-tech-shop.it"
PING www.li-tech-shop.it (62.149.140.134) 56(84) bytes of data.
64 bytes from webx124.aruba.it (62.149.140.134): icmp_req=1 ttl=63 time=33.1 ms
64 bytes from webx124.aruba.it (62.149.140.134): icmp_req=2 ttl=63 time=32.6 ms
64 bytes from webx124.aruba.it (62.149.140.134): icmp_req=3 ttl=63 time=33.1 ms
^C
--- www.li-tech-shop.it 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 http://www.li-tech-shop.it
--2012-06-11 17:13:45--  http://www.li-tech-shop.it/
Resolving www.li-tech-shop.it... 62.149.140.134
Connecting to www.li-tech-shop.it|62.149.140.134|:80... failed: Connection timed out.
Retrying.

--2012-06-11 17:14:07--  (try: 2)  http://www.li-tech-shop.it/
Connecting to www.li-tech-shop.it|62.149.140.134|:80... ^C
 
  


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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:39 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration