File: setup_web_server.sh

package info (click to toggle)
golang-github-hashicorp-serf 0.8.1%2Bgit20180508.80ab4877~ds-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,276 kB
  • sloc: sh: 412; python: 11; makefile: 7
file content (18 lines) | stat: -rwxr-xr-x 503 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
#
# This script sets up the web servers. The web servers just output who
# they are initially. Serf will do some additional configuration. Presumably
# in a real environment you would use a real configuration management system
# to do this. But for this demo a shell script is used for simplicity.
#
set -e

# Install apache2
sudo apt-get update
sudo apt-get install -y apache2

HOSTNAME=`hostname`
cat <<EOF >/tmp/index.html
I am "${HOSTNAME}"
EOF
sudo mv /tmp/index.html /var/www/index.html