Initial commit

This commit is contained in:
Matt Fox 2014-01-22 10:32:55 -08:00
commit 7a7b511495
3 changed files with 77 additions and 0 deletions

44
60_allow_http Executable file
View File

@ -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

16
configure-http Executable file
View File

@ -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

17
nginx.conf Normal file
View File

@ -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;
}
}