google / google/neuroglancer

Apache config settings

Open
#357 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.5k
Forks
389
Avg merge
3d 21h
Merged PRs (30d)
3

Description

Hi,

I am trying to set up Apache (Apache/2.4.37 centos) for file serving but somehow I cannot get to work the `.gz` rewriting for the precomputed dataset. Chrome Dev Tool is showing 404 without `.gz` extensions. Could I be missing something here? I am looking at the following example.

Thank you,
-m

https://neuroglancer-scripts.readthedocs.io/en/latest/serving-data.html

```
# If you get a 403 Forbidden error, try to comment out the Options directives
# below (they may be disallowed by your server's AllowOverride setting).

# Needed to use the data from a Neuroglancer instance served from a
# different server (see http://enable-cors.org/server_apache.html).
Header set Access-Control-Allow-Origin "*"

# Data chunks are stored in sub-directories, in order to avoid having
# directories with millions of entries. Therefore we need to rewrite URLs
# because Neuroglancer expects a flat layout.
Options FollowSymLinks
RewriteEngine On
RewriteRule "^(.*)/([0-9]+-[0-9]+)_([0-9]+-[0-9]+)_([0-9]+-[0-9]+)$" "$1/$2/$3/$4"

# Microsoft filesystems do not support colons in file names, but pre-computed
# meshes use a colon in the URI (e.g. 100:0). As :0 is the most common (only?)
# suffix in use, we will serve a file that has this suffix stripped.
RewriteCond "%{REQUEST_FILENAME}" !-f
RewriteRule "^(.*):0$" "$1"

# Allow serving pre-compressed files, which can save a lot of space for raw
# chunks, compressed segmentation chunks, and mesh chunks.
#
# The AddType directive should in theory be replaced by a "RemoveType .gz"
# directive, but with that configuration Apache fails to serve the
# pre-compressed chunks (confirmed with Debian version 2.2.22-13+deb7u6).
# Fixes welcome.
Options Multiviews
AddEncoding x-gzip .gz
AddType application/octet-stream .gz

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.