I have set the Environment variable named “MyName” in my RHEL 6.6 and when i do
printenv MyName
I am able to view the value of MyName
Now, in my httpd.conf ( HTTPD 2.2), I am using below configuration
< IfModule mod_headers.c >
PassEnv MyName
Header set X-Server-Name “%{MyName}e”
< /IfModule >
During the restart, it says [warn] PassEnv variable MyName was undefined
I have below modules already enabled in httpd 2.2
LoadModule env_module modules/mod_env.so
LoadModule headers_module modules/mod_headers.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule cgi_module modules/mod_cgi.so
After googling a lot, I found few says to use SetEnv however it will override the existing value of my variable, which I do not want. Please help !!!
Desired result : when I access my page from web-server, in Response Headers I should be able to view below value
X-Server-Name : ( value of my MyName variable )