0

I've been using the following post for some time to avoid using sudo:

How to avoid using sudo when working in /var/www?

But when I use Laravel to create folders, it's created under group www-data and user www-data, and then I have to perform all the commands in the post all over, i.e.:

sudo gpasswd -a "$USER" www-data
sudo chown -R "$USER":www-data /var/www
find /var/www -type f -exec chmod 0660 {} \;
sudo find /var/www -type d -exec chmod 2770 {} \;

It's annoying because the code I'm working on creates many new folders and files.

The server (via the Laravel code) creates folders with the following permissions:

drwx--S--- 2 www-data www-data

and files with the following permissions:

-rw-r--r-- 1 www-data www-data

In this case, how can I avoid using sudo?

Foobarer
  • 367
  • 1
  • 8
  • 16
  • Is the Apache user required? If the permissions should always be for a user account, perhaps the Apache configuration can be changed to run as that particular user. – matigo Nov 20 '22 at 22:24
  • Btw it's nginx, maybe I could try to find a way to do that – Foobarer Nov 21 '22 at 05:34

0 Answers0