We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7455
    • 2,204 Posts
    When installing modx

    the Installer tels me to set permissions to 666
    but when I do that it still says the same.
    the permissions must be 777 for the installer to work.

    Dimmy
      follow me on twitter: @dimmy01
      • 6726
      • 7,075 Posts
      Yes I have the same "issue", I don’t know if you’re running a dedicated box but ever since I switched from shared to dedicated I have this issue.

      My server admin told me this has to do with ownership of the files, when you’re not running SuPHP or phpsuexec but PHP is installed as an Apache module (my case), files created with PHP inherits permission from Apache and that forces you into having to CHMOD to 777 those files...



        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l'outil id
        • 22303 MODX Staff
        • 10,725 Posts
        Files that need to be written to by PHP need to be 666 and folders 777. Files should never really be 777. And you should be able to simply make them 775 and 664 if the owner is nobody or whatever the user account is that is executing Apache.

        If you have SSH access to your account, you can do something like this to make all directories or files below the current directory have these proper ownership/permissions:

        chown -R myaccount.apacheuser .
        find . -type d -exec chmod 0775 {} \;
        find . -type f -exec chmod 0664 {} \;

        This changes group ownership to the apacheuser (will be called "nobody" on many servers) and then provides write access to folders and files to this user while not providing world-writable permissions which could theoretically allow any user on the machine to modify the contents.

        However, you only want to do this to the files/folders that need to be writable since it does give PHP the ability to write to those files from any other account. This is why most hosts are switching to suExec to better limit access to your account from malicious users on the same machine.
          • 6726
          • 7,075 Posts
          I do have SSH access, thanks for the commands !

          I can also ask my server admin to switch to suExec, but he said it would slow down things... you think that’s negligible, especially considering I have a decent box with few websites ?

          If so, I might just ask him to do it, you’re never safe enough...
            .: COO - Commerce Guys - Community Driven Innovation :.


            MODx est l'outil id
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            I always make sure to get servers with suexec. Solves so many problems all at once. I don’t think performance is that different. A few milliseconds won’t make that much difference; most of MODx comes from the database, not files, anyway. Not to mention that most content ends up cached.
              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
              • 22303 MODX Staff
              • 10,725 Posts
              Quote from: sottwell at Mar 05, 2008, 11:17 AM

              I always make sure to get servers with suexec. Solves so many problems all at once. I don’t think performance is that different. A few milliseconds won’t make that much difference; most of MODx comes from the database, not files, anyway. Not to mention that most content ends up cached.
              But before you decide, let me just say that once an suExec account is hacked, your entire account is exposed in all it’s glorious detail. The only thing it prevents is malicious PHP users using the Apache account or another user account from attacking files you have made writable by the webserver, which is pretty useless without vectors to hack. In fact, not running suExec has prevented several attacks I’ve experienced from making it very far or getting any useful information.

              In summary, I would say that suExec makes it harder to attack up front, but if successful, can allow the attackers to do a lot more damage to your account. Of course, that generally limits the damage to your account which makes the shared hosting providers happier.