Welcome! Log In Create A New Profile

Advanced

setting ownership which works for BOTH nginx and sftp

Posted by adrigen 
setting ownership which works for BOTH nginx and sftp
October 27, 2010 12:11AM
Hi,

I have nginx running as a user of the same name:
[code]
-bash-3.2# ps -elf | grep nginx
0 S nginx 1081 1 0 78 0 - 37918 wait Oct19 ? 00:00:00 /usr/bin/php-cgi
1 S root 4105 1 0 79 0 - 14028 rt_sig Oct26 ? 00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
5 S nginx 4106 4105 0 75 0 - 14128 - Oct26 ? 00:00:00 nginx: worker process
0 R root 4339 3337 0 78 0 - 1506 - 03:55 pts/0 00:00:00 grep nginx
1 S nginx 31349 1081 0 76 0 - 61203 - Oct25 ? 00:00:14 /usr/bin/php-cgi
1 S nginx 31386 1081 0 76 0 - 62343 - Oct25 ? 00:00:13 /usr/bin/php-cgi
1 S nginx 32143 1081 0 76 0 - 62488 - Oct25 ? 00:00:12 /usr/bin/php-cgi
1 S nginx 32189 1081 0 76 0 - 61363 - Oct25 ? 00:00:12 /usr/bin/php-cgi
1 S nginx 32315 1081 0 75 0 - 61185 - Oct26 ?
[/code]

I can successfully load pages from here, in my browser:
[code]
/usr/share/nginx/html
-bash-3.2# ls -l
total 1908
-rwxrwxr-x 1 nginx nginx 3653 May 13 2008 404.html
-rwxrwxr-x 1 nginx nginx 3696 May 13 2008 50x.html
-rwxrwxr-x 1 nginx nginx 397 May 25 2008 index.php
[/code]

However I would also serve files from a users home folder /home/example4/srv/www/public_html/
This works when the files belong to nginx:nginx (I thought it should only need read access?!) but if I change the owner I get a 403 error.

Logging in as example4 via sftp only works when when I set example4 as the owner of the files, (but this causes a 403 error).

Is there way to set the permissions such that both will work?

Thanks in advance.
Re: setting ownership which works for BOTH nginx and sftp [solved]
October 27, 2010 03:38AM
Ok, I figured out the problem.

the reason setting permissions to example4:nginx didn't work, was that one of the directories didn't have [b]execute[/b] set for [b]group[/b]. I hope this is helpful to someone else ;)
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 70
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