HTTP Hearder


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting HTTP Hearder
# 1  
Old 02-25-2003
HTTP Hearder

I am trying to write a script which uses this cgi variable REMOTE_ADDR to get remote ip of users browsing the site and append it to apache header.

so when I do the following
Telnet servername 80
Head / HTTP/1.0 or GET / HTTP/1.0

it will show the ip apache of user making resquest in the general header fields

Can you help ?please
Thanks in Advance
# 2  
Old 02-27-2003
From reading your other post and this one, I assume that you are looking to output
something like...

% telnet oven 80
Trying 10.14.6.3...
Connected to myhost.it.com.
Escape character is '^]'.
GET / HTTP/1.1
Host: myhost.it.com

HTTP/1.1 200 OK
Date: Thu, 27 Feb 2003 17:40:05 GMT
Server: Apache/1.3.12 (Unix)
Last-Modified: Mon, 06 Aug 2001 13:25:55 GMT
ETag: "1bf28d-1db-3b6e9ae3"
Accept-Ranges: bytes
Content-Length: 475
Content-Type: text/html
Your-IP: xxx.xxx.xxx.xxx

<HTML>
<HEAD>
<TITLE> IS OPS UNIX </TITLE>
</HEAD>.....blah,blah,blah.

Since this would be an addition to the mod_headers (which you stated you use in your other post) can you post the changes you made to your file?
You might also want to look at
mod_log_config since this deals with logging remote IP addresses (which you should be able to then use in somehow in mod_headers)

From mod_log_config:
Quote:
The characteristics of the request itself are logged by placing "%" directives in the format string, which are replaced in the log file by the values as follows:

%...a: Remote IP-address
%...A: Local IP-address
Also, if you are using a script to try to dump this info into the headers, you would have had to change mod_headers to run the script (which I don't believe you can do but I could be wrong).

Seems like your best bet is to use the mod_log_config info and try placing it into mod_headers. Or take a look at mod_require_host which may suit your needs (at Snert.com )

Last edited by RTM; 02-27-2003 at 02:53 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk script to find time difference between HTTP PUT and HTTP DELETE requests in access.log

Hi, I'm trying to write a script to determine the time gap between HTTP PUT and HTTP DELETE requests in the HTTP Servers access log. Normally client will do HTTP PUT to push content e.g. file_1.txt and 21 seconds later it will do HTTP DELETE, but sometimes the time varies causing some issues... (3 Replies)
Discussion started by: Juha
3 Replies

2. Web Development

HTTP Headers Reference: HTTP Status-Codes

Hypertext Transfer Protocol -- HTTP/1.1 for Reference - HTTP Headers 10 Status Code Definitions Each Status-Code is described below, including a description of which method(s) it can follow and any metainformation required in the response. (1 Reply)
Discussion started by: Neo
1 Replies

3. Shell Programming and Scripting

http request

I am running a website but I still have problems with the "service temporarily unavailable error". I want to make a simple check if the website is up and running. Does anybody has an idea how to do it? (the site is password protected, so you have to add a user and pwd before logging in). ... (2 Replies)
Discussion started by: jurgen
2 Replies

4. Shell Programming and Scripting

sending http url through http socket programming..

hi am senthil am developing a software to send and receive SMS using HTTP connection first of all am forming a URL and sending that URL to a remote server using my Client Program i send that url through Socket(using Send() Function) if i send more than one URL one by one using the same... (4 Replies)
Discussion started by: senkerth
4 Replies

5. Programming

sending http url through http socket programming..

hi am senthil am developing a software to send and receive SMS using HTTP connection first of all am forming a URL and sending that URL to a remote server using my Client Program i send that url through Socket(using Send() Function) if i send more than one URL one by one using the same... (0 Replies)
Discussion started by: senkerth
0 Replies

6. UNIX for Advanced & Expert Users

libevent http 1.4

HI , guys . I'm programming in c . I want to know how to use libevent l.4 ,especially the use of http . can anybody give me a tutorial or URL? I just find this one , but it's about 2.0 Fast portable non-blocking network programming with Libevent you help will be very appreciated... (0 Replies)
Discussion started by: aobai
0 Replies

7. UNIX for Advanced & Expert Users

http over nfs

hey all, would like to ask if anyone has ever had any bad experience in serving http over nfs? (document root on nfs) why should i avoid this, if its not recommended? if the answer is nfs locks, i can tell apache to create the locks on local fs. are there any other caveats apart from... (3 Replies)
Discussion started by: marcpascual
3 Replies

8. Programming

Need help regarding HTTP parsing

Hi.. I've got a program that can connects to a remote server and displays some garbage value and closes the connection. The code goes like this #include <stdio.h> #include <netdb.h> #include <netinet/in.h> #include <string.h> #include <stdlib.h> #include <sys/types.h> #include... (5 Replies)
Discussion started by: rakesh_01
5 Replies

9. UNIX for Advanced & Expert Users

http

how to downloaad a web page using http server (0 Replies)
Discussion started by: krishnavel
0 Replies

10. Linux

HTTP server

Hello all, Please tell me that how to configure a HTTP server in Fedora Core 3 Also tell me about WEB HOSTING under Linux. (4 Replies)
Discussion started by: jaibw
4 Replies
Login or Register to Ask a Question