systemsautomation
asked on
Error with Lighttpd
Hello
I am adding the following lines in lighttpd.conf
server.modules += ( "mod_setenv" )
setenv.add-request-header = ( "X-Proxy" => server.name )
But when reloading getting following error:
Reloading web server configuration: lighttpdUndefined config variable: server.name
But when change it to following it works fine
server.modules += ( "mod_setenv" )
setenv.add-response-header = ( "X-Proxy" => "www-02" )
It is not getting server.name. I have got this example from http://www.cyberciti.biz/faq/mod_setenv-lighttpd-send-custom-headers/ and trying to implement at my place but failing.
Please help
I am adding the following lines in lighttpd.conf
server.modules += ( "mod_setenv" )
setenv.add-request-header = ( "X-Proxy" => server.name )
But when reloading getting following error:
Reloading web server configuration: lighttpdUndefined config variable: server.name
But when change it to following it works fine
server.modules += ( "mod_setenv" )
setenv.add-response-header
It is not getting server.name. I have got this example from http://www.cyberciti.biz/faq/mod_setenv-lighttpd-send-custom-headers/ and trying to implement at my place but failing.
Please help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
In correctly configured PHP on a LAMP stack you can usually find the client's IP address here:
$_SERVER["REMOTE_ADDR"]
It is a string that looks something like this:
98.169.58.122
This is not 100% foolproof, but I have found it to be pretty reliable. HTH, ~Ray
$_SERVER["REMOTE_ADDR"]
It is a string that looks something like this:
98.169.58.122
This is not 100% foolproof, but I have found it to be pretty reliable. HTH, ~Ray
Read the question first, Ray ;o)
To the last question: Change the server.name to server.bind in both lines: "X-Proxy" => server.name becomes "X-Proxy" => server.bind and server.name = "servername" becomes server.bind = "IP-address"
Best of luck!
Chris
To the last question: Change the server.name to server.bind in both lines: "X-Proxy" => server.name becomes "X-Proxy" => server.bind and server.name = "servername" becomes server.bind = "IP-address"
Best of luck!
Chris
Well, it was posted in the PHP zone, and the Asker wrote, "Actually I want to put the client's IP address to this variable." Guess you can't please everyone!
Hehe, true true.
ASKER
Hello trencH87
Your solution is quite closer and may be perfect as per this question's scope.
But the task I want to do ultimately is that I want to pass the User's IP (not server's) to a new CGI Variable. I have opened a new question for this and will be really thankful If you can help:
https://www.experts-exchange.com/questions/26495831/Lighttpd-HTTP-Headers.html
Your solution is quite closer and may be perfect as per this question's scope.
But the task I want to do ultimately is that I want to pass the User's IP (not server's) to a new CGI Variable. I have opened a new question for this and will be really thankful If you can help:
https://www.experts-exchange.com/questions/26495831/Lighttpd-HTTP-Headers.html
ASKER
Actually I want to put the client's IP address to this variable. Can you please guide me ?