LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 08-29-2005, 05:39 AM   #1
mkamyar
LQ Newbie
 
Registered: Aug 2005
Posts: 4

Rep: Reputation: 0
Unhappy http request


Dear All,

I have a problem with sending http requests. I have a network. This network has a server that is visible to outside of the network and there are some other computers that are not visible and just server can see them (I call them clients). (I didn't configure this network). Now I have redhat 9.0 and apache on all of this computers. I'm sending http requests from server to client via libcurl in php code. But I didn't receive any response. I guess that the problem is from linux configurations but I'm not sure.

Please help me,

Last edited by mkamyar; 08-29-2005 at 06:21 AM.
 
Old 08-29-2005, 06:36 AM   #2
vimico
Member
 
Registered: Jan 2004
Distribution: Debian, Ubuntu
Posts: 118

Rep: Reputation: 15
Re: http request

Quote:
Originally posted by mkamyar
I'm sending http requests from server to client via libcurl in php code. But I didn't receive any response.
I presume you mean client to server.

Yes, you are right, there can be a lot of problems. As you didn't tell us what you already have tried, here a short non exhaustive list of things you might want to check:

Can the client ping the server?
Is there a firewall in place which might block the request?
Have you tried another client (e.g a web browser) to do the request?

Only if you have established that the connection works, you might want to play with the options of curl.
 
Old 08-29-2005, 06:47 AM   #3
mkamyar
LQ Newbie
 
Registered: Aug 2005
Posts: 4

Original Poster
Rep: Reputation: 0
about situations

No, I mean from server to client. My server is responsing the http request and for doing its jobs distribute them between some other computers. But I didn't receive response from clients (some other computers).
 
Old 08-29-2005, 06:52 AM   #4
mkamyar
LQ Newbie
 
Registered: Aug 2005
Posts: 4

Original Poster
Rep: Reputation: 0
about my network

I have a subnetwork. This subnetwork has a server that is the interface of the world and the subnetwork. I send http request via curl extension of the php to the computers that are in my subnetwork but they didn't response. I can ping computers in subnetwork by server and I can ping server by computers in subnetwork too.
 
Old 08-29-2005, 06:33 PM   #5
vimico
Member
 
Registered: Jan 2004
Distribution: Debian, Ubuntu
Posts: 118

Rep: Reputation: 15
If I understand you correctly, the setup is follows:

One server is visible to the internet (= exposed server).

If a client from the internet connects to this server, the server in turn connects to other servers (also running apache) in your local network.

And your problem is, that a www connection from the (exposed) server to the (other) servers does not work.



Even if you can ping the other server, a firewall may block (www) connections from one computer to another.

Perform the following test:

On the exposed host use telnet to connect to that server on port 80 (www).
Code:
telnet ip_of_other_server 80
If the connection is refused immediately, a firewall is most likely blocking that connection. The other possibility is that the web server on the other computer is not running, or not running on port 80.

In case a connection is established enter

Code:
GET / HTTP/1.0
Then press Enter two times.

This requests the root page from this web server. If you get some kind of response, then that web server is running.


You may repeat the telnet command on the other computer. In this case the web server and telnet command run on the same computer (with no firewall blocking them). If this does not work as well, you should examine the web server on that computer.
 
Old 08-30-2005, 02:30 AM   #6
mkamyar
LQ Newbie
 
Registered: Aug 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks

Thanks alot,

My problem was that I'm using the following code:

curl_setopt(<resource name>, CURLOPT_POST, 1);

without using the following code:

curl_setopt(<resource name>, CURLOPT_POSTFIELDS, <post fields>);

On linux distribution of php the above situation doesn't work but in windows it works.
By setting CURLOPT_POSTFIELDS, codes will work correctly.
 
  


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
Printing out http request in php abrb220 Programming 1 11-19-2005 02:23 AM
HTTP::Request and CPAN support amer_58 Linux - Newbie 2 03-30-2005 11:46 AM
Authentication In A Http Request With Kerberos Ephraim Programming 0 08-03-2004 04:13 AM
HTTP request parsing: POST mofofish Programming 3 12-05-2003 10:11 AM
viewing outcoming HTTP request?... BCE_HAMAHA Linux - Newbie 1 12-15-2002 12:02 AM


All times are GMT -5. The time now is 11:30 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