Welcome, Guest
Please Login or Register.
Lost Password?
CGI scripts not working, after changing Home directory base from /home to /var/www/html? (1 viewing)
Post Reply

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

#2126
ah...lifes...good (User)
Posts: 260
graphgraph
CGI scripts not working, after changing Home directory base from /home to /var/www/html? 2006/06/11 12:45  
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.
  The administrator has disabled public write access.
#2127
ah...lifes...good (User)
Posts: 260
graphgraph
Re: CGI scripts not working, after changing Home directory base from /home to /var/www/html? 2006/06/11 13:22  
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.
  The administrator has disabled public write access.
#2129
ah...lifes...good (User)
Posts: 260
graphgraph
Re: CGI scripts not working, after changing Home directory base from /home to /var/www/html? 2006/06/11 13:29  
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.
  The administrator has disabled public write access.
#3351
MichaelHealey (User)
Posts: 15
graphgraph
Re: CGI scripts not working, after changing Home directory base from /home to /var/www/html? 2006/12/08 16:37  
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
  The administrator has disabled public write access.
#3360
Joe (Admin)
Posts: 4213
graph
Re: Re: CGI scripts not working, after changing Home directory base from /home to /var/www/html? 2006/12/09 01:30  
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.
  The administrator has disabled public write access.
Post Reply
get the latest posts directly to your desktop

Talk and Get Help

Support
Forums
Bugs and Issues

Get Virtualmin

OS Support
Buy Online
Download
Copyright 2005-2007 Virtualmin, Inc. All rights reserved.