After accidentally applying a recursive chmod to the entire MODX installation directory, the system became partially unusable. Backend access, file uploads, package management, and cache operations started failing due to incorrect file and folder permissions. I am seeking authoritative clarification on the correct permission scheme for a standard MODX installation, with specific focus on the assets/, core/, manager/, and cache/ directories.
Step to reproduce
Recursively change permissions on the entire MODX root directory, for example: chmod -R 555/var/www/modx
Yeah, those things can really ruin your day. Correct permissions also depend on how the ownership is configured on your server. Does Apache/Nginx run as www-data, or as the same user that you’re logging in with?
In any case, you could try the following commands to see if things will return to normal a bit more:
find /path/to/your/project/ -type d -exec chmod -c 0755 {} \;
find /path/to/your/project/ -type f -exec chmod -c 0644 {} \;
The first line targets all directories, and the second line all files.
If no improvement: try with 0775/0664. And could you post the output of ls -la in your root folder?
This will probably break the vendor folder though. However, that’s easily installed by going to GitHub - modxcms/revolution at v3.1.2-pl (or whatever specific version), copying the composer.json to your MODX root directory and running composer install
If you get a warning about not having composer you can just run sh -c "$(curl https://modx.co/scripts/install.sh)" and follow the instructions to install composer.