We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1841
    • 141 Posts
    Hi,

    Since moving to Revolution from Evolution I've been plagued by issues which underlying cause appears to be down to the permissions given to new files and folders when created by the CMS. Despite setting the new_file_permissions key in system settings, the CMS insists on saving the files as 644 and the user always appears as "Apache". Clearing the cache will not remove these files and when I go into FTP to remove them I can't because the FTP user isn't the same as the user that created the files.

    Please can someone help, this is driving me crazy, why are files being created by one user and then not deletable?
      • 1841
      • 141 Posts
      I understand that to delete files Modx uses the FTP user which would explain why it can't delete the files either, what I can't understand is why Modx is using the "apache" user and what I can do to solve this.

      Does anyone have any ideas?
      • I need help with this as well.
          Ben Morrison
          Hacking templates to pieces since 2003
        • When PHP is an Apache module, all .php scripts (in our case the index.php files) are run as the Apache user. Files and folders created by these scripts will be owned by the Apache user, and will have the permissions specified by the Apache user's umask setting. If you try to change the permissions MODx will use when creating files and folders (it has to change their permissions after it creates them) but it cannot delete the existing cache files, your changes won't take effect until the cache files can be manually deleted, since the original settings are in the cache.

          There are a few solutions to this. The best is to have Apache configured to use some form of suexec to switch the user of the .php files to the owner of the files (your FTP user) so the index.php files run as their owner user.

            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org