The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

disable mod_setenvif

Discussion in 'General Discussion' started by sjps, Jan 28, 2012.

  1. sjps

    sjps Registered

    Joined:
    Jan 28, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    Hello,

    I want to disable mod_setenvif apache module please help me to acheive this issue in cpanel server
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You can utilize a custom configure flag to ensure this Apache module is disabled. For example, if you are using Apache 2.2, you would complete the following steps:

    1. Create the following file if it does not exist:

    Code:
    /var/cpanel/easy/apache/rawopts/Apache2_2
    2. Add the following line to this file:

    Code:
    --disable-setenvif
    3. Rebuild Apache via EasyApache.

    The use of custom configure flags is documented at:

    Custom Configure Flags

    Modifying configure flags can result in a non-functional Apache build. cPanel takes no responsibility for custom changes, nor do we provide any warranty for what you do with this information. Proceed with caution.

    Thank you.
     
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello,

    I just wanted to provide some additional information. The above steps would cause an issue with EasyApache recompile not working if the httpd.conf file has any VirtualHost entries with SSL. This is due to the following line in /var/cpanel/templates/apache2/ssl_vhost.default file:

    Code:
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
    Any SSL VirtualHost entries will have that line in them, and the Apache recompile with the SetEnvif module disabled will produce this error and fail:

    The steps to disable SenEnvIf would be to do the following:

    1. Copy ssl_vhost.default to ssl_vhost.local

    Code:
    cd /var/cpanel/templates/apache2
    cp ssl_vhost.default ssl_vhost.local
    2. Comment out the SetEnvIf line in ssl_vhost.local file

    Code:
    sed -i 's/SetEnvIf/#SetEnvIf/g' /var/cpanel/templates/apache2/ssl_vhost.local
    3. Add the --disable-setenvif rawopts for EasyApache

    Code:
    echo "--disable-setenvif" >> /var/cpanel/easy/apache/rawopts/Apache2_2
    If you are using Apache2, change the file path name to /var/cpanel/easy/apache/rawopts/Apache2 instead.

    4. Recompile Apache

    Code:
    /scripts/easyapache --build
    Please only use the --build flag if you are okay with the latest PHP being used and do not wish to make any other changes. Otherwise, remove that flag and you would be able to go through the GUI interface to make modifications.

    As previously stated by Michael:

    I did test that this configuration above worked on my test server to disable the option, but your own environment may differ and produce undesired results.

    Thanks!
     
Loading...

Share This Page