LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-17-2005, 10:13 PM   #1
the_last_rites
LQ Newbie
 
Registered: Jan 2005
Posts: 5

Rep: Reputation: 0
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
 
Old 01-17-2005, 10:44 PM   #2
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
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
 
Old 01-17-2005, 11:23 PM   #3
the_last_rites
LQ Newbie
 
Registered: Jan 2005
Posts: 5

Original Poster
Rep: Reputation: 0
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

Last edited by the_last_rites; 01-17-2005 at 11:25 PM.
 
Old 01-18-2005, 12:27 AM   #4
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
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
 
Old 01-18-2005, 01:05 AM   #5
the_last_rites
LQ Newbie
 
Registered: Jan 2005
Posts: 5

Original Poster
Rep: Reputation: 0
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?
 
Old 01-18-2005, 11:54 AM   #6
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sorry guys.. grub problems bad superblock linuxbh Linux From Scratch 2 04-12-2005 10:12 AM
Newbie: ext3 permissions statmobile Linux - Newbie 7 02-09-2004 12:01 PM
Newbie with user permissions trouble. KiLLaWaBBiT Linux - General 7 08-14-2003 09:56 PM
newbie permissions version Linux - Newbie 7 06-16-2003 01:37 PM
hi guys, newbie here... azn_dude Linux - Newbie 11 05-07-2002 10:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration