LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Newbie Permissions Problems. Help me guys (https://www.linuxquestions.org/questions/linux-newbie-8/newbie-permissions-problems-help-me-guys-279117/)

the_last_rites 01-17-2005 10:13 PM

Newbie Permissions Problems. Help me guys
 
ok heres my problem . I am a total *nix noob and as expected the concept of permissions became a nightmare for me. My problem , to be more specific is that I am using Apache running on perl and I need to chmod some directories to 777 in a certain perl script while creating those directories because otherwise the directories dont get created by Apache ( apache logs in as "apache" ) Ok guys i know 777 mode is a security hole, Read around and found that suexec wud be a solution , but it looks like a roundabout way and moreover the whole damn thing sounded too confusing for me.I Know there has to be an easier method than that , so please help u apache and linux geniuses

twantrd 01-17-2005 10:44 PM

chmod 777 is not always the best way to go about things. First, who is apache run by? User 'nobody'? If so, allow user nobody to have 'w'rite permissions on the directories. That should solve your problem. To do this, man chmod and man chown.

-twantrd

the_last_rites 01-17-2005 11:23 PM

Quote:

Originally posted by twantrd
chmod 777 is not always the best way to go about things. First, who is apache run by? User 'nobody'? If so, allow user nobody to have 'w'rite permissions on the directories. That should solve your problem. To do this, man chmod and man chown.

-twantrd

apace doesnt run as nobody it runs as 'apache' thats the problem. btw can chmod and chown be executed by apache as system commands when running scripts ? btw these directories are created in a perl script at runtime

twantrd 01-18-2005 12:27 AM

Code:

apace doesnt run as nobody it runs as 'apache' thats the problem
Ok, it's not run by user 'nobody' but 'apache'. Allow the user apache to be able to write to those directories. In fact, just make the directories writeable by group 'apache'. The concept is the same. If a process is ran by a different user, you just have to set permissions accordingly for that user.

Code:

btw can chmod and chown be executed by apache as system commands when running scripts
Yes.

-twantrd

the_last_rites 01-18-2005 01:05 AM

thanx mate ur a lifesaver. on a final note so ur telling me this shud work fine

Code:

system mkdir ".$file_folder", 0777 or die "Can't make dir: $!";
system "chmod 755 .$file_folder";

right?

twantrd 01-18-2005 11:54 AM

I'm not a perl guru (well, not yet hehe) but I've used system differently. But if that syntax is correct, then yes, it should work. If it doesn't, paste what the error is here so I can help you.

-twantrd


All times are GMT -5. The time now is 06:02 AM.