1.1

<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Date du jour</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            text-align: center;
            margin-top: 50px;
        }
    </style>
</head>
<body>

    <h1 id="dateMessage"></h1>

    <script>
        function afficherDate() {
            const joursSemaine = ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"];
            const mois = ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"];

            const dateActuelle = new Date();
            const jourSemaine = joursSemaine[dateActuelle.getDay()];
            const jour = dateActuelle.getDate();
            const moisActuel = mois[dateActuelle.getMonth()];
            const annee = dateActuelle.getFullYear();

            const message = `Bonjour, aujourd'hui c'est le ${jourSemaine} ${jour} ${moisActuel} ${annee}`;
            document.getElementById("dateMessage").innerText = message;
        }

        afficherDate();
    </script>

</body>
</html>

1.2 :

docker run -dit --name apache-server -p 8080:80 -v "${PWD}:/usr/local/apache2/htdocs/" httpd:2.4

image.png

1.3 : Docker File

# Use the official Apache HTTP server image as the base image
FROM httpd:2.4

# Copy the custom index.html file to the Apache document root
COPY ./index.html /usr/local/apache2/htdocs/

docker build -t web-server_lab .  

1.4


TP2> docker run -d --name my-web-server -p 8080:80 web-server_lab
adb88b1c7d9987a8af9c869313d80f2ec37e9aa46335f6c64fd35768fe1609b4

1.5 / 1.6

TP2> docker stop my-web-server
TP2> docker start my-web-server

2.0

docker image pull apline

2.1

Benchmarking localhost (be patient).....done

Server Software:        Apache/2.4.58
Server Hostname:        localhost
Server Port:            80

Document Path:          /
Document Length:        10671 bytes

Concurrency Level:      10
Time taken for tests:   0.012 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      1094500 bytes
HTML transferred:       1067100 bytes
Requests per second:    8598.45 [#/sec] (mean)
Time per request:       1.163 [ms] (mean)
Time per request:       0.116 [ms] (mean, across all concurrent requests)
Transfer rate:          91904.36 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       0
Processing:     0    1   0.6      1       4
Waiting:        0    1   0.5      0       3
Total:          0    1   0.6      1       4
ERROR: The median and mean for the waiting time are more than twice the standard
       deviation apart. These results are NOT reliable.

Percentage of the requests served within a certain time (ms)
  50%      1
  66%      1
  75%      1
  80%      1
  90%      2
  95%      3
  98%      3
  99%      4
 100%      4 (longest request)

2.2


Benchmarking localhost (be patient).....done

Server Software:        Apache/2.4.58
Server Hostname:        localhost
Server Port:            80

Document Path:          /
Document Length:        10671 bytes

Concurrency Level:      10
Time taken for tests:   0.017 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      1094500 bytes
HTML transferred:       1067100 bytes
Requests per second:    5975.50 [#/sec] (mean)
Time per request:       1.673 [ms] (mean)
Time per request:       0.167 [ms] (mean, across all concurrent requests)
Transfer rate:          63869.00 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0       2
Processing:     0    1   1.0      1       7
Waiting:        0    1   1.0      1       7
Total:          0    1   1.0      1       8

Percentage of the requests served within a certain time (ms)
  50%      1
  66%      1
  75%      2
  80%      2
  90%      3
  95%      4
  98%      5
  99%      8
 100%      8 (longest request)

3.1

<aside> 💡

docker-compose up --build -d

</aside>