LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-24-2008, 05:27 AM   #1
arsridhar
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Rep: Reputation: 0
Capturing client ip address at linux server


I have my clients running on windows /linux and my servers are on linux RHEL AS 4.

how do i capture the client ip addresses at the server?

based on the information of the client IPs, i intend to restrict access to various oracle forms on my application server.

Sree
 
Old 03-24-2008, 06:30 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you need to explain what "capture" actually means... you need this information to actually be usable in some way? well there are many many ways to "capture" an ip address, some useful, most not i expect...
 
Old 03-24-2008, 07:24 AM   #3
arsridhar
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
you need to explain what "capture" actually means... you need this information to actually be usable in some way? well there are many many ways to "capture" an ip address, some useful, most not i expect...

By capturing I mean , get the ip address of the client machine. This information, i.e.e the ip address will be used to restrict access to the oracle forms loaded on my application server. (my application server is on RH EL 4 AS 4).
 
Old 03-24-2008, 08:49 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
yes i know what the dictionary definition of "capture" is... where do you want to use this information? is it with a PHP script? within a firewall??
 
Old 03-25-2008, 01:19 AM   #5
arsridhar
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
yes i know what the dictionary definition of "capture" is... where do you want to use this information? is it with a PHP script? within a firewall??
i am sorry for having given the dictionary meaning.

i want to use the information to prevent access to a oracle form from a range of ip's or selected ip's. i have been given the solution to implement the restriction. the solution is as below.

The easiest most straight forward way would be to grab the http variable for REMOTE_IP, then do a switch in your code.

in pseudo code:

$ipaddress = REMOTE_IP
if($ipaddress==$ip1 || $ipaddress==$ip2 [etc])
{
//show form
}
else
{
print "access denied"
}


Here, i would like to know, where is the pseudo code and how to grab the http variable for REMOTE_IP.

to be more clear, if i restrict access from an ip for e.g 192.168.0.1 in hosts.deny/allow files, how does the OS check the ip of the client machine requesting access to implement the restriction.

i hope i have put the requirements clearly.
 
Old 03-25-2008, 06:12 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
ugghh, finally you're asking a PHP question...

so 3 seconds on google would have told you to use $_SERVER['REMOTE_ADDR'] as for the use of that data, you seem ware enough on PHP to do that part.
 
  


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
ip server and client: grab interface address rino.caldelli Programming 1 03-02-2006 06:00 AM
How to get IP address of client from server.c program nazsarwat Programming 1 04-22-2005 03:57 PM
how to get client ip address at udp server cranium2004 Programming 2 03-21-2005 11:35 PM
Network client not receiving address of DNS server arohl74 Linux - Networking 1 03-03-2005 06:58 AM
How to specify a gateway IP address for a linux client pjrestrepo Linux - Networking 3 11-30-2001 10:10 AM

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

All times are GMT -5. The time now is 10:05 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
Open Source Consulting | Domain Registration