CGI scripts not working, after changing Home directory base from /home to /var/www/html?

Hi,

I have changed the "Home directory base" at Virtualmin Pro module config, from /home to /var/www/html

CGI scripts are now not working on a virtual website. Error log indicates:

Premature end of script headers: env.pl

suexec policy violation: see suexec log for more details

Could someone tell me if what I need to do to enable the running of CGI scripts again?

Many thanks.

OK, I found that if I comment out this line under[ VirtualHost] section in the httpd.conf:

SuexecUserGroup "#501" "#501"

the CGI scripts will work again.

Perhaps I should also mention that when creating the virtual website, I have specified my own administrator username and password (instead of the default option of “automatic”). The administrator’s userID is 501, same as the line above.

Could someone please advise what is the correct way to make CGI scripts work again? Should I remove the "SuexecUserGroup "#501" "#501"" line in httpd.conf?

Thanks.

Forgot to mention that my cgi scripts are run not from /cgi-bin but in another directory.

Once I remove SuexecUserGroup "#501" "#501" in httpd.conf, the CGI scripts run OK.

I am also having this same problem. After commenting out the line:

SuexecUserGroup "#504" "#503"

Everything works. Can someone explain why this is and if its ok to have it commented out?

Thanks

I am also having this same problem. After commenting out the line:

SuexecUserGroup "#504" "#503"

Everything works. Can someone explain why this is and if its ok to have it commented out?

Thanks

Hey Michael,

Commenting this line out turns off SuExec…so everything executes as the Apache user. This isn’t a particularly bad thing, if your users are trusted. It is probably inadvisable otherwise.

The reason it’s happening is that the suexec_docroot doesn’t match where your homes are. In the original posters case, moving into /var/www/html was the source of the trouble–reverting to the system stock Apache packages would correct the problem in his case. I don’t know the source of the trouble in your case–I suspect you’ve got a Debian or Ubuntu system, and it’s ended up with the wrong apache2 package. (My fault. I’m trying to rectify it now.)

So, let me know the platform, and I’ll be able to be specific about what you need to check to be sure you have the right Apache build.