Pre-installation permissions - udermod and chown error

My Setup

Dedicated Server
I setup the server with developer
CentOS 7.8.2003, Apache 2.4.46, PHP 7.4.10
Magento 2.4

Error on pre-installation permissions

On the guide I copied and run

find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} + && find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} + && chown -R :www-data . && chmod u+x bin/magento

but I got this -> chown: invalid group: ‘:www-data’

I tried

usermod -g www-data username

-> usermod: group 'www-data' does not exist

Apache running on CentOS is slightly different from Apache on Ubuntu.

The instructions you’ve used are for Ubuntu, not CentOS. I believe you need to replace www-data with apache. I can’t remember. We don’t do much stuff on CentOS here.

I see. Do you think using Ubuntu is better than CentOS for running Magento 2?

Is Apple better than Android for making phone calls? It doesn’t really matter. You go with whatever you’re used to using. However, I have found Ubuntu/Apache better documented online than other setups - Which is the setup I always use in my videos.

I got the point. Noted Ubuntu/Apache has better document. Thanks Craig! :slightly_smiling_face: