Skip to content

Commit

Permalink
- Add example apache config files
Browse files Browse the repository at this point in the history
  • Loading branch information
pdille committed Sep 4, 2019
1 parent e80cfa8 commit 97d289f
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Example apache configuration, for EarthTime website serving
#
# To install,
#
# 1. Copy file and customize paths
#
# 2. Symlink into /etc/apache2/sites-enabled
#
# 3. Restart apache:
#
# sudo apachectl graceful
#

Define ROOTPATH /t/tm4.earthtime.org

<VirtualHost *:80>
ServerName tm4.earthtime.org
ServerAlias www.tm4.earthtime.org
DocumentRoot ${ROOTPATH}/app/data-visualization-tools/examples/webgl-timemachine
Options FollowSymLinks
Alias "/timemachine" "${ROOTPATH}/app/data-visualization-tools/timemachine"
Alias "/js" "${ROOTPATH}/app/data-visualization-tools/js"
Alias "/css" "${ROOTPATH}/app/data-visualization-tools/css"
Alias "/images" "${ROOTPATH}/app/data-visualization-tools/images"
Alias "/extras" "${ROOTPATH}/app/extras"
Alias "/info" "${ROOTPATH}/app/data-visualization-tools/info.html"

Header always set Access-Control-Allow-Origin "*"
Header set Cache-Control "max-age=60, public, must-revalidate"

<Directory "${ROOTPATH}/app">
AddOutputFilterByType DEFLATE application/octet-stream
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

Order Deny,Allow
Allow from all
Satisfy any
</Directory>

RewriteEngine on

# LANDING PAGE
RewriteRule "^/index.html$" "/landing/index.html" [PT]

# EXPLORE PAGE
RewriteRule "^/explore$" "/index.html" [PT]

# INTERACTIVE STORIES
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^.*\.(jpg|css|js|gif|png|json|geojson|svg|html)$ [NC]
RewriteRule "^/stories/(.+)$" "/index.html" [PT]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/stories/(.*)\.(jpg|css|js|gif|png|json|geojson|svg|html)$ [NC]
RewriteRule "^/stories/(.*)\.(jpg|css|js|gif|png|json|geojson|svg|html)$" "/$1\.$2" [PT]

# CAPTIVE STORIES
RewriteRule "^/m/stories/(.+)\.(js|css)" "/stories/$1\.$2" [PT]
RewriteRule "^/m/stories/status$" "/stories/status/index.html" [PT]
RewriteRule "^/m/stories/status/(.*)$" "/stories/status/index.html" [PT]
RewriteCond %{REQUEST_URI} !status.*
RewriteRule "^/m/stories/(.+)$" "/stories/index.html" [PT]
RewriteRule "^/m/config-local.js$" "/config-local.js" [PT]

# EXAMPLE EMBEDS
RewriteRule "^/embedding/?$" "/stories/example-embeds/examples.html" [PT]
RewriteRule "^/embedding/mobile-embed-fullscreen-example/?$" "/stories/example-embeds/mobile-embed-fullscreen.html" [PT]
RewriteRule "^/embedding/mobile-embed-inline-example/?$" "/stories/example-embeds/mobile-embed-inline.html" [PT]
RewriteRule "^/embedding/mobile-embed-fullscreen-iframe-example/?$" "/stories/example-embeds/mobile-embed-fullscreen-iframe.html" [PT]
RewriteRule "^/embedding/interactive-embed-fullscreen-iframe-example/?$" "/stories/example-embeds/interactive-embed-fullscreen-iframe.html" [PT]

# Change path into path.html (only if path doesn't exist)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
</VirtualHost>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Example apache configuration, for EarthTime tile data serving
#
# To install,
#
# 1. Copy file and customize paths
#
# 2. Symlink into /etc/apache2/sites-enabled
#
# 3. Restart apache:
#
# sudo apachectl graceful
#

Define ROOTPATH /t/tm4.earthtime.org

<VirtualHost *:80>
ServerName tm4.tiles.earthtime.org
DocumentRoot ${ROOTPATH}/app/data
Options FollowSymLinks

Header always set Access-Control-Allow-Origin "*"

<Directory "${ROOTPATH}/app/data">
AddOutputFilterByType DEFLATE application/octet-stream
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE text/csv

AllowOverride None
Require all granted
</Directory>
</VirtualHost>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Example apache configuration, for EarthTime website headless serving
#
# To install,
#
# 1. Copy file and customize paths
#
# 2. Symlink into /etc/apache2/sites-enabled
#
# 3. Restart apache:
#
# sudo apachectl graceful
#

Define ROOTPATH /t/tm4.earthtime.org

<VirtualHost *:80>
ServerName tm4.headless.earthtime.org
DocumentRoot ${ROOTPATH}/app/data-visualization-tools/examples/webgl-timemachine
Options FollowSymLinks
Alias "/timemachine" "${ROOTPATH}/app/data-visualization-tools/timemachine"
Alias "/js" "${ROOTPATH}/app/data-visualization-tools/js"
Alias "/css" "${ROOTPATH}/app/data-visualization-tools/css"
Alias "/images" "${ROOTPATH}/app/data-visualization-tools/images"
Alias "/extras" "${ROOTPATH}/app/extras"
Alias "/info" "${ROOTPATH}/app/data-visualization-tools/info.html"

Header always set Access-Control-Allow-Origin "*"
Header set Cache-Control "max-age=60, public, must-revalidate"

<Directory "${ROOTPATH}/app">
AddOutputFilterByType DEFLATE application/octet-stream

Order Deny,Allow
Allow from all
Satisfy any
</Directory>

RewriteEngine on

# Use own config-local.js
RewriteRule "^/config-local.js" "${ROOTPATH}/app/data-visualization-tools/examples/webgl-timemachine/config-local-headless.js"

# Change path into path.html (only if path doesn't exist)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
</VirtualHost>

0 comments on commit 97d289f

Please sign in to comment.