do you have a cron job running scheduler?
Proper folder permissions
Can someone help me with proper folder permissions.
Ubuntu 20.04 Laravel 7.x
I tried about 100 different guides on how to set permissions and it works for that day, as soon as its a new day permission denied! Errors
I am logged in as a Sudo user
lets let say path is /var/www/site/html
sudo chown -R www-data.www-data /path/storage
sudo chown -R www-data.www-data /path/bootstrap/cache
works for a day
sudo chgrp -R www-data /path/storage /path/bootstrap/cache
sudo chmod -R ug+rwx /path/storage /path/bootstrap/cache
or
sudo chmod -R 775 /path/storage
sudo chmod -R 775 /path/bootstrap/cache
and on and on!
Can anyone help with this....so annoying to have to constantly looking and trying solutions that only work temporarily. Is there something I am missing?
Thanks all
just a short explanation:
drwxrwxrwx
d means, that it is a directory / - at the first position would mean, that it is a file
rwx are the 'R'ead-, Write- and eXecute-rights - the first block for the owner, the second block for the group and the third block for everyone
the www-data www-data is the user and group whom this belongs to.
the rwx is normally represented by a number (for example 0755) - in this number the values for r=4, w=2 and x=1 are summed up:
4+2+1 = 7 = rwx
4+1 = 5 = r-x
4+2 = 6 = rw-
and so on.
Normally the user from the webserver is www-data who is in the group called www-data - the user on the console normally is someone else (often when you access the server via FTP the user is called sftp)
with chmod you can adjust the rights - with chown you can change the owner of a file/directory
Normally everyone has the right to read your files, which makes sense, because you have a website, that everyone can see. The problems begin, when writing to files, because you don't want anybody to be able to write to your files. (therefor giving 0777 to a file or directory would be a bad idea!) - so what you want is 0775, so the owner and everyone in the group can write to that file.
So far so good - now we have our files and folders which belong to user andreas and group www-data - so everyone within this group can write those files.
But: if you create a new file, this will not automatically have the same rights as the containing folder. These rights are set concerning the umask-Value (see link in my other post) - so you need to make sure, that newly created files are writable by the group !
I hope this all made any sense ;-)
Please or to participate in this conversation.