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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-17-2005, 11:13 PM
|
#1
|
LQ Newbie
Registered: Jan 2005
Posts: 5
Rep:
|
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
|
|
|
01-17-2005, 11:44 PM
|
#2
|
Senior Member
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440
Rep:
|
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
|
|
|
01-18-2005, 12:23 AM
|
#3
|
LQ Newbie
Registered: Jan 2005
Posts: 5
Original Poster
Rep:
|
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-18-2005 at 12:25 AM.
|
|
|
01-18-2005, 01:27 AM
|
#4
|
Senior Member
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440
Rep:
|
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
|
|
|
01-18-2005, 02:05 AM
|
#5
|
LQ Newbie
Registered: Jan 2005
Posts: 5
Original Poster
Rep:
|
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?
|
|
|
01-18-2005, 12:54 PM
|
#6
|
Senior Member
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440
Rep:
|
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 02:35 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|