photo / frontend

The official @github repository of the Trovebox frontend software. A photo sharing and photo management web interface for data stored "in the cloud" (i.e. Amazon S3, Rackspace CloudFiles, Google Storage).
https://trovebox.com
Apache License 2.0
1.38k stars 244 forks source link

CSS not loading with apache, on raspberry pi #1361

Closed ghost closed 11 years ago

ghost commented 11 years ago

Hi guys,

I'm trying to run openphoto on a raspberry pi. Went through all the ubuntu doc, as i'm using the debian like Raspbian “wheezy” image.

It is working "properly" except some css/js won't load.

http://openphoto.dev/assets/themes/fabrizio1.0/stylesheets/lessc?f=less/index.less
http://openphoto.dev/assets/cache/co/js/c/assets/javascripts/openphoto-util.js,/assets/javascripts/openphoto-helper.js

Here is my apache conf :

<VirtualHost *:80>
  DocumentRoot /var/www/openphoto/src/html
  ServerName openphoto.dev

  RewriteEngine on
  RewriteCond %{HTTP_HOST} !^openphoto.dev$
  RewriteRule ^.*$ http://openphoto.dev [R,L]

  <Directory "/var/www/openphoto/src/html">
    Order deny,allow
    Allow from all

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)\?*$ index.php?__route__=/$1 [L,QSA]

    #403 Forbidden for ini files
    #RewriteRule \.ini$ - [F,NC]

    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/x-javascript
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  </Directory>

  #404 Not Found for ini files
  AliasMatch \.ini$     /404

  ExpiresActive On
  ExpiresByType text/javascript "A31536000"
  ExpiresByType application/x-javascript "A31536000"
  ExpiresByType text/css "A31536000"
  ExpiresByType image/x-icon "A31536000"
  ExpiresByType image/gif "A604800"
  ExpiresByType image/jpg "A604800"
  ExpiresByType image/jpeg "A604800"
  ExpiresByType image/png "A604800"

  Header set Cache-Control "must-revalidate"
  FileETag MTime Size
</VirtualHost>

Am i doing anything wrong? Did any of you guys went through that kind of issue?

Thanks for your help!

jmathai commented 11 years ago

There's an issue where the URL might be too long. Can you set mode="prod" under src/configs/override.ini?

[site]
mode="prod"
ghost commented 11 years ago

Hi jmathai,

Thanks for your answer. I've tried that, unfortunately i'm still having no css/js loading.

It appears to be searching for something under src/html/assets/cache, which is actually empty. Apache has every rights on it. Then i get a 404 error (that's for the .js)

I also get a 500 error for the css, trying to load assets/themes/fabrizio1.0/stylesheets/lessc?f=less/index.less

Any other suggestions?

ghost commented 11 years ago

As a matter of fact, it indeed fixed the .js problem! About the css, it appears that i had reached the max execution time...

It seems that the raspberry is not fast enough to load the .css within 60s. >< I'll try tunning it a bit but i'm affraid the hardward won't let me reach a usable state.

Thanks for the help anyway,

Cheers

jmathai commented 11 years ago

We can/should include a generated css file. Here is the current one, https://dm5ing2l7y91e.cloudfront.net/assets/versioned/db/themes/fabrizio1.0/stylesheets/lessc?f=less/index.less

The issue is we are compiling the CSS from LESS files.

ghost commented 11 years ago

Yes, indeed i saw that. I guess i can make an exception for that file, and load it the old fashion way!

Thanks for you help!