Disable suexec in apache

If you are trying to get python, perl or cgi scripts to work with Apache and you come across this error.

[Thu Sep 25 09:36:28 2014] [error] [client x.x.x.x] suexec policy violation: see suexec log for more details
[Thu Sep 25 09:36:28 2014] [error] [client x.x.x.x] Premature end of script headers: x.py

you can fix this either by configuring suexec properly(which require efforts beyond this discussion) or by disabling suexec.

Disable suexec in apache(centOS)

1. Run command (to get suexec location):

httpd -V | grep -i suexec

-D SUEXEC_BIN=”/usr/sbin/suexec”

2.Move suexec binary:

mv  /usr/sbin/suexec  /usr/sbin/suexec.unused

3.Restart apache:

service httpd restart

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s