LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 12-30-2006, 04:40 PM   #1
Shioni
Member
 
Registered: Mar 2006
Posts: 182

Rep: Reputation: 30
Apache/PHP, Get real IP, not $_SERVER['REMOTE_ADDR']?


Hi!
Is $_SERVER['REMORE_ADDR'] value is determinated by HTTP or TCP? I'm not sure, I remember I read somewhere, that it's determinated by HTTP, not sure if it's true, but if is, then how do I real IP from Apache, because somebody might spoff the IP in HTTP level. Thanks!
 
Old 01-01-2007, 01:27 AM   #2
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
I'm not sure I understand you correctly, but I get my Apache (a self compiled httpd-2.2.3) to have a certain IP by adding this in httpd.conf:

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
#ServerName www.example.com:80
ServerName 169.254.255.20:80

where 169.254.255.20 is the static IP of the machine running apache.
 
Old 01-02-2007, 10:09 AM   #3
Shioni
Member
 
Registered: Mar 2006
Posts: 182

Original Poster
Rep: Reputation: 30
Thanks!
I ment IP address of the visitor!
 
Old 01-02-2007, 10:44 AM   #4
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Yeah, the remote IP address. I'm not really sure, but I've seen that many PHP programs are able to get the "real" IP so it should be possible.

I've just googled the "get real ip php" and it should give you a few interesting links.

This one for instance:
http://www.webhostingtalk.com/showthread.php?t=516172
 
  


Reply



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
PHP $_SERVER['HTTP_REFERER'] returns previous url? ldp Programming 6 05-11-2018 02:14 AM
$_SERVER['QUERY_STRING']-php Manashi Programming 10 04-20-2006 05:01 PM
Filter REMOTE_HOST and REMOTE_ADDR with Squid proxy j1mmyd3an Linux - Security 2 03-20-2005 11:38 PM
Filter REMOTE_HOST and REMOTE_ADDR with Squid proxy j1mmyd3an Linux - Networking 1 03-20-2005 10:48 PM
php $_SERVER value missing dinges Programming 6 12-23-2004 02:09 PM

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

All times are GMT -5. The time now is 06:25 PM.

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