Magento-2-server-installation icon indicating copy to clipboard operation
Magento-2-server-installation copied to clipboard

Restoring a Magento install

Open gfxguru opened this issue 1 year ago • 7 comments

Restoring a know good backup changed the directory access rights? What's funny is the directories seem to be assigned the correct magento user and php-magento group but still getting permission denied.

gfxguru avatar Aug 27 '22 16:08 gfxguru

sudo chown magento:php-magento folder_name

artmouse avatar Aug 27 '22 17:08 artmouse

What I can't figure out is the folders seem to be assigned the correct access but I'm still getting Permission errors from nginx??

gfxguru avatar Aug 30 '22 10:08 gfxguru

What I can't figure out is the folders seem to be assigned the correct access but I'm still getting Permission errors from nginx??

Check www.conf on /etc/php/PHP_VERSION/fpm/pool.d

image

artmouse avatar Aug 30 '22 10:08 artmouse

Not work with magento from ROOT user.

When you run any command for magento cli or custom php script, please use magento user, either switch to: su magento -s /bin/bash

or run commands from root as user: su magento -s /bin/bash -c 'bin/magento'

This also applies to working with files.

artmouse avatar Aug 30 '22 10:08 artmouse

I use the magento user when I use the command line, here is my www.conf.

user = php-magento group = php-magento

; The address on which to accept FastCGI requests. ; Valid syntaxes are: ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on ; a specific port; ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on ; a specific port; ; 'port' - to listen on a TCP socket to all addresses ; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. listen = 127.0.0.1:9000

; Set listen(2) backlog. ; Default Value: 511 (-1 on FreeBSD and OpenBSD) ;listen.backlog = 511

; Set permissions for unix socket, if one is used. In Linux, read/write ; permissions must be set in order to allow connections from a web server. Many ; BSD-derived systems allow connections regardless of permissions. The owner ; and group can be specified either by name or by their numeric IDs. ; Default Values: user and group are set as the running user ; mode is set to 0660 listen.owner = magento listen.group = php-magento listen.mode = 0660

Nginx is giving permission denied for every file.

2022/08/29 23:59:36 [crit] 732#732: *449 open() "/home/magento/public_html/pub/static.php" failed (13: Permission denied), client: 40.77.167.5, server: www.mydomain.com, request: "GET /static/version1654524907/frontend/swissup/argento-force/en_us/mage/translate.min.js HTTP/1.1", host: "mydomain.com" 2022/08/29 23:59:56 [crit] 732#732: *452 open() "/home/magento/public_html/pub/static/frontend/swissup/argento-force/en_us/magento_ui/js/lib/knockout/bindings/bootstrap.min.js" failed (13: Permission denied), client: 40.77.167.5, server: www.mydomain.com, request: "GET /static/version1654524907/frontend/swissup/argento-force/en_us/magento_ui/js/lib/knockout/bindings/bootstrap.min.js HTTP/1.1", host: "mydomain.com" 2022/08/29 23:59:56 [crit] 732#732: *452 open() "/home/magento/public_html/pub/static/frontend/swissup/argento-force/en_us/magento_ui/js/lib/knockout/bindings/bootstrap.min.js" failed (13: Permission denied), client: 40.77.167.5, server: www.mydomain.com, request: "GET /static/version1654524907/frontend/swissup/argento-force/en_us/magento_ui/js/lib/knockout/bindings/bootstrap.min.js HTTP/1.1", host: "mydomain.com" 2022/08/29 23:59:56 [crit] 732#732: *452 open() "/home/magento/public_html/pub/static.php" failed (13: Permission denied), client: 40.77.167.5, server: www.mydomain.com, request: "GET /static/version1654524907/frontend/swissup/argento-force/en_us/magento_ui/js/lib/knockout/bindings/bootstrap.min.js HTTP/1.1", host: "mydomain.com"

Every time I try a restore on linode this happens????

gfxguru avatar Aug 30 '22 10:08 gfxguru

@gfxguru I send you email.

artmouse avatar Aug 30 '22 12:08 artmouse

got it

gfxguru avatar Aug 30 '22 13:08 gfxguru