commit 7a7b5114959fd63c80d59a602ba7a57d26caf68a Author: Matt Fox Date: Wed Jan 22 10:32:55 2014 -0800 Initial commit diff --git a/60_allow_http b/60_allow_http new file mode 100755 index 0000000..1c8758e --- /dev/null +++ b/60_allow_http @@ -0,0 +1,44 @@ +#!/bin/sh +# Open HTTP port to the world. +NAME="60_allow_http" + +start () { + log_progress_msg $NAME + remove 2> /dev/null # Try to remove functionality, if possible, so that + # start can be run multiple times in a row. + iptables -I INPUT -p tcp --dport 80 -j ACCEPT +} +stop () { + log_progress_msg $NAME + remove +} +remove () { + iptables -D INPUT -p tcp --dport 80 -j ACCEPT +} +status () { + iptables -L INPUT +} + +# You probably shouldn't edit anything below here. +test -f /lib/lsb/init-functions && . /lib/lsb/init-functions + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|force-reload) + stop + start + ;; + status) + status + exit 0 + ;; + *) + echo "Usage: $0 {start|stop|restart|force-reload|status}" + exit 1 + ;; +esac diff --git a/configure-http b/configure-http new file mode 100755 index 0000000..3dd5608 --- /dev/null +++ b/configure-http @@ -0,0 +1,16 @@ +#!/bin/bash +# Install and configure nginx web server and large test files. + +# Make test files +mkdir /var/www/ +head -c 100000000 /dev/zero > /var/www/100mb.bin + +# Install and configure nginx +apt-get install nginx +rm /etc/nginx/sites-enabled/default +ln -s `pwd`/nginx.conf /etc/nginx/sites-enabled/poc +service nginx start + +# Ensure port 80 is allowed from anywhere +cp 60_allow_http /etc/firewall.d/60_allow_http +service firewall restart diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..ec09f13 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,17 @@ +server { + + listen 80; ## listen for ipv4 + listen [::]:80 default ipv6only=on; ## listen for ipv6 + + server_name localhost; + + access_log /var/log/nginx/localhost.access.log; + + location / { + root /var/www; + index index.html index.htm; + autoindex on; + } + +} +