Welcome! Log In Create A New Profile

Advanced

Re: Nginx Perl / Cgi Permission Problem

September 20, 2016 01:20AM
Hi,

On 09/19/2016 10:41 PM, basti wrote:
> Hello,
> I have a perl/ gci script that creates a dir and within that an subdir
> with permission 0750. The owner of the dirs are www-data.
>
> nginx can't delete the dirs because this is run as user nginx.
> is there a way to set the user for perl/cgi to nginx? only for this
> location?
>
> best regards
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
Not as such. However, as it sounds like you're running on linux, you can
fool around a bit and sort of do it backwards...

Set the perms on the parent directory to 2770, and the group ownership
to nginx. What this does is to enforce the old BSD file ownership
method, in that every file - be it flat or a directory - created in this
directory will have the group ownership of nginx ( it's parent ), and
that this functionality will be transferred to any subdirectories that
are created. That's half of the battle won.

The second thing that needs to be done it to add group write permissions
to these files. Basically, the UMASK of the environment that the perl
script is running needs to be set to 0002 from 0022.

This does mean that all files generated by the script will have group
write permissions, so it's not perfect, but it's a start. Hopefully
group write permissions to www-data aren't too bad.

hth,

Steve

--
Steve Holdoway BSc(Hons) MIITP
http://www.greengecko.co.nz
Linkedin: http://www.linkedin.com/in/steveholdoway
Skype: sholdowa

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx Perl / Cgi Permission Problem

basti September 19, 2016 06:44AM

Re: Nginx Perl / Cgi Permission Problem

Aleksandar Lazic September 19, 2016 04:48PM

Re: Nginx Perl / Cgi Permission Problem

GreenGecko September 20, 2016 01:20AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 200
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready