Gossamer Forum
Home : General : Perl Programming :

Permission

Quote Reply
Permission
Hi Folks,

I have a script that creates new text files with information inside them.

When the script creates the text files, the permissions are set to 600 and the owner is "nobody" and the group is "deamon".

How can I change this so that the group will be "users"? I mean, how can I get the script to create new files within the group "users" isntead of "deamon"?

Thankyou!

Wil.

Quote Reply
Re: Permission In reply to
change the group of your web server;)

-- Gordon

s/(\d{2})/chr($1)/ge + print if $_ = '8284703280698276687967';
Quote Reply
Re: Permission In reply to
My webserver is started up by root. Does that mean that the webserver will run under root? Beacuse it doesn't. It runs under deamon.

Wil.

Quote Reply
Re: Permission In reply to
The web server is creating the file, therefore the file inherits the user/group of the web server.
if your web server ran as root your server would last all of 3 seconds under the slowest of hackers:)

-- Gordon


s/(\d{2})/chr($1)/ge + print if $_ = '8284703280698276687967';
Quote Reply
Re: Permission In reply to
Yeah, but I don't have any hackers on my local network. The server is not connected to the outside world in any way so I am not worried about security issues just yet.

I start off Apache when I'm in SuperUser mode. Should I logon as root to start it off? All the files apache own are grouped as root and owned by root.

Regards,

Wil.

Quote Reply
Re: Permission In reply to
In your httpd.conf you will see:

User nobody
Group daemon

or something similiar. This tells Apache what user/group to switch to when you start it. You always start Apache as root (must be root to bind to port 80), but the children switch to run as nobody/daemon for serving requests.

You could change the User/Group above to create the files (don't change to root, just the user you want), or you could have your script modify the permissions on the file so they are accessible by others (it can't change the ownership though).

Cheers,

Alex



--
Gossamer Threads Inc.
Quote Reply
Re: Permission In reply to
Thankyou Alex. I forgot all about those two little directives.

Thanks for your help. Worked a treat.

Wil.