[Solved] Issue with mod_headers

Discussion in 'Apache Migration/Compatibility' started by aisonet, Nov 28, 2013.

  1. aisonet

    aisonet New Member

    Im running the latest version of Litespeed Web Server Enterprise v4.2.6 and I have a apache file that worked fine in apache, but is not working with Litespeed, I checked the headers and the server header is not removed and the new header X-WebServer is not added to the HTTP request. We need this since we are running litespeed in a cluster environment and need to see what server we are talking to.

    /etc/httpd/conf.d/server-identify.conf

    <IfModule mod_headers.c>
    Header always set X-WebServer "server1"
    Header unset Server
    </IfModule>
     
  2. mistwang

    mistwang LiteSpeed Staff

  3. aisonet

    aisonet New Member

    I have the following and it doesnt work, I do not see the header in the HTTP response from litespeed.

    <IfModule mod_headers.c>
    Header set X-SGServer "web1"
    </IfModule>
     
    Last edited: Dec 2, 2013
  4. aisonet

    aisonet New Member

    When will this get fixed?
     
  5. mistwang

    mistwang LiteSpeed Staff

    It works with current release.
    Maybe you did not enable .htaccess properly.
     
  6. aisonet

    aisonet New Member

    Its not in the .htaccess, we dont want to use this in the .htaccess as this wouldnt make sense. We want it to be server wide and by server so it has to be in a file:

    /etc/httpd/conf.d/server-identify.conf

    Server 1 gets:
    /etc/httpd/conf.d/server-identify.conf:
    <IfModule mod_headers.c>
    Header set X-SGServer "web1"
    </IfModule>

    Server 2 gets:
    /etc/httpd/conf.d/server-identify.conf:
    <IfModule mod_headers.c>
    Header set X-SGServer "web2"
    </IfModule>
     
    Last edited: Jan 25, 2014
  7. aisonet

    aisonet New Member

    Did you fix this in the latest release?
     
  8. NiteWave

    NiteWave Administrator

    Wow, an thread 1 year 10 months old!

    Header set X-SGServer "web2"
    should work on lsws 4.x as well ?

    anyway I did tests just now, now lsws version is 5.0.7

    1. Header set
    Header set X-SGServer "web2"
    works at server level, both litespeed and apache

    2.Header unset Server
    litespeed: works at server level and .htaccess
    apache: can't unset Server, either server level or .htaccess
    so I can unset
    "Server: LiteSpeed"
    but can't unset
    "Server: Apache/2.2.3 (CentOS)"
    !

    3.Header unset X-SGServer
    works at server level and at .htacess, both litespeed and apache
     

Share This Page