Skip to content
Snippets Groups Projects
Commit 4e135426 authored by Raphael Storm Larsen's avatar Raphael Storm Larsen
Browse files

Fallbackwebserver modifications

parent a3ad1dc6
No related branches found
No related tags found
No related merge requests found
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
stats timeout 30s
user haproxy
group haproxy
daemon
# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
# See: https://ssl-config.mozilla.org/#server=haproxy&server-version=2.0.3&config=intermediate
ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
frontend AETA
bind *:80
mode http
default_backend docker
backend docker
mode http
balance roundrobin
server dwww1 192.168.130.6:32768 weight 1
server dwww2 192.168.130.6:32769 weight 1
server dwww3 192.168.130.6:32770 weight 1
listen stats
bind *:1936
stats enable
stats uri /
stats hide-version
stats auth raphaesl:boing
stats auth saraslu:boing
\ No newline at end of file
......@@ -36,7 +36,7 @@ sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-compose-plu
docker swarm join --token SWMTKN-1-0wljbwbm6k4zd2yqtypryu6us24jvnfg231j3ztnpy24u9uv3s-496ykad1sirmhbjaq895yy8xq 192.168.130.103:2377
# Fix potentially broken docker build
sudo echo "{ "insecure-registries" : ["192.168.128.23:5000"] }" > /etc/docker/daemon.json
sudo echo "{ \"insecure-registries\" : [\"192.168.128.23:5000\"] }" > /etc/docker/daemon.json
# Clone git repository
git clone https://glpat-yEr3xU4_23z-jJ6UGC29@gitlab.stud.idi.ntnu.no/raphaesl/dcsg2003.git /home/ubuntu/dcsg2003
......@@ -44,8 +44,5 @@ git config --global --add safe.directory /home/ubuntu/dcsg2003
sudo chown -R ubuntu:ubuntu /home/ubuntu/dcsg2003
# Make Scripts Executable
chmod +x /users/ubuntu/dcsg2003/configuration/database/countUsers.sh
chmod +x /users/ubuntu/dcsg2003/configuration/chmodder.sh
bash /users/ubuntu/dcsg2003/configuration/chmodder.sh
\ No newline at end of file
# Alert
echo "Cloud Initialization script has completed."
\ No newline at end of file
......@@ -11,6 +11,7 @@ RUN rm /var/www/html/index.html
# Add content to apache folder
ADD index.html /var/www/html
ADD maxwell.gif /var/www/html
ADD AETAlogo.png /var/www/html
# Misc
EXPOSE 80
......
#!bin/bash
docker run -P --name "dwww1" --restart unless-stopped -p 32768:80 -d webserver:v0.17
docker run -P --name "dwww2" --restart unless-stopped -p 32769:80 -d webserver:v0.17
docker run -P --name "dwww3" --restart unless-stopped -p 32770:80 -d webserver:v0.17
docker run -P --name "dwwwFallback" --restart unless-stopped -p 32771:80 -d fallbackwebserver:v0.2
# Version Numbers
version=18
fversion=3
# Build
docker build -t "webserver:v$version" .
docker build -t "fallbackWebserver:v$fversion" ../fallbackWebserver/
# Create Dockers
docker run -P --name "dwww1" --restart unless-stopped -p 32768:80 -d webserver:v$version
docker run -P --name "dwww2" --restart unless-stopped -p 32769:80 -d webserver:v$version
docker run -P --name "dwww3" --restart unless-stopped -p 32770:80 -d webserver:v$version
docker run -P --name "dwwwFallback" --restart unless-stopped -p 32771:80 -d fallbackwebserver:v$fversion
\ No newline at end of file
#!/bin/bash
# This scripts returns basic health diagnostics
\ No newline at end of file
......@@ -81,6 +81,10 @@ docker run -P --name "dwww1" -v ~/dcsg2003/docker/webserver/config.php:/var/www/
docker stop $(docker ps -qa)
docker rm $(docker ps -qa)
# Install memcache docker
docker run --name=memcache -p 11211:11211 -d 192.168.128.23:5000/memcached memcached -m <ram>
```
......
......@@ -11,4 +11,5 @@
Production on/off script
- if/else for down up
-
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment