kamzata's picture

After installed Magento 13.0 appliance and after run turnkey-init I logged in to Magento Connect trying to update it to 1.8.1 but I notice of some problem:

- in Magento Connect settings I'm not able to select "local filesystem" so I trying to change permission to www-data (chown -R www-data .) and it seems to work because after this I can select it.

- after this I check package update, I select all packages upgrade and after commit Magento crash. So, I trying to upgrade only package "Mage_all_latest" but Magento crash again return on frontend and backend the same page with message "Service not available".


Have you the same problem? Do you know when Magento turnkey appliance come out with 1.8.1?

Jeremy Davis's picture

As per this Magento forum post not only do you need to change ownership of /var/www/magento (which it sounds like you already have - FWIW this is a TKL bug which will hopefully be fixed in v13.1) but you also need to change the permissions level. So this is what I would do (you may not need to do the first line, but it's not a bad idea to be on the safe side):

chown -R www-data:www-data /var/www/magento
chmod -R 644 /var/www/magento

Also, I imagine that the next TKL Magento release will include the latest stable upstream version of Magento (which will be v1.8.1 or later - depending on when the next TKL version is released and what the latest stable Magento version is at the time).

kamzata's picture

Thank you but this is preferable and now it works like a charm. On Magento root directory:
chown -R www-data .
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;


Jeremy Davis's picture

Thanks for posting back! :)

kamzata's picture

I have another question:

now permissions on files and folders are owned by root:www-data. I edit and create my file with a code editor connecting through sftp and login with root user. This is the problem: files and folders edited and created are now owned by root:root.

How can solve this?

Jeremy Davis's picture

The easiest in the short term is to just rerun chown on your Magento folder.

In the longer term, a better solution might be to create a new user that is a member of the www-data group. However that will still probably require you to change the file permissions to 664 (so that the server can work with the files that are owned by the new user).

TBH I'm not 100% sure on the best overall TKL solution to this issue but I think it is something that we could configure better in the TKL appliances.

If you have any ideas or suggestions I'd be happy to hear them! :)

kamzata's picture

I'm trying this solution that for now seems work. So, recap:

useradd dev
usermod -g www-data dev
chown -R dev:www-data /var/www/magento/
find /var/www/magento/ -type f -exec chmod 664 {} \;
find /var/www/magento/ -type d -exec chmod 775 {} \;

and now i can edit my files through sftp with user dev login. What do you think? Is it enough a safe solution? Or is there a possible safety hazard?

kamzata's picture

I noticed a very annoying problem: on product evironment, session files are never eresed (something like 3 session files of 1kb on every 1 second!!!) due to php garbage collection that it never start. This causes serious slowdown till system crash.

To avoid this, php.ini needs to be set like this:


session.gc_probability = 0

and change to:

session.gc_probability = 1

and check these values:

session.gc_maxlifetime  = 1440

session.gc_divisor = 1000

Add new comment