From efb0376f45639f62ea64ee0c17dbc987bc121c3b Mon Sep 17 00:00:00 2001
From: Rowan Powell <rp17@it-innovation.soton.ac.uk>
Date: Fri, 9 Feb 2018 16:13:38 +0000
Subject: [PATCH] New apache deployment configuration and install

---
 Vagrantfile                            |  4 +-
 infra/streaming/rspec.yml              | 85 +-------------------------
 test/services/apache/install-apache.sh | 24 +++++++-
 test/services/ffmpeg/install-ffmpeg.sh |  4 +-
 4 files changed, 29 insertions(+), 88 deletions(-)

diff --git a/Vagrantfile b/Vagrantfile
index 4688bf1..5e3803e 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -54,8 +54,8 @@ hosts = YAML.load_file(host_rspec_file)
 
 # Start creating VMS using xenial64 as the base box
 Vagrant.configure("2") do |config|
-  #config.vm.box = "ubuntu/xenial64"
-  config.vm.box = "hashicorp/precise32"
+  config.vm.box = "ubuntu/xenial64"
+  #config.vm.box = "hashicorp/precise32"
 
   # Dynamic VMs
   hosts['hosts'].each do |host|
diff --git a/infra/streaming/rspec.yml b/infra/streaming/rspec.yml
index 5aebbf7..1761235 100644
--- a/infra/streaming/rspec.yml
+++ b/infra/streaming/rspec.yml
@@ -1,18 +1,4 @@
 hosts:
-  - name: clmc-service
-    cpus: 1
-    memory: 2048
-    disk: "10GB"
-    forward_ports:
-      - guest: 8086
-        host: 8086
-      - guest: 8888
-        host: 8888
-      - guest: 9092
-        host: 9092
-    ip_address: "192.168.50.10"
-    install_script: "install-clmc-service.sh"
-    start_script: "start-clmc-service.sh"
   - name: apache1
     cpus: 1
     memory: 2048
@@ -21,6 +7,8 @@ hosts:
     forward_ports:
       - guest: 80
         host: 8081
+        guest: 8890
+        host: 8890
     ip_address: "192.168.50.11"
     location: "DC1"
     sfc_id: "MS_Template_1"
@@ -30,72 +18,3 @@ hosts:
     ipendpoint_id: "adaptive_streaming_I1_apache1"
     influxdb_url: "http://192.168.50.10:8086"
     database_name: "CLMCMetrics"
-  - name: apache2
-    cpus: 1
-    memory: 2048
-    disk: "10GB"
-    service_name: "apache"
-    forward_ports:
-      - guest: 80
-        host: 8082
-    ip_address: "192.168.50.12"
-    location: "DC2"
-    sfc_id: "MS_Template_1"
-    sfc_id_instance: "MS_I1"
-    sf_id: "adaptive_streaming"
-    sf_id_instance: "adaptive_streaming_I1"
-    ipendpoint_id: "adaptive_streaming_I1_apache2"
-    influxdb_url: "http://192.168.50.10:8086"
-    database_name: "CLMCMetrics"      
-    
-  - name: nginx
-    cpus: 1
-    memory: 2048
-    disk: "10GB"
-    service_name: "nginx"
-    forward_ports:
-      - guest: 80
-        host: 8083
-    ip_address: "192.168.50.13"
-    location: "DC1"
-    sfc_id: "MS_Template_1"
-    sfc_id_instance: "MS_I1"
-    sf_id: "adaptive_streaming"
-    sf_id_instance: "adaptive_streaming_nginx_I1"
-    ipendpoint_id: "adaptive_streaming_nginx_I1_apache1"
-    influxdb_url: "http://192.168.50.10:8086"
-    database_name: "CLMCMetrics"
-  - name: mongo
-    cpus: 1
-    memory: 2048
-    disk: "10GB"
-    service_name: "mongo"
-    forward_ports:
-      - guest: 80
-        host: 8084
-    ip_address: "192.168.50.14"
-    location: "DC1"
-    sfc_id: "MS_Template_1"
-    sfc_id_instance: "MS_I1"
-    sf_id: "metadata_database"
-    sf_id_instance: "metadata_database_I1"
-    ipendpoint_id: "metadata_database_I1_apache1"
-    influxdb_url: "http://192.168.50.10:8086"
-    database_name: "CLMCMetrics" 
-  - name: mpeg
-    cpus: 1
-    memory: 2048
-    disk: "10GB"
-    service_name: "mpeg"
-    forward_ports:
-      - guest: 80
-        host: 8085
-    ip_address: "192.168.50.14"
-    location: "DC1"
-    sfc_id: "MS_Template_1"
-    sfc_id_instance: "MS_I1"
-    sf_id: "metadata_database"
-    sf_id_instance: "metadata_database_I1"
-    ipendpoint_id: "metadata_database_I1_apache1"
-    influxdb_url: "http://192.168.50.10:8086"
-    database_name: "CLMCMetrics" 
diff --git a/test/services/apache/install-apache.sh b/test/services/apache/install-apache.sh
index 735fc0a..968a5d5 100644
--- a/test/services/apache/install-apache.sh
+++ b/test/services/apache/install-apache.sh
@@ -26,4 +26,26 @@
 
 # Install apache
 sudo apt-get update
-sudo apt-get -y install apache2
\ No newline at end of file
+sudo apt-get -y install apache2
+# Copy corrected configed over
+  # Servername
+sudo rm /etc/apache2/apache2.conf
+sudo cp ./test/services/apache/apache2.conf /etc/apache2/apache2.conf
+  # ports
+sudo rm /etc/apache2/ports.conf
+sudo cp ./test/services/apache/ports.conf /etc/apache2/ports.conf
+  # ports for server
+sudo rm /etc/apache2/sites-enabled/000-default.conf
+sudo cp ./test/services/apache/000-default.conf /etc/apache2/sites-enabled/000-default.conf
+sudo rm /etc/apache2/sites-available/000-default.conf
+sudo cp ./test/services/apache/000-default.conf /etc/apache2/sites-available/000-default.conf
+
+# Copy files for MPEG-DASH testing
+sudo cp ./resources/videofile.mp4 /var/www/html/videofile.mp4
+sudo cp ./resources/stream.mpd /var/www/html/stream.mpd
+sudo cp -r ./resources/audio/* /var/www/html/audio
+sudo cp -r ./resources/video/* /var/www/html/video
+
+
+sudo apachectl -k start
+sudo apachectl -k restart
diff --git a/test/services/ffmpeg/install-ffmpeg.sh b/test/services/ffmpeg/install-ffmpeg.sh
index 058f4bc..3e9ae17 100644
--- a/test/services/ffmpeg/install-ffmpeg.sh
+++ b/test/services/ffmpeg/install-ffmpeg.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 
-apt-get update
-apt-get -y install zip python
+sudo apt-get update
+sudo apt-get -y install zip python
 
 wget http://zebulon.bok.net/Bento4/binaries/Bento4-SDK-1-5-1-621.x86_64-unknown-linux.zip
 unzip Bento4-SDK-1-5-1-621.x86_64-unknown-linux.zip
-- 
GitLab