Giter VIP home page Giter VIP logo

Comments (11)

kencinder avatar kencinder commented on May 20, 2024 3

Just in case anyone else wants to know how to get this working on their Apache webserver, I figured it out.
Tweak the following to suit your setup.

DocumentRoot /var/www/
<Directory /var/www/>
allow from all
Options FollowSymLinks
Require all granted
SetEnv no-gzip

        RewriteEngine on

        # Make sure the browser supports gzip encoding before we send it
        # without it, Content-Type will be "application/x-gzip"

        RewriteCond %{HTTP:Accept-Encoding} \b(x-)?gzip\b
        RewriteCond %{REQUEST_FILENAME}.gz -s
        RewriteRule ^(.+) $1.gz [L]

    # Also add a content-encoding header to tell the browser to decompress

    <FilesMatch .gz$>
        ForceType application/json
        Header set Content-Encoding gzip
    </FilesMatch>
    
</Directory>

Edit - I forgot to note that this needs the HEADERS and REWRITE mods for Apache enabled.

from bluemap.

TBlueF avatar TBlueF commented on May 20, 2024 1

Oh god no! This is intended! :D
The files are saved as .gz to save space (a lot!!) and are sent by the webserver directly using the Content-Encoding: gzip header, so the browser extracts them on the fly..

You can setup your webserver so it does that:
with nginx there is the setting gzip_static always; you can use for the .gz files
and apache can do that as well im sure.

Please don't extract them, they will be up to 20x as big xD

from bluemap.

TBlueF avatar TBlueF commented on May 20, 2024 1

@Sciroccogti Since i am not an apache expert myself, all i can offer you currently is this:
https://coderwall.com/p/sx-8xa/serving-pre-compressed-assets-through-apache

the difference would be that its .json.gz files in our case..

maybe you can adapt from that

from bluemap.

ewized avatar ewized commented on May 20, 2024

At least there should be an option to generate the non gz versions of the files

from bluemap.

TBlueF avatar TBlueF commented on May 20, 2024

I will add that to the config

from bluemap.

TBlueF avatar TBlueF commented on May 20, 2024

Added with 3b53932

from bluemap.

Sciroccogti avatar Sciroccogti commented on May 20, 2024

Oh god no! This is intended! :D
The files are saved as .gz to save space (a lot!!) and are sent by the webserver directly using the Content-Encoding: gzip header, so the browser extracts them on the fly..

You can setup your webserver so it does that:
with nginx there is the setting gzip_static always; you can use for the .gz files
and apache can do that as well im sure.

Please don't extract them, they will be up to 20x as big xD

I think you should notice those who use self hosted webservers to turn the gzip_static option on 😄!

I 'm new to Apache, and I couldn't have my map hosted correctly until I found this issue. Maybe more guys will run into this problem.

Thanks! Anyway it's a great mapping tool!


Update: I still don't know how to configure the Apache to host the map correctly. Of course it's not your fault, but I'll appreciate it if there's any help.

from bluemap.

Sciroccogti avatar Sciroccogti commented on May 20, 2024

@TBlueF It's very kind of you to offer the tutorial, but it's still not working.

I have now switched to Nginx, however it turns out that my website is not working yet.

I'm sorry to bother you, but could you PLZ have a look at my conf in nginx/sites-enabled/?

server {
        listen 80;
        listen [::]:80;

        server_name map.sciroccogti.top;

        root /path/to/BlueMap/web/;
        index index.html;

    gzip on;
    gzip_static on;
    gzip_http_version 1.1;
    gzip_disable "MSIE [1-6]\.";
    gzip_vary on;
    gzip_proxied expired no-cache no-store private auth;
    #gzip_types text/plain text/json  application/x-javascript text/xml application/xml application/xml+rss text/javascript application/json;

    #return 301 https://$server_name$request_uri;

        location / {
                try_files $uri $uri/ =404;
        }
}

BTW, I noticed that gzip over ssl is not safe, is that true?

from bluemap.

TBlueF avatar TBlueF commented on May 20, 2024

@Sciroccogti Sorry, i can and will not help you here with bluemap unrelated issues.
Also, the "gzip over ssl is not safe" link you posted links to an issue with nginx from 2014 that has been resolved.

from bluemap.

Sciroccogti avatar Sciroccogti commented on May 20, 2024

@TBlueF That's OK. Thanks anyway.

from bluemap.

Sciroccogti avatar Sciroccogti commented on May 20, 2024

I figured it out. The lines about location make the server no working. The successful conf is list below:

server {
        listen 80;
        listen [::]:80;

        server_name map.sciroccogti.top;

        root /path/to/BlueMap/web/;
        index index.html;

        gzip off;
        gzip_static on;
        gzip_proxied expired no-cache no-store private auth;
}

from bluemap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.