0

After copying all files / db on my local VB when I tried to setup permissions:

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

Getting error [chown: invalid group: ‘:apache’]

I can see that apache is installed and running.

#sudo apache2ctl configtest: Syntax OK

#sudo a2enmod rewrite: Module rewrite already enabled

#sudo systemctl restart apache2: OK

#sudo ufw allow 'Apache full': Skipping adding existing rule: Skipping adding existing rule (v6)

#Sudo ufw allow ssh: Skipping adding existing rule: Skipping adding existing rule (v6)

Am working on Magento 2.4.3 on Ubuntu 20.04.3 LTS, PHP 7.4.3 with MySQL 8. Exactly same as my live site.

asked Jun 13, 2022 at 3:06

2 Answers 2

0

There would be no "apache" user group by default in Ubuntu. If you want to give the permission to the user group for apache, the default user group it lies under is "www-data", so replace the "apache" in the command to the "www-data" wherever you are mentioning the user group.

You can get some further reading here - https://askubuntu.com/questions/873839/what-is-the-www-data-user

answered Jun 13, 2022 at 5:04
0

may be your magento file is not permitted for current group and user.

First get your current user name with whoami command.

whoami

check current file owner with ls -l

and assign current group and user to your magento with chown command.

Ex: chown youruser:yourgroup Magentodir

you can get more details from devdoc.

https://devdocs.magento.com/guides/v2.4/config-guide/prod/prod_file-sys-perms.html

answered Jun 13, 2022 at 5:56

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.