2

Cloned Magento2 from github sources here : https://github.com/magento/magento2

The installation went fine. However some issues appeared when browser is downloading static files. Multiple files missing from:

pub/static/frontend/Magento/blank/en_US/*

The installation went fine, AFAIK all static files were loaded.

P.S.

This might be somehow related but it seems that URL's are not rewritten correctly - throwing 404 page. I guess there is some strong correlation, but I can't see where exactly? Did some research (applied them) but without results

Community
  • 1
  • 1
sitilge
  • 3,687
  • 4
  • 30
  • 56
  • What server are you on? apache or nginx? – Maddy Mar 01 '16 at 20:40
  • is your nginx config set same as suggested? https://github.com/magento/magento2/blob/develop/nginx.conf.sample also if you have access to command line please try running `bin/magento setup:static-content:deploy` and check permissions again – Maddy Mar 02 '16 at 21:50

3 Answers3

0

I was not having any luck with the "deploy" command. I turned on developer mode, which does not require the deployed static files, but still no go

Turns out there were other problems as well: The Path names for the CSS and JS files were still looking for the files in a deployed directory under "pub/static" Adding this setting in 'core_config_data' solved that: From This Answer

insert core_config_data (config_id, scope, scope_id, path, value) values (null, 'default', 0, 'dev/static/sign', 0); 

After that issue was solved I still had problems. The .htaccess files have lines using the Apache 2.2 syntax. I changed the main .htaccess to apaches 2.4 syntax but didn't realize there are many .htaccess files throughout the system. The one in the "pub" directory was preventing the css and js files from being accessed, because Apache gave up after not being able to parse .htaccess

In the .htaccess I simply put all occurances of these two lines as comments

    #order allow,deny
    #deny from all

It's just a demo Install on my local computer, so I'm not concerned. What one really needs are the Apace 2.4 versions for the .htaccess files.

andypotter
  • 130
  • 6
0

firstly you must set the file permissions

find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
chown -R :www-data . # Ubuntu
chmod u+x bin/magento 

Then clear the cache via command php bin/magento clear:cache

From now when you go to any page the necessary static files generated automatically.

-1

you must clear the folders in pub/static folder and than deploy the content

To delete the folders in pub/static folder

rm -rf pub/static/frontend/ pub/static/adminhtml/ pub/static/_requirejs/

than deploy

bin/magento setup:static-content:deploy
Emizen Tech
  • 3,529
  • 1
  • 17
  • 33
  • for nginx you can use this configuration https://github.com/magenx/Magento-nginx-config/blob/master/magento2/sites-available/magento2.conf – Emizen Tech May 24 '16 at 11:48