cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,218
463
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.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
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:

Invalid command 'SetEnvIf', perhaps misspelled or defined by a module not included in the server configuration
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:

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.
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!