Perl/CGI - suEXEC

iraklic's Avatar, Join Date: Mar 2008
Light Poster
Hi everyone,

this is my first post. I relly hope you guys can help me.

So here is the thing:

I am trying to write to file from web using cgi. The user for web is '' (nobody) and of course it has no priviladges to open file for writing. So now I wanna do that with suEXEC.

1. Could you tell me how?
2. I couldn't find $q->virtualhos() or something like that for my query...


Thanks in advance...
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
I guess your webserver is Apache, try this http://httpd.apache.org/docs/1.3/suexec.html
0
iraklic's Avatar, Join Date: Mar 2008
Light Poster
yes, it's apache.
been there... read that... didn't really help... may be I'm slow...

can you actually give me a quick short code for perl that does something using that? I'd appreciate that.

and... thanks for reply...
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
You'll need to configure SuExec on Apache to run Perl scripts as owner!
0
iraklic's Avatar, Join Date: Mar 2008
Light Poster
Let's say suECEX is installed and configured on Apache. So I am writing a script where I have to change user from default to mine and give it some priviladges, is that right? If yes then how do I do that? That is my question. Thanks.
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
You'll need to compile apache back from source with suexec support! What OS are you using?
0
iraklic's Avatar, Join Date: Mar 2008
Light Poster
I'm using linux. What do you mean compile apache back from sourse?

can you just show me a little exaple of cgi using suEXEC?
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
Here, this is a full tutorial of how to use suexec http://linuxplanet.com/linuxplanet/tutorials/1445/1/
0
iraklic's Avatar, Join Date: Mar 2008
Light Poster
Thanks it helps.
Last thing. So as I understand you have to configure suEXEC with it's users on apache side and is hase nothing to do with perl script itself (It just gains the user priviladges given by suEXEC).
Is this correct?
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
Yes right! Perl script remains the same, usually the perl script is executed by the user assigned to the web server, but by using suexec, the perl script is executed using the permissions of the user who owns it!