Git Product home page Git Product logo

heigvd-res-2020-labo-httpinfra's Introduction

HEIGVD-RES-2020-Labo-HTTPInfra

This is the repo for the HTTP lab at HEIG-vd

Students

Frédéric Korradi and Simon Flückiger

Dev environment

We used Docker on Windows 10 with Docker Engine v19.03.8

Branches

Work is done in various "fb" branches, one for each step

General

Find ip address : docker inspect express_dynamic | select-string ipaddress

Step 1 - Static HTTP server (apache)

Base image: php:7.4-apache

To build image : docker build -t res/apache_php . Then to run it : docker run -d -p 9090:80 res/apache_php to access it : http://127.0.0.1:9090/

Apache config file location

ApacheConfigFile

Step 2 - Dynamic HTTP Server (express.js)

installed package chance docker build -t res/express-students . http://127.0.0.1:8000/generateNumbers to get random numbers using express.js Node.js version : 12.16

Step 3 - Reverse proxy

The static configuration is fragile and needs to be improved because as the IP addresses of Docker containers are generated at container startup, the configuration of the reverse proxy could need a change each time we restart containers in order to work properly. docker run -it -p 8080:80 php:7.4-apache /bin/bash

Step 4 - Ajax

The ajax call to retrieve a random number is done with the following url: $.getJSON("/api/numbers/generateNumbers",...);

Step 5 - Dynamic Configuration

Regarding the lab videos, we need to take the latest version of the apache2-foreground

To run the RP with dynamic ip configuration using environment variables: docker run -d -e STATIC_APP=172.17.0.3:80 -e DYNAMIC_APP=172.17.0.2:3000 --name apache_rp -p 8080:80 res/apache_rp

Modules nécessaires

a2ensite 001 a2enmod proxy a2enmod proxy_http service apache reload

heigvd-res-2020-labo-httpinfra's People

Contributors

korradif avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.