• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 298
  • Last Modified:

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

0
systemsautomation
Asked:
systemsautomation
  • 3
  • 2
  • 2
1 Solution
 
trencH87Commented:
In your config, add this line above the ones you posted here.

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

server.name = “ex”

Open in new window

0
 
systemsautomationAuthor Commented:
Thanks for the answer

Actually I want to put the client's IP address to this variable. Can you please guide me ?
0
 
Ray PaseurCommented:
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
0
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 
trencH87Commented:
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
0
 
Ray PaseurCommented:
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!
0
 
trencH87Commented:
Hehe, true true.
0
 
systemsautomationAuthor Commented:
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:

http://www.experts-exchange.com/Software/Server_Software/Web_Servers/Apache/Q_26495831.html
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now