This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-boothook | |
#!/bin/bash | |
set -x | |
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 | |
# fix for "unable to resolve host" error even when dns hostnames/resolution are turned on for VPC | |
echo "127.0.0.1 $(hostname)" >> /etc/hosts | |
# copy shapefiles from S3 bucket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title>Tile-maker Demo using NAIP on S3</title> | |
<script type='text/javascript' src='//code.jquery.com/jquery-1.9.1.js'></script> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" /> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RoutingRules> | |
<RoutingRule> | |
<Condition> | |
<HttpErrorCodeReturnedEquals>403</HttpErrorCodeReturnedEquals> | |
</Condition> | |
<Redirect> | |
<HostName>maptilerworkshop.elasticbeanstalk.com</HostName> | |
<ReplaceKeyPrefixWith>?tile=</ReplaceKeyPrefixWith> | |
<HttpRedirectCode>303</HttpRedirectCode> | |
</Redirect> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-boothook | |
#!/bin/bash | |
set -x | |
# This EC2 user-data file will run a Mapserver docker container. | |
# Still working on getting it to reboot properly. See this link for more info on user-data scripts | |
# http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html#user-data-shell-scripts | |
# Because this setup uses data stored in an S3 bucket located in the standard region, it needs to be run in us-east-1 (Virginia Region). | |
# It mounts S3 data by using danilop/yas3fs. USDA CONUS NAIP data, Mapfile and shapefile indexes are made available to Mapserver in this way. | |
# Just running this instance will give you access to all of the NAIP data via the EC2 instance's filesystem. | |
# One caveat is that the combination of mapfile and UTM projected geotifs only supports WMS requests near native 1m/pixel resolution or level 17, |