2

I'm really hoping someone can help me here. I started with a brand new VPS for Magento2, downloaded it, installed, ran the installer, all was great, except the page took like 5 minutes to load (admin or storefont) and no css/js/images would show. and I finally after about 20 hours, got it to work. What I did was reinstall magento from scratch (about 15 times) - and finally ran:

find . -type d -exec chmod 770 {} \; && find . -type f -exec chmod 660 {} \; && chmod u+x bin/magento

which broke everything, then I ran a permissions 755 on EVERYTHING. and finally I can view the store, and the admin. and seems to function somewhat ok.

Problem is, anything I do on the store, there's continual permissions issues going forward. Example, I upload a logo through the admin, and the logo is a 404 if you try to view it from a browser, until I go in and browse to the pub folder with the images, and change permissions on the logo .png file. (same goes for every product image, every everything)

Certainly there has to be some better way of solving this? so I guess the first part of the question is answered, but now a different issue. About ready to scrap magento, as this is just too time consuming. It should not be this difficult out of the box. I would LOVE any suggestions from anyone, thanks in advance!

Maybe it has something to do with the Magento file system owner stuff in the setup docs? is that something that can be changed after Magento is installed? and could this have anything to do with all these problems?

5
  • 1
    Ugh. You're not on your own here. Referring this in to the team.
    – benmarks
    Commented Jan 24, 2016 at 0:51
  • I'd certainly love any help, I'd really hate to scrap this project, I really need this store to work! :)
    – M21
    Commented Jan 24, 2016 at 1:05
  • if it helps, Steps I took was to create new website in WHM (apache VPS with hostgator) - the pre-install checklist had everything it needed, all the php modules, etc. - I created a mysql databse and user, applied user to database, put in those credentials into the self installer for magento... let the installer run - is said successful install, but then everything went as I put in my original post. (is this store even salvageable?) or do I need to wipe it clean and reinstall again? The other thing I did not do was the part about the changing file system owner etc... couldn't figure that out.
    – M21
    Commented Jan 24, 2016 at 2:10
  • 2
    Yes, the permissions on the filesystem have to be set correctly for things to work in Magento 2. If you're using php-fpm, where PHP runs as your main user, and the webserver runs as a less privileged user like "nobody" or "www-data", the webserver user must be in the group of the user that runs through php-fpm. Magento 2 removes world readable permissions on files, so the web server user must be in the group of the user that owns and creates the files. Commented Jan 24, 2016 at 5:24
  • Thanks for the reply Rob. can that be changed now that it's installed? or do I need to start over? Also, I sort of get what you're saying, but I have no idea how to actually set those permissions... I thin I might have to go back to 1.9 - this is just too much I think.
    – M21
    Commented Jan 24, 2016 at 6:10

1 Answer 1

3

The official documentation say that you need create user for magento installation and add this user to group of web server.

To fixing perform you need do:

  1. Add you user to web server group (how to find web server group):

    usermod -g [web-server-group] [user]

    for example on ubuntu vagrant box usermod -g www-data vagrant

  2. Recursive change group of files

    sudo chown -R :[web-server-group] [magento_root]

    example sudo chown -R :www-data /vagrant/magento2

4
  • I had found that, but none of it matches or works with my server for some reason: example, finding web server group: root@por [~]# egrep -i '^user|^group' /etc/httpd/conf/httpd.conf User nobody Group nobody UserDir public_html UserDir disabled UserDir disabled
    – M21
    Commented Jan 24, 2016 at 15:00
  • is there any deeper instructions, on that part specifically, the documentation it too vague for me, as I don't know what to do, since there seems to be no "group" just "nobody" - I cant follow the directions since nothing matches and I don't know enough about the owners/permissions, etc. to know how to proceed.
    – M21
    Commented Jan 24, 2016 at 15:12
  • I'm going to go ahead and accept this answer because I can tell it's the correct answer, unfortunately, I still cannot proceed with my storefront, because the answer is something I still do not know how to do.
    – M21
    Commented Jan 24, 2016 at 15:18
  • You are using your very specific environment to follow the official general guidelines about ownerships and permissions in Magento - the instructions are for CentOS or Ubuntu from which you can have some general idea how to do it in other environment as well. Your VPS may have some restricted user/group. If you provide us with the complete information about your environment with reproduction steps, we can try to reproduce it, and help you resolving this.
    – Anton Kril
    Commented Jan 25, 2016 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.