Magento – You don’t have permission to access /pub/static/frontend/Magento/luma/en_US/Magento_Checkout/template/minicart/content.html on this server

magento-2.0.2magento-2.0.4magento2

After upgrade from Magento 2.0.2 to 2.0.4 I am getting follwoing error message

  • On Mini Cart

    You don't have permission to access /pub/static/frontend/Magento/luma/en_US/Magento_Checkout/template/minicart/content.html on this server.

  • On Products Page

    Forbidden
    You don't have permission to access /pub/static/frontend/Magento/luma/en_US/mage/gallery/gallery.html on this server.

I have upgraded system using Web Setup Wizard. I have taken following steps after upgrade

Index are regenerated,
Permission are applied again,
Flushed Magento Cache

Best Answer

To resolve your issue with permission permanently, you need to set your primary user group in Linux to be "www-data" most of the time but you need to check your which apache belongs to.

To check which groups you belong to, type:

id

in the command line.

To change primary user group type in:

usermod -G oldusergroup newprimaryusergroup