Shape 5

General Category => Joomla Talk => : estaf February 20, 2017, 03:17:13 PM



: A holy theme about "acces rights" of Joomla's files/directories
: estaf February 20, 2017, 03:17:13 PM
How many times I study that theme, that many times I watch different minds about it.
There is the 100% of 100, that this theme come up. Touch me please to that one, because I can't found it and all doing so:
before editing certain ones/installing some packs/uploading some files etc:
chown -R $site:web-developers /home/ftp/$site
chmod -R 777 /var/www/$site

after it:
find /var/www/$site -type d -print0 | xargs -0 chmod 0755
find /var/www/$site -type f -print0 | xargs -0 chmod 0644

I know, that it's not right way. one size fits all, but I can't found a good way. Somebody (other internet resources) give the advice, that I must allow all, or allow all for tmp, cache directory etc.


: Re: A holy theme about "acces rights" of Joomla's files/directories
: mikek February 21, 2017, 08:09:44 AM
Hello,

I'm sorry I am not sure what you are asking. 644 for files and 755 for folders is the typical setup on most servers. If you can't write with those settings then there is an ownership problem on your server and you need to contact your hosting provider.


: Re: A holy theme about "acces rights" of Joomla's files/directories
: estaf February 21, 2017, 05:54:07 PM
Thank you, mikek
I'm and "hosting provider" and "owner"  :)
Joomla stands on my home server for tests.
The owner is ftp user, who works with a joomla directory /var/www/$site
It's my mistake.
I had decide to watch all again. I'd like to write in that topic all my changes on server,  to find mistake, that I had make. I forgot to add apache user to group, that use ftp user

vsftpd, apache, php, mysql stand on ubuntu server 14.04.03 lts.
How I had create all this one (maybe, I did something not right):
1.
:
sudo echo "/usr/sbin/nologin" >> /etc/shells
2. Create two groups. web-users - for users. and web-developers - for developers.
:
sudo addgroup web-users && sudo addgroup web-developers
3. The moment, that I had forgot to do.
:
sudo usermod -a -G web-users www-data && sudo usermod -a -G web-developers www-data
4. Create catalogs for that users (in /home directory)
:
sudo mkdir /home/web-developers && sudo mkdir /home/web-users
5. set alias
:
site=anteng
6. create catalog in ftp directory for user
:
sudo mkdir /home/ftp/$site
7. create user for project + temporary pass as 111.
:
sudo useradd $site -g web-developers -p 111 -d /home/ftp/$site -s /usr/sbin/nologin
8. mkdir directory for user
:
sudo mkdir -p /home/ftp/$site/$site
9.  set owner for directory
:
sudo chown $site:web-developers /home/ftp/$site
10. set ftp password for user
:
sudo passwd $site
11. create directory for apache location.
:
sudo mkdir /var/www/$site
12. Add mount point to /etc/fstab + mounting point
:
sudo echo "/home/ftp/anteng/anteng /var/www/anteng none    bind    0    0" >> /etc/fstab
sudo mount -a
13. owner+permissions
:
sudo chown -R $site:web-developers /var/www/$site
find /var/www/$site -type d -print0 | xargs -0 chmod 0755
find /var/www/$site -type f -print0 | xargs -0 chmod 0644
14 testing ftp
:
test to the writing, reading etc files/directories. uploading empty configuration.php to $site
:
exit
15. add a joomla three to ftp $site directory
16. Install joomla from internet browser.
all're ok
A moment was solved.