Getting suEXEC to work on Apache2

I've been trying to figure out why suEXEC makes my scripts give out 500 errors. Without the suEXEC SuexecUserGroup command everything works fine.
I know its installed and configured properly cause all I had to do was load the module in the httpd.conf files and it outputs the message in the log files like its supposed to.

I have users set up for each host and they all belong the the group www.
Now for any particular host I use:
SuexecUserGroup example.com www
And when I run the script I get a 500 error. Premature end of script headers.

Well not sure why this is. Remember that it WORKS FINE when I dont use the SuexecUserGroup command.
I am running RedHat 8, Apache 2, Perl 5.8
This is how my virtualhost's looks.

<VirtualHost *>
    DocumentRoot /var/www/example.com/html
    ServerName www.example.com
    ServerAlias example.com
    ServerAdmin jeyb@rogers.com
    ScriptAlias /cgi-bin/ /var/www/example.com/cgi-bin/
    SuexecUserGroup example.com www
    ErrorLog /var/www/example.com/error_log
    CustomLog /var/www/example.com/example.com_log main
    <Directory "/var/www/example.com">
        Options +Includes
    </Directory>
    <Directory "/var/www/example.com/html">
        AllowOverride all
    </Directory>
    <Directory "/var/www/example.com/cgi-bin">
        Options +ExecCGI
    </Directory>
</VirtualHost>

Please tell me how to fix this.
Thanks,
Jey
jeybAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

heskyttbergCommented:
Hi!

This logfile might be pretty helpful:
/var/log/httpd/suexec.log

What I noticed is that oyu need same permissons on the /var/www/example.com/cgi-bin dir as there is on the files. This dir and files in it also need same user/group owners as you set in the SuexecUserGroup directive.

If you make theese changes everything will work great.

Regards
/Hans - Erik Skyttberg
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
heskyttbergCommented:
oyu = you, :)
0
jeybAuthor Commented:
I tried that but I keep getting 500 errors even though the scripts perfectly fine.
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

heskyttbergCommented:
Hi!

Oh, and the files or dir can't be group or world readable.

Every change you do and test, check in following gile for error and change permissons accordingly:
/var/log/httpd/suexec.log

If I remember correctly it was there it's saved, any permisson errors will be in there and just go fix them and it will work.

Regards
/Hans - Erik Skyttberg
0
jeybAuthor Commented:
I get these errors:
[2003-03-20 14:27:27]: user mismatch (nobody instead of apache)
[2003-03-20 14:27:29]: user mismatch (nobody instead of apache)

Aren't I supposed to run apache as user nobody and group nobody?

And where exactly do I put in the SuexecUserGroup. Like after which line.
0
jeybAuthor Commented:
also I tried setting the user to apache and group to nobody and still the same 500 error.
0
jeybAuthor Commented:
Thanks.
It worked I just forgot to do something also thats why it didn't work the second time.

:)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.