Just got a Digital Ocean server.
For a website, am I supposed to make the files permissions owned by root, www-data, or user?
What is www-data anyway?
What happens if I fuck up permissions, can something go public that not supposed to have access?
Files should be owned by the user.
www-data is the user under which Apache runs.
If you fuck up permissions you risk a lot more than private files going public.
>>54738831
any examples?
>>54738831
Well I installed Joomla to /var/www/html/joomla
Couldn't login, it gave error.
I didsudo chown -R www-data:www-data /var/www/html/joomla
Now it works. Did I do it right?
>>54738746
>files permissions owned by root
Only if you don't want anyone to see your site.
>What is www-data anyway?
User which apache runs as.
>What happens if I fuck up permissions, can something go public that not supposed to have access?
If it's in the web root, it's either public or you fucked up permissions and therefore it isn't.
Just put your libs and configs at least one level higher.
>>54738882
www-data is the user that reads and executes files, it does not need to own them.
For example, your website could be vulnerable to an exploit of some kind where an attacker could upload malicious files or overwrite existing files if those files are owned by the apache user, you're gunna have a bad time.
>>54738746
Just got an Ubuntu server there
It's Magento LAMP setup.