How to enable x-client-ip address in apache webserver LogFormat?


 
Thread Tools Search this Thread
Top Forums Web Development How to enable x-client-ip address in apache webserver LogFormat?
# 1  
Old 04-27-2017
How to enable x-client-ip address in apache webserver LogFormat?

how to enable x-client-ip address in apache webserver LogFormat
i tried below option, but no luck...
Code:
1. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

2. LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy

3. SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded

4. CustomLog "logs/access_log" combined env=!forwarded

5. CustomLog "logs/access_log" proxy env=forwarded

any help greatly appreciated

Last edited by Don Cragun; 04-27-2017 at 03:09 PM.. Reason: Fix CODE tags.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Runtime Error Enable user directory apache

Hi I am exactly according to this link CentOS 6 - Apache httpd - Enable Userdir : Server World I Enabled userDirectory Server version: Apache/2.2.15 CentOS release 6.8 (Final) But Iget this Error Forbidden You don't have permission to access /~mn/index.html on this server Goal... (2 Replies)
Discussion started by: mnnn
2 Replies

2. Shell Programming and Scripting

Apache webserver troubleshooting

Need assistance in getting apache installation troubleshooting.. - Compiled source code of apache webserver , Installed and configured apache, - started apache web server with no errors. - web browser doesnt open any pages . say "Page cannot be displayed". Need troubleshooting . - When i... (12 Replies)
Discussion started by: ajayram_arya
12 Replies

3. UNIX for Advanced & Expert Users

apache webserver url redirection

I need help in apache url redirection: I have added the below command in httpd.conf and it is working fine. Redirect http://xyz.com/site/homehttp://abc.com/site/home Can we set a rule such that http://xyz.com/site/* -> http://abc.com/site/* is applied For... (0 Replies)
Discussion started by: raghur77
0 Replies

4. Web Development

client authentication in sunone 7.0 webserver

hi, I am using sunone 7.0 webserver. The webserver instance is configured for https and i want to do client authentication for specific resources. I dont want to do any client authentication for the other resources. I was able to do a complete client auth for my webserver but unable to do... (0 Replies)
Discussion started by: pcs.abhishek
0 Replies

5. IP Networking

ip address of a client

A client(PC) connects to an unix server via terminal emulator. How can I obtain that client's IP address? The unix server is an old SVR4.2 (NCR) and the "who" command does not show ip addresses. I need a command or a shell script or a C/C++ program that will help me to obtain the client's... (6 Replies)
Discussion started by: ka2d2
6 Replies

6. UNIX for Advanced & Expert Users

apache webserver

Can I set up an apache webserver on Mandriva? Looking for the easiest webserver program to install basic webserver just for home use. Any ideas/suggestions much appreciated..... (2 Replies)
Discussion started by: jo calamine
2 Replies

7. UNIX for Dummies Questions & Answers

client IP address

when working on a telnet is it possible the client machine accessing the server machine supply its IP Address to the server machine . The only other shell i can use is the TCL shell. (2 Replies)
Discussion started by: rolly
2 Replies

8. UNIX for Dummies Questions & Answers

enable php & java support in apache

Hello guys, I am in desperate need for this information: I have an apache server running on linux (suse 8.1) I am unable to run php or java code on it, and I wonder what is wrong. for the php case, the browser asks me how he should treat the file, namely download it to my local drive or... (5 Replies)
Discussion started by: bionicfysh
5 Replies

9. IP Networking

Client Ip Address

I have a UNIX daemon program which takes client connections via TCP/IP sockets. What I need to know is if there is any way of getting the IP address of the client socket once a connection has been made... or do I have to code my client to send it manually ? Thanks. (1 Reply)
Discussion started by: ovingtond
1 Replies

10. UNIX for Advanced & Expert Users

Logout Apache WebServer!

I've just started an Apache WebServer a few days ago. I'm using a web site interface for uses to interact with when they login. There are only 5 accounts for my server at the moment. How would i create a logout link so that when the user wants to end their session and logout I can see this in... (1 Reply)
Discussion started by: cipher
1 Replies
Login or Register to Ask a Question
cgi(5)								Programmer's Manual							    cgi(5)

NAME
cgi - Common Gateway Interface DESCRIPTION
The Common Gateway Interface is a way to create dynamic web pages. It defines rules for interaction between a program and the web server while the server talks to the client. There are some ways to use it. ENVIRONMENT
Normally the webserver sets several environment variables to give some information to the CGI program so it can determine various stuff. AUTH_TYPE This reflects the authentification method used to validate a user. CONTENT_LENGTH The length of the data in bytes passed to the CGI program through standard input. This is used by the POST method. CONTENT_TYPE The MIME type of the query data, such as "text/html", optional. DOCUMENT_ROOT This reflects the document root directory of the webserver. GATEWAY_INTERFACE Reflects the version of the Common Gateway Interface that the server is using HTTP_ACCEPT A comma separated list of MIME type that the client is willing to accept. HTTP_FROM The email address of the user issuing the information request. This is not supported by most browsers. HTTP_REFERER Reflects the URL from which this CGI program was accessed. HTTP_USER_AGENT The name, version and libraries of the browser making the request. This information can be used to determine if the browser is capable of graphics and is able to display frames and tables. PATH_INFO This shows extra information that was passed to the CGI program via command line. Normally it's empty or non-existent. PATH_TRANSLATED The translated path on the local filesystem. QUERY_STRING This variable refers to additional arguments that were appended to the CGI program - normally with the '?' sign. REMOTE_ADDR This refers to the host from which the information request was issued, as IP number. REMOTE_HOST This refers to the host from which the information request was issued. REMOTE_USER The authenticated name of the user. REQUEST_METHOD This refers to the method with which the information request was issued. Normally this is either GET or POST. SCRIPT_NAME The virtual name of the script being executed. SERVER_NAME The server's hostname or IP number. This may be used to determine the correct paths or resulting HTML code for CGI programs that are used on the same machine for several servers. SERVER_PROTOCOL This is the name and version of the information protocol the request came in with. Normally this is "HTTP/1.0" or "HTTP/1.1". SERVER_PORT This refers to the TCP/IP port on which the webserver is running. SERVER_SOFTWARE This reflects the name and revision of the webserver software. AUTHOR
This CGI library is written by Martin Schulze <joey@infodrom.org>. If you have additions or improvements please get in touch with him. SEE ALSO
cgiDebug(3), cgiHeader(3), cgiSetType(3), cgiSetHeader(3), cgiGetValue(3), cgiGetVariables(3). CGI Library 6 April 2008 cgi(5)