Error with Lighttpd

Posted on 2010-09-18
Last Modified: 2012-06-21

I am adding the following lines in lighttpd.conf

server.modules += ( "mod_setenv" )
setenv.add-request-header = ( "X-Proxy" => )

But when reloading getting following error:

Reloading web server configuration: lighttpdUndefined config variable:

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 I have got this example from and trying to implement at my place but failing.

Please help

Question by:systemsautomation
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2

Accepted Solution

trencH87 earned 500 total points
ID: 33707702
In your config, add this line above the ones you posted here.

Change the "ex" to whatever you want your server name to be. = “ex”

Open in new window


Author Comment

ID: 33707711
Thanks for the answer

Actually I want to put the client's IP address to this variable. Can you please guide me ?
LVL 110

Expert Comment

by:Ray Paseur
ID: 33708305
In correctly configured PHP on a LAMP stack you can usually find the client's IP address here:


It is a string that looks something like this:

This is not 100% foolproof, but I have found it to be pretty reliable.  HTH, ~Ray
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.


Expert Comment

ID: 33749102
Read the question first, Ray ;o)

To the last question: Change the to server.bind in both lines: "X-Proxy" => becomes "X-Proxy" => server.bind and = "servername" becomes server.bind = "IP-address"

Best of luck!

LVL 110

Expert Comment

by:Ray Paseur
ID: 33749667
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!

Expert Comment

ID: 33749683
Hehe, true true.

Author Comment

ID: 33750998
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:

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question