Add files via upload
This commit is contained in:
parent
0b1200b366
commit
903ed5413c
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Cours PHP / MySQL</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="cours.css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Bases de données MySQL</h1>
|
||||
<?php
|
||||
//phpinfo();
|
||||
$servername = 'localhost';
|
||||
$username = 'tux';
|
||||
$password = 'Linux741!';
|
||||
|
||||
//On établit la connexion
|
||||
$conn = new mysqli($servername, $username, $password);
|
||||
|
||||
//On vérifie la connexion
|
||||
if($conn->connect_error){
|
||||
die('Erreur : ' .$conn->connect_error);
|
||||
}
|
||||
echo 'Connexion réussie';
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,273 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Serveurs BTS NDRC</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!------------------------ Définitions des styles ------------------------->
|
||||
<style>
|
||||
table, th, td {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
</style>
|
||||
<!-- ------------------------------------------------------------------- -->
|
||||
<body>
|
||||
|
||||
<center>
|
||||
<h1>Service Informatique H3 Campus </h1><br><br>
|
||||
|
||||
<?php include 'menu.php';
|
||||
include 'ssh.php';
|
||||
$host="192.168.150.233";
|
||||
|
||||
|
||||
//print_r($_POST) ;
|
||||
|
||||
//<!-- ******************** Fonctions Bouttons ************************** --->
|
||||
if(array_key_exists('Reset', $_POST)) { FnReset($host); }
|
||||
if(array_key_exists('NameWP', $_POST)) { FnCreateWP($host); }
|
||||
if(array_key_exists('WP_X', $_POST)) { FnDeleteWP($host); }
|
||||
if(array_key_exists('NamePresta', $_POST)) { FnCreatePresta($host); }
|
||||
if(array_key_exists('Presta_X', $_POST)) { FnDeletePresta($host); }
|
||||
|
||||
/**************************************** WORDPRESS function PHP **************************************** */
|
||||
function FnCreateWP($hostaddr) {
|
||||
if ($_POST['NameWP']==="cancel") {exit;}
|
||||
/* Variables */
|
||||
$port=8000; //port de départ...
|
||||
$dockerlxc="/root/WP/".$_POST["NameWP"].".yml"; //Nom fichier compose
|
||||
$sqlfile ="/root/WP/sql.sql";
|
||||
|
||||
//recherche du premier port disponible
|
||||
$connection = @fsockopen($hostaddr, $port);
|
||||
while (is_resource($connection)) { $port++; fclose($connection);$connection = @fsockopen('192.168.150.233', $port,$errno,$errstr,10); }
|
||||
|
||||
|
||||
/* Création des fichiers compose et db */
|
||||
$Result=ssh_command($hostaddr,"cp /root/WP/wp.yml.save ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/wordpress1/".$_POST["NameWP"]."/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/8001/$port/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"echo 'CREATE DATABASE IF NOT EXISTS ".$_POST["NameWP"].";'> $sqlfile" );
|
||||
$Result=ssh_command($hostaddr,"echo 'GRANT ALL PRIVILEGES ON ".$_POST["NameWP"].".* TO 'wp_user'@'localhost';'>> $sqlfile");
|
||||
|
||||
/* Création de la table correspondante dans la base de donnée */
|
||||
$Result=ssh_command($hostaddr,"docker-compose -f /root/WP/db.yml exec -T db mysql -uroot -plinux wordpress < $sqlfile");
|
||||
sleep(15);
|
||||
//création du conteneur docker...
|
||||
$Result=ssh_command($hostaddr, "export COMPOSE_HTTP_TIMEOUT=120 && docker-compose -f $dockerlxc up -d &");
|
||||
sleep(20);
|
||||
|
||||
// Vide l'instruction de créer une machine et puis refresh
|
||||
unset($_POST["NameWP"]);
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
function FnDeleteWP($host) {
|
||||
$dockerName=$_POST['WP_X'];
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
$Result=ssh_command($host, "docker stop $dockerName");
|
||||
$Result=ssh_command($host, "docker rm $dockerName");
|
||||
header("Refresh:0");
|
||||
}
|
||||
/**************************************** PRESTASHOP function PHP **************************************** */
|
||||
function FnCreatePresta($hostaddr) {
|
||||
$dockerName=$_POST['NamePresta'];
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
/* Variables */
|
||||
$port=7000; //port de départ...
|
||||
$dockerlxc="/root/PS/$dockerName.yml"; //Nom fichier compose
|
||||
$sqlfile ="/root/PS/sql.sql";
|
||||
|
||||
//recherche du premier port disponible
|
||||
$connection = @fsockopen($hostaddr, $port);
|
||||
while (is_resource($connection)) { $port++; fclose($connection);$connection = @fsockopen($hostaddr, $port,$errno,$errstr,10); }
|
||||
|
||||
|
||||
/* Création des fichiers compose et db */
|
||||
$Result=ssh_command($hostaddr,"cp /root/PS/ps.yml.save ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/prestashop1/$dockerName/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/8001/$port/g' ".$dockerlxc);
|
||||
|
||||
//création du conteneur docker...
|
||||
$Result=ssh_command($hostaddr, "export DOCKER_CLIENT_TIMEOUT=120 && export DOCKER_HTTP_TIMEOUT=120");
|
||||
$Result=ssh_command($hostaddr, "export COMPOSE_HTTP_TIMEOUT=120 && docker-compose -f $dockerlxc up -d &");
|
||||
sleep(20);
|
||||
|
||||
// Vide l'instruction de créer une machine et puis refresh
|
||||
unset($_POST["NamePresta"]);
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
function FnDeletePresta($host) {
|
||||
$dockerName=$_POST['Presta_X'];
|
||||
$dockerlxc="/root/PS/$dockerName.yml"; //Nom fichier compose
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
$Result=ssh_command($host, "docker stop $dockerName");
|
||||
$Result=ssh_command($host, "docker rm $dockerName");
|
||||
header("Refresh:0");
|
||||
}
|
||||
?>
|
||||
<!--- ********************************************************************---->
|
||||
|
||||
<br><br>
|
||||
<!-- ************** Bouton d'actualisation ************ -->
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<FORM>
|
||||
<?php
|
||||
/* Création de la base de donnée (& phppmyadmin) si elle n'existe pas !! */
|
||||
$Result=ssh_command($host, "docker ps -a | grep mysqldb");
|
||||
if ($Result== null) {
|
||||
//$Result=ssh_command($host,"docker network create wp_wpsite");
|
||||
$Result=ssh_command($host,"cp /root/WP/db.yml.save /root/WP/db.yml");
|
||||
$Result=ssh_command($host, "export DOCKER_CLIENT_TIMEOUT=120 && export DOCKER_HTTP_TIMEOUT=120 && docker-compose -f /root/WP/db.yml up -d");
|
||||
}
|
||||
$Result=ssh_command($host, "docker ps -a | grep mysqlps");
|
||||
if ($Result== null) {
|
||||
$Result=ssh_command($host,"cp /root/PS/db.yml.save /root/PS/db.yml");
|
||||
$Result=ssh_command($host, "export DOCKER_CLIENT_TIMEOUT=120 && export DOCKER_HTTP_TIMEOUT=120 && docker-compose -f /root/PS/db.yml up -d");
|
||||
}
|
||||
?>
|
||||
<INPUT Type="button" VALUE="Actualiser la liste" onClick="history.go(0)">
|
||||
<form name="form" method="post" action="H3campus.php">
|
||||
</FORM>
|
||||
</td>
|
||||
<tr><br></tr>
|
||||
</table>
|
||||
|
||||
<h2>Wordpress - Prestashop</h2>
|
||||
|
||||
|
||||
<!-- *********************** Tableau avec les serveurs de base de données ! ******************* -->
|
||||
<?php
|
||||
$Result=ssh_command($host, "docker ps -a | grep -i mysqldb | awk '{print \$NF}' ");
|
||||
$Result2=ssh_command($host, "docker ps -a | grep -i mysqlps | awk '{print \$NF}' ");
|
||||
if (($Result<>NULL) and ($Result2<>NULL))
|
||||
{
|
||||
echo <<<TABLEAU
|
||||
<table style='width:220px'>
|
||||
<tr><th>Serveurs de bases de données</th></tr>
|
||||
<tr><td align='center'><font color='green'>Bases de données Wordpress & Prestashop fonctionnelles </font></td>
|
||||
</tr>
|
||||
</table>
|
||||
TABLEAU;
|
||||
}
|
||||
else echo "<b><font color='red'>Attention les bases de données ne sont pas lancés correctement !</font></b><br/><br/>";
|
||||
?>
|
||||
|
||||
|
||||
<!-- Tableau avec les serveurs WORDPRESS -->
|
||||
<table style="width:600px">
|
||||
<tr><th>Serveurs Wordpress</th>
|
||||
<td style="width:400px">
|
||||
<form name="formWP" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" id="formWP">
|
||||
<input type="submit" name="submit" value="Créer un Wordpress" onclick="createWP()" />
|
||||
<input type="hidden" name="NameWP" id="NameWP" />
|
||||
<input type="submit" name="submit" value="Supprimer un Wordpress" onclick="DelWP()" />
|
||||
<input type="hidden" name="WP_X" id="WP_X" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
/* Recherche de tous les Wordpress */
|
||||
$Result=ssh_command($host, "docker ps -a | grep -i wordpress | awk '{print \$NF}' ");
|
||||
foreach( $Result as $value ){
|
||||
#Acquire port : docker ps -a | grep -i $value | awk '{print $11}' | cut -d - -f1| cut -d : -f4
|
||||
$portlist =ssh_command($host, "docker ps -a | awk '{print $11,\$NF}'|grep -i $value | cut -d - -f1| cut -d : -f4");
|
||||
$i=0;
|
||||
foreach($portlist as $portfinal) {
|
||||
$i++;
|
||||
if (!$portfinal==null and !$portfinal=="") {
|
||||
echo "<tr><td align='center'>".$value ."</td><td><a href='http://192.168.150.233:".$portfinal."'> Accéder à $value</a> </td></tr><br/>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
<!-- Tableau avec les serveurs PRESTASHOP -->
|
||||
<table style="width:600px">
|
||||
<tr><th>Serveurs Prestashop</th>
|
||||
<td style="width:400px">
|
||||
<form name="formPresta" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" id="formPresta">
|
||||
<input type="submit" name="submit" value="Créer un Prestashop" onclick="CreatePresta()" />
|
||||
<input type="hidden" name="NamePresta" id="NamePresta" />
|
||||
<input type="submit" name="submit" value="Supprimer un Prestashop" onclick="DeletePresta()" />
|
||||
<input type="hidden" name="Presta_X" id="Presta_X" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
/* Recherche de tous les Prestashop */
|
||||
$Result=ssh_command($host, "docker ps -a | grep -i prestashop | awk '{print \$NF}' ");
|
||||
foreach( $Result as $value ){
|
||||
#Acquire port : docker ps -a | grep -i $value | awk '{print $11}' | cut -d - -f1| cut -d : -f4
|
||||
$portlist =ssh_command($host, "docker ps -a | awk '{print $11,\$NF}'|grep -i $value | cut -d - -f1| cut -d : -f4");
|
||||
$i=0;
|
||||
foreach($portlist as $portfinal) {
|
||||
$i++;
|
||||
if (!$portfinal==null and !$portfinal=="") {
|
||||
echo "<tr><td align='center'>".$value ."</td><td><a href='http://192.168.150.233:".$portfinal."'> Accéder à $value</a> </td></tr><br/>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
</center>
|
||||
|
||||
|
||||
<!-- Boutton reset --->
|
||||
<?php
|
||||
function FnReset($host) {
|
||||
$Result=ssh_command($host, "docker stop $(docker ps -a -q)");
|
||||
$Result=ssh_command($host, "docker rm $(docker ps -a -q)");
|
||||
$Result=ssh_command($host, "docker network prune -f");
|
||||
$Result=ssh_command($host, "rm -f /root/WP/*.yml");
|
||||
$Result=ssh_command($host, "rm -f /root/WP/*.sql");
|
||||
}
|
||||
?>
|
||||
<br><br><br><br><br>
|
||||
<p style='text-align: right'>
|
||||
<form method="post">
|
||||
<input type="submit" name="Reset" class="button" value="Reset" />
|
||||
</form>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
|
||||
/* BOUTONS */
|
||||
echo <<< HTML
|
||||
<center>
|
||||
<script type="text/javascript">
|
||||
function createWP() {
|
||||
var wp_name = prompt("Entrer un nom pour le Wordpress :", "wordpress");
|
||||
if (wp_name == null || wp_name == "") {wp_name = "cancel";}
|
||||
document.getElementById("NameWP").value = wp_name;
|
||||
}
|
||||
function DelWP() {
|
||||
var wp_name = prompt("Entrer un nom pour le Wordpress a supprimé :", "");
|
||||
if (wp_name == null || wp_name == "") {wp_name = "cancel";}
|
||||
document.getElementById("WP_X").value = wp_name;
|
||||
}
|
||||
function CreatePresta() {
|
||||
var Presta_name = prompt("Entrer un nom pour le Prestashop :", "Prestashop");
|
||||
if (Presta_name == null || Presta_name == "") {Presta_name = "cancel";}
|
||||
document.getElementById("NamePresta").value = Presta_name;
|
||||
}
|
||||
function DeletePresta() {
|
||||
var Presta_name = prompt("Entrer un nom pour le Prestashop a supprimé :", "");
|
||||
if (Presta_name == null || Presta_name == "") {Presta_name = "cancel";}
|
||||
document.getElementById("Presta_X").value = Presta_name;
|
||||
}
|
||||
</script>
|
||||
</center>
|
||||
HTML;
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,356 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Serveurs BTS NDRC</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!------------------------ Définitions des styles ------------------------->
|
||||
<style>
|
||||
table, th, td {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
</style>
|
||||
<!-- ------------------------------------------------------------------- -->
|
||||
<body>
|
||||
|
||||
<center>
|
||||
<h1>Service Informatique H3 Campus </h1><br><br>
|
||||
|
||||
<?php include 'menu.php';
|
||||
include 'ssh.php';
|
||||
$host="192.168.170.233";
|
||||
$host_poi="192.168.180.233";
|
||||
error_reporting(E_ERROR | E_PARSE | E_STRICT);
|
||||
|
||||
//print_r($_POST) ;
|
||||
|
||||
//<!-- ******************** Fonctions Bouttons ************************** --->
|
||||
if(array_key_exists('Reset', $_POST)) { FnReset($host); }
|
||||
//Paris
|
||||
if(array_key_exists('NameWP', $_POST)) { FnCreateWP($host); }
|
||||
if(array_key_exists('WP_X', $_POST)) { FnDeleteWP($host); }
|
||||
if(array_key_exists('NamePresta', $_POST)) { FnCreatePresta($host); }
|
||||
if(array_key_exists('Presta_X', $_POST)) { FnDeletePresta($host); }
|
||||
//Poissy
|
||||
if(array_key_exists('NameWP_POI', $_POST)) { FnCreateWP($host_poi); }
|
||||
if(array_key_exists('WP_X_POI', $_POST)) { FnDeleteWP($host_poi); }
|
||||
if(array_key_exists('NamePresta_POI', $_POST)) { FnCreatePresta($host_poi); }
|
||||
if(array_key_exists('Presta_X_POI', $_POST)) { FnDeletePresta($host_poi); }
|
||||
|
||||
/**************************************** WORDPRESS function PHP POISSY **************************************** */
|
||||
function FnCreateWP_POI($hostaddr) {
|
||||
if ($_POST['NameWP_POI']==="cancel") {exit;}
|
||||
/* Variables */
|
||||
$port=8000; //port de départ...
|
||||
$dockerName= $_POST["NameWP_POI"];
|
||||
$dockerlxc="/root/WP/$dockerName.yml"; //Nom fichier compose
|
||||
$sqlfile ="/root/WP/sql/$dockerName-sql.sql";
|
||||
|
||||
|
||||
//recherche du premier port disponible
|
||||
$connection = @fsockopen($hostaddr, $port);
|
||||
while (is_resource($connection)) { $port++; fclose($connection);$connection = @fsockopen($hostaddr, $port,$errno,$errstr,10); }
|
||||
|
||||
|
||||
/* Création des fichiers compose et db */
|
||||
$Result=ssh_command($hostaddr,"cp /root/WP/wp.yml.save ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/wordpress1/$dockerName/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/8001/$port/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"echo 'CREATE DATABASE IF NOT EXISTS $dockerName;'> $sqlfile" );
|
||||
$Result=ssh_command($hostaddr,"echo 'GRANT ALL PRIVILEGES ON $dockerName.* TO 'wp_user'@'localhost';'>> $sqlfile >$sqlfile.log");
|
||||
|
||||
/* Création de la table correspondante dans la base de donnée */
|
||||
$Result=ssh_command($hostaddr,"docker-compose -f /root/WP/db.yml exec -T db mysql -uroot -plinux wordpress < $sqlfile");
|
||||
sleep(10);
|
||||
//création du conteneur docker...
|
||||
$Result=ssh_command($hostaddr, "export COMPOSE_HTTP_TIMEOUT=240 && docker-compose -f $dockerlxc up -d >$dockerlxc.log");
|
||||
|
||||
|
||||
// Vide l'instruction de créer une machine et puis refresh
|
||||
unset($_POST["NameWP_POI"]);
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
function FnDeleteWP_POI($host) {
|
||||
$dockerName=$_POST['WP_X_POI'];
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
$Result=ssh_command($host, "docker stop $dockerName");
|
||||
$Result=ssh_command($host, "docker rm $dockerName");
|
||||
header("Refresh:0");
|
||||
}
|
||||
/**************************************************************************************************************** */
|
||||
|
||||
/**************************************** PRESTASHOP function PHP POISSY **************************************** */
|
||||
function FnCreatePresta_POI($hostaddr) {
|
||||
$dockerName=$_POST['NamePresta_POI'];
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
/* Variables */
|
||||
$port=7000; //port de départ...
|
||||
$dockerlxc="/root/PS/$dockerName.yml"; //Nom fichier compose
|
||||
$sqlfile ="/root/PS/sql.log";
|
||||
|
||||
//recherche du premiephp refresh page port disponible
|
||||
$connection = @fsockopen($hostaddr, $port);
|
||||
while (is_resource($connection)) { $port++; fclose($connection);$connection = @fsockopen($hostaddr, $port,$errno,$errstr,10); }
|
||||
|
||||
|
||||
/* Création des fichiers compose et db */
|
||||
$Result=ssh_command($hostaddr,"cp /root/PS/ps.yml.save ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/prestashop1/$dockerName/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/8001/$port/g' ".$dockerlxc);
|
||||
|
||||
//création du conteneur docker...
|
||||
$Result=ssh_command($hostaddr, "export DOCKER_CLIENT_TIMEOUT=120 && export DOCKER_HTTP_TIMEOUT=120");
|
||||
$Result=ssh_command($hostaddr, "export COMPOSE_HTTP_TIMEOUT=120 && docker-compose -f $dockerlxc up -d &");
|
||||
sleep(20);
|
||||
|
||||
// Vide l'instruction de créer une machine et puis refresh
|
||||
unset($_POST["NamePresta_POI"]);
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
function FnDeletePresta_POI($host) {
|
||||
$dockerName=$_POST['Presta_X_POI'];
|
||||
$dockerlxc="/root/PS/$dockerName.yml"; //Nom fichier compose
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
$Result=ssh_command($host, "docker stop $dockerName");
|
||||
$Result=ssh_command($host, "docker rm $dockerName");
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
/************************************************************************************************************** */
|
||||
|
||||
/**************************************** WORDPRESS function PHP PARIS **************************************** */
|
||||
function FnCreateWP($hostaddr) {
|
||||
$dockerName=$_POST['NameWP'];
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
/* Variables */
|
||||
$port=8000; //port de départ...
|
||||
$dockerlxc="/root/WP/$dockerName.yml"; //Nom fichier compose
|
||||
$sqlfile ="/root/WP/sql/$dockerName-sql.log";
|
||||
|
||||
//recherche du premier port disponible
|
||||
$connection = @fsockopen($hostaddr, $port);
|
||||
while (is_resource($connection)) { $port++; fclose($connection);$connection = @fsockopen($hostaddr, $port,$errno,$errstr,10); }
|
||||
|
||||
|
||||
/* Création des fichiers compose et db */
|
||||
$Result=ssh_command($hostaddr,"cp /root/WP/wp.yml.save ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/wordpress1/$dockerName/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/8001/$port/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"echo 'CREATE DATABASE IF NOT EXISTS $dockerName;'> $sqlfile" );
|
||||
$Result=ssh_command($hostaddr,"echo 'GRANT ALL PRIVILEGES ON $dockerName.* TO 'wp_user'@'localhost';'>> $sqlfile");
|
||||
|
||||
/* Création de la table correspondante dans la base de donnée */
|
||||
$Result=ssh_command($hostaddr,"docker-compose -f /root/WP/db.yml exec -T db mysql -uroot -plinux wordpress < $sqlfile >$sqlfile.log");
|
||||
sleep(10);
|
||||
//création du conteneur docker...
|
||||
$Result=ssh_command($hostaddr, "export COMPOSE_HTTP_TIMEOUT=240 && docker-compose -f $dockerlxc up -d >$dockerlxc.log");
|
||||
|
||||
// Vide l'instruction de créer une machine et puis refresh
|
||||
unset($_POST["NameWP"]);
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
function FnDeleteWP($host) {
|
||||
$dockerName=$_POST['WP_X'];
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
$Result=ssh_command($host, "docker stop $dockerName");
|
||||
$Result=ssh_command($host, "docker rm $dockerName");
|
||||
header("Refresh:0");
|
||||
}
|
||||
/*************************************************************************************************************** */
|
||||
|
||||
/**************************************** PRESTASHOP function PHP PARIS **************************************** */
|
||||
function FnCreatePresta($hostaddr) {
|
||||
$dockerName=$_POST['NamePresta'];
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
/* Variables */
|
||||
$port=7000; //port de départ...
|
||||
$dockerlxc="/root/PS/$dockerName.yml"; //Nom fichier compose
|
||||
$sqlfile ="/root/PS/sql.sql";
|
||||
|
||||
//recherche du premier port disponible
|
||||
$connection = @fsockopen($hostaddr, $port);
|
||||
while (is_resource($connection)) { $port++; fclose($connection);$connection = @fsockopen($hostaddr, $port,$errno,$errstr,10); }
|
||||
|
||||
|
||||
/* Création des fichiers compose et db */
|
||||
$Result=ssh_command($hostaddr,"cp /root/PS/ps.yml.save ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/prestashop1/$dockerName/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/8001/$port/g' ".$dockerlxc);
|
||||
|
||||
//création du conteneur docker...
|
||||
$Result=ssh_command($hostaddr, "export DOCKER_CLIENT_TIMEOUT=120 && export DOCKER_HTTP_TIMEOUT=120");
|
||||
$Result=ssh_command($hostaddr, "export COMPOSE_HTTP_TIMEOUT=120 && docker-compose -f $dockerlxc up -d &");
|
||||
sleep(20);
|
||||
|
||||
// Vide l'instruction de créer une machine et puis refresh
|
||||
unset($_POST["NamePresta"]);
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
function FnDeletePresta($host) {
|
||||
$dockerName=$_POST['Presta_X'];
|
||||
$dockerlxc="/root/PS/$dockerName.yml"; //Nom fichier compose
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
$Result=ssh_command($host, "docker stop $dockerName");
|
||||
$Result=ssh_command($host, "docker rm $dockerName");
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
// *******************************************************************************************************************
|
||||
|
||||
?>
|
||||
<!--- ********************************************************************---->
|
||||
|
||||
<br><br>
|
||||
|
||||
<h2>Wordpress - Prestashop</h2>
|
||||
|
||||
|
||||
<!-- *********************** Tableau avec les serveurs de base de données ! ******************* -->
|
||||
<?php
|
||||
$Result=ssh_command($host, "docker ps -a | grep -i mysqldb | awk '{print \$NF}' ");
|
||||
$Result2=ssh_command($host, "docker ps -a | grep -i mysqlps | awk '{print \$NF}' ");
|
||||
if (($Result<>NULL) and ($Result2<>NULL))
|
||||
{
|
||||
echo <<<TABLEAU
|
||||
<table style='width:220px'>
|
||||
<tr><th>Serveurs de bases de données</th></tr>
|
||||
<tr><td align='center'><font color='green'>Bases de données Wordpress & Prestashop fonctionnelles </font></td>
|
||||
</tr>
|
||||
</table>
|
||||
TABLEAU;
|
||||
}
|
||||
else echo "<b><font color='red'>Attention les bases de données ne sont pas lancés correctement !</font></b><br/><br/>";
|
||||
?>
|
||||
<br/><br/>
|
||||
<!-- Tableau avec les serveurs WORDPRESS -->
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<table style="width:600px">
|
||||
<tr>
|
||||
<td colspan="2" align='center'><B>PARIS</B></td>
|
||||
</tr>
|
||||
<tr><th>Nom du Wordpress</th>
|
||||
<td style="width:400px">
|
||||
<form name="formWP" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" id="formWP">
|
||||
<input type="submit" name="submit" value="Créer un Wordpress" onclick="createWP()" />
|
||||
<input type="hidden" name="NameWP" id="NameWP" />
|
||||
<input type="submit" name="submit" value="Supprimer un Wordpress" onclick="DelWP()" />
|
||||
<input type="hidden" name="WP_X" id="WP_X" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
/* Recherche de tous les Wordpress */
|
||||
$Result=ssh_command($host, "docker ps | grep -i wordpress | awk '{print \$NF}' ");
|
||||
foreach( $Result as $value ){
|
||||
#Acquire port : docker ps -a | grep -i $value | awk '{print $11}' | cut -d - -f1| cut -d : -f4
|
||||
$portlist =ssh_command($host, "docker ps | awk '{print $11,\$NF}'|grep -i $value | cut -d - -f1| cut -d : -f4");
|
||||
$i=0;
|
||||
foreach($portlist as $portfinal) {
|
||||
$i++;
|
||||
if (!$portfinal==null and !$portfinal=="") {
|
||||
echo "<tr >";
|
||||
echo "<td align='center'>".$value ."</td><td><a href='http://$host:".$portfinal."' target='_blank'> Accéder à $value</a> </td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</td>
|
||||
<td style="width:20px"></td>
|
||||
<td>
|
||||
<table style="width:600px">
|
||||
<tr>
|
||||
<td colspan="2" align='center'><B>POISSY</B></td>
|
||||
</tr>
|
||||
<tr><th>Nom du Wordpress</th>
|
||||
<td style="width:400px">
|
||||
<form name="formWP_POI" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" id="formWP_POI">
|
||||
<input type="submit" name="submit" value="Créer un Wordpress" onclick="createWP()" />
|
||||
<input type="hidden" name="NameWP_POI" id="NameWP_POI" />
|
||||
<input type="submit" name="submit" value="Supprimer un Wordpress" onclick="DelWP()" />
|
||||
<input type="hidden" name="WP_X_POI" id="WP_X_POI" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
/* Recherche de tous les Wordpress */
|
||||
//$Result=ssh_command($host, "docker ps | grep -i wordpress | awk '{print \$NF}' ");
|
||||
foreach( $Result as $value ){
|
||||
#Acquire port : docker ps -a | grep -i $value | awk '{print $11}' | cut -d - -f1| cut -d : -f4
|
||||
//$portlist =ssh_command($host, "docker ps | awk '{print $11,\$NF}'|grep -i $value | cut -d - -f1| cut -d : -f4");
|
||||
$i=0;
|
||||
foreach($portlist as $portfinal) {
|
||||
$i++;
|
||||
if (!$portfinal==null and !$portfinal=="") {
|
||||
echo "<tr >";
|
||||
echo "<td align='center'>".$value ."</td><td><a href='http://$host:".$portfinal."' target='_blank'> Accéder à $value</a> </td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
|
||||
</table>
|
||||
|
||||
</center>
|
||||
|
||||
|
||||
<!-- Boutton reset --->
|
||||
<?php
|
||||
function FnReset($host) {
|
||||
$Result=ssh_command($host, "docker stop $(docker ps -a -q)");
|
||||
$Result=ssh_command($host, "docker rm $(docker ps -a -q)");
|
||||
$Result=ssh_command($host, "docker network prune -f");
|
||||
$Result=ssh_command($host, "rm -f /root/WP/*.yml");
|
||||
$Result=ssh_command($host, "rm -f /root/WP/*.sql");
|
||||
}
|
||||
?>
|
||||
<br><br><br><br><br>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
/* BOUTONS */
|
||||
echo <<< HTML
|
||||
<center>
|
||||
<script type="text/javascript">
|
||||
function createWP() {
|
||||
var wp_name = prompt("Entrer un nom pour le Wordpress :", "wordpress");
|
||||
if (wp_name == null || wp_name == "") {wp_name = "cancel";}
|
||||
document.getElementById("NameWP").value = wp_name;
|
||||
}
|
||||
function DelWP() {
|
||||
var wp_name = prompt("Entrer un nom pour le Wordpress a supprimé :", "");
|
||||
if (wp_name == null || wp_name == "") {wp_name = "cancel";}
|
||||
document.getElementById("WP_X").value = wp_name;
|
||||
}
|
||||
function CreatePresta() {
|
||||
var Presta_name = prompt("Entrer un nom pour le Prestashop :", "Prestashop");
|
||||
if (Presta_name == null || Presta_name == "") {Presta_name = "cancel";}
|
||||
document.getElementById("NamePresta").value = Presta_name;
|
||||
}
|
||||
function DeletePresta() {
|
||||
var Presta_name = prompt("Entrer un nom pour le Prestashop a supprimé :", "");
|
||||
if (Presta_name == null || Presta_name == "") {Presta_name = "cancel";}
|
||||
document.getElementById("Presta_X").value = Presta_name;
|
||||
}
|
||||
</script>
|
||||
</center>
|
||||
HTML;
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,242 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Serveurs BTS NDRC</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!------------------------ Définitions des styles ------------------------->
|
||||
<style>
|
||||
table, th, td {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
</style>
|
||||
<!-- ------------------------------------------------------------------- -->
|
||||
<body>
|
||||
|
||||
<center>
|
||||
<h1>Service Informatique H3 Campus </h1><br><br>
|
||||
|
||||
<?php include 'menu.php';
|
||||
include 'ssh.php';
|
||||
$host="192.168.150.233";
|
||||
|
||||
|
||||
//print_r($_POST) ;
|
||||
|
||||
//<!-- ******************** Fonctions Bouttons ************************** --->
|
||||
if(array_key_exists('Reset', $_POST)) { FnReset($host); }
|
||||
if(array_key_exists('NameWP', $_POST)) { FnCreateWP($host); }
|
||||
if(array_key_exists('WP_X', $_POST)) { FnDeleteWP($host); }
|
||||
if(array_key_exists('NamePresta', $_POST)) { FnCreatePresta($host); }
|
||||
if(array_key_exists('Presta_X', $_POST)) { FnDeletePresta($host); }
|
||||
|
||||
/**************************************** WORDPRESS function PHP **************************************** */
|
||||
function FnCreateWP($hostaddr) {
|
||||
if ($_POST['NameWP']==="cancel") {exit;}
|
||||
/* Variables */
|
||||
$port=8000; //port de départ...
|
||||
$dockerlxc="/root/WP/".$_POST["NameWP"].".yml"; //Nom fichier compose
|
||||
$sqlfile ="/root/WP/sql.sql";
|
||||
|
||||
//recherche du premier port disponible
|
||||
$connection = @fsockopen($hostaddr, $port);
|
||||
while (is_resource($connection)) { $port++; fclose($connection);$connection = @fsockopen('192.168.150.233', $port,$errno,$errstr,10); }
|
||||
|
||||
|
||||
/* Création des fichiers compose et db */
|
||||
$Result=ssh_command($hostaddr,"cp /root/WP/wp.yml.save ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/wordpress1/".$_POST["NameWP"]."/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/8001/$port/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"echo 'CREATE DATABASE IF NOT EXISTS ".$_POST["NameWP"].";'> $sqlfile" );
|
||||
$Result=ssh_command($hostaddr,"echo 'GRANT ALL PRIVILEGES ON ".$_POST["NameWP"].".* TO 'wp_user'@'localhost';'>> $sqlfile");
|
||||
|
||||
/* Création de la table correspondante dans la base de donnée */
|
||||
$Result=ssh_command($hostaddr,"docker-compose -f /root/WP/db.yml exec -T db mysql -uroot -plinux wordpress < $sqlfile");
|
||||
sleep(15);
|
||||
//création du conteneur docker...
|
||||
$Result=ssh_command($hostaddr, "export COMPOSE_HTTP_TIMEOUT=120 && docker-compose -f $dockerlxc up -d &");
|
||||
sleep(20);
|
||||
|
||||
// Vide l'instruction de créer une machine et puis refresh
|
||||
unset($_POST["NameWP"]);
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
function FnDeleteWP($host) {
|
||||
$dockerName=$_POST['WP_X'];
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
$Result=ssh_command($host, "docker stop $dockerName");
|
||||
$Result=ssh_command($host, "docker rm $dockerName");
|
||||
header("Refresh:0");
|
||||
}
|
||||
/**************************************** PRESTASHOP function PHP **************************************** */
|
||||
function FnCreatePresta($hostaddr) {
|
||||
$dockerName=$_POST['NamePresta'];
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
/* Variables */
|
||||
$port=7000; //port de départ...
|
||||
$dockerlxc="/root/PS/$dockerName.yml"; //Nom fichier compose
|
||||
$sqlfile ="/root/PS/sql.sql";
|
||||
|
||||
//recherche du premier port disponible
|
||||
$connection = @fsockopen($hostaddr, $port);
|
||||
while (is_resource($connection)) { $port++; fclose($connection);$connection = @fsockopen($hostaddr, $port,$errno,$errstr,10); }
|
||||
|
||||
|
||||
/* Création des fichiers compose et db */
|
||||
$Result=ssh_command($hostaddr,"cp /root/PS/ps.yml.save ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/prestashop1/$dockerName/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/8001/$port/g' ".$dockerlxc);
|
||||
|
||||
//création du conteneur docker...
|
||||
$Result=ssh_command($hostaddr, "export DOCKER_CLIENT_TIMEOUT=120 && export DOCKER_HTTP_TIMEOUT=120");
|
||||
$Result=ssh_command($hostaddr, "export COMPOSE_HTTP_TIMEOUT=120 && docker-compose -f $dockerlxc up -d &");
|
||||
sleep(20);
|
||||
|
||||
// Vide l'instruction de créer une machine et puis refresh
|
||||
unset($_POST["NamePresta"]);
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
function FnDeletePresta($host) {
|
||||
$dockerName=$_POST['Presta_X'];
|
||||
$dockerlxc="/root/PS/$dockerName.yml"; //Nom fichier compose
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
$Result=ssh_command($host, "docker stop $dockerName");
|
||||
$Result=ssh_command($host, "docker rm $dockerName");
|
||||
header("Refresh:0");
|
||||
}
|
||||
?>
|
||||
<!--- ********************************************************************---->
|
||||
|
||||
<br><br>
|
||||
<!-- ************** Bouton d'actualisation ************ -->
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<FORM>
|
||||
<?php
|
||||
/* Création de la base de donnée (& phppmyadmin) si elle n'existe pas !! */
|
||||
$Result=ssh_command($host, "docker ps | grep mysqldb");
|
||||
if ($Result== null) {
|
||||
//$Result=ssh_command($host,"docker network create wp_wpsite");
|
||||
$Result=ssh_command($host,"cp /root/WP/db.yml.save /root/WP/db.yml");
|
||||
$Result=ssh_command($host, "export DOCKER_CLIENT_TIMEOUT=120 && export DOCKER_HTTP_TIMEOUT=120 && docker-compose -f /root/WP/db.yml up -d");
|
||||
}
|
||||
$Result=ssh_command($host, "docker ps | grep mysqlps");
|
||||
if ($Result== null) {
|
||||
$Result=ssh_command($host,"cp /root/PS/db.yml.save /root/PS/db.yml");
|
||||
$Result=ssh_command($host, "export DOCKER_CLIENT_TIMEOUT=120 && export DOCKER_HTTP_TIMEOUT=120 && docker-compose -f /root/PS/db.yml up -d");
|
||||
}
|
||||
?>
|
||||
<INPUT Type="button" VALUE="Actualiser la liste" onClick="history.go(0)">
|
||||
<form name="form" method="post" action="H3campus.php">
|
||||
</FORM>
|
||||
</td>
|
||||
<tr><br></tr>
|
||||
</table>
|
||||
|
||||
<h2>Wordpress - Prestashop</h2>
|
||||
|
||||
|
||||
<!-- *********************** Tableau avec les serveurs de base de données ! ******************* -->
|
||||
<?php
|
||||
$Result=ssh_command($host, "docker ps -a | grep -i mysqldb | awk '{print \$NF}' ");
|
||||
$Result2=ssh_command($host, "docker ps -a | grep -i mysqlps | awk '{print \$NF}' ");
|
||||
if (($Result<>NULL) and ($Result2<>NULL))
|
||||
{
|
||||
echo <<<TABLEAU
|
||||
<table style='width:220px'>
|
||||
<tr><th>Serveurs de bases de données</th></tr>
|
||||
<tr><td align='center'><font color='green'>Bases de données Wordpress & Prestashop fonctionnelles </font></td>
|
||||
</tr>
|
||||
</table>
|
||||
TABLEAU;
|
||||
}
|
||||
else echo "<b><font color='red'>Attention les bases de données ne sont pas lancés correctement !</font></b><br/><br/>";
|
||||
?>
|
||||
|
||||
|
||||
<!-- Tableau avec les serveurs WORDPRESS -->
|
||||
<table style="width:600px">
|
||||
<tr><th>Serveurs Wordpress</th>
|
||||
<td style="width:400px">
|
||||
<form name="formWP" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" id="formWP">
|
||||
<input type="submit" name="submit" value="Créer un Wordpress" onclick="createWP()" />
|
||||
<input type="hidden" name="NameWP" id="NameWP" />
|
||||
<input type="submit" name="submit" value="Supprimer un Wordpress" onclick="DelWP()" />
|
||||
<input type="hidden" name="WP_X" id="WP_X" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
/* Recherche de tous les Wordpress */
|
||||
$Result=ssh_command($host, "docker ps | grep -i wordpress | awk '{print \$NF}' ");
|
||||
foreach( $Result as $value ){
|
||||
#Acquire port : docker ps -a | grep -i $value | awk '{print $11}' | cut -d - -f1| cut -d : -f4
|
||||
$portlist =ssh_command($host, "docker ps | awk '{print $11,\$NF}'|grep -i $value | cut -d - -f1| cut -d : -f4");
|
||||
$i=0;
|
||||
foreach($portlist as $portfinal) {
|
||||
$i++;
|
||||
if (!$portfinal==null and !$portfinal=="") {
|
||||
echo "<tr><td align='center'>".$value ."</td><td><a href='http://192.168.150.233:".$portfinal."'> Accéder à $value</a> </td></tr><br/>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</center>
|
||||
|
||||
|
||||
<!-- Boutton reset --->
|
||||
<?php
|
||||
function FnReset($host) {
|
||||
$Result=ssh_command($host, "docker stop $(docker ps -a -q)");
|
||||
$Result=ssh_command($host, "docker rm $(docker ps -a -q)");
|
||||
$Result=ssh_command($host, "docker network prune -f");
|
||||
$Result=ssh_command($host, "rm -f /root/WP/*.yml");
|
||||
$Result=ssh_command($host, "rm -f /root/WP/*.sql");
|
||||
}
|
||||
?>
|
||||
<br><br><br><br><br>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
/* BOUTONS */
|
||||
echo <<< HTML
|
||||
<center>
|
||||
<script type="text/javascript">
|
||||
function createWP() {
|
||||
var wp_name = prompt("Entrer un nom pour le Wordpress :", "wordpress");
|
||||
if (wp_name == null || wp_name == "") {wp_name = "cancel";}
|
||||
document.getElementById("NameWP").value = wp_name;
|
||||
}
|
||||
function DelWP() {
|
||||
var wp_name = prompt("Entrer un nom pour le Wordpress a supprimé :", "");
|
||||
if (wp_name == null || wp_name == "") {wp_name = "cancel";}
|
||||
document.getElementById("WP_X").value = wp_name;
|
||||
}
|
||||
function CreatePresta() {
|
||||
var Presta_name = prompt("Entrer un nom pour le Prestashop :", "Prestashop");
|
||||
if (Presta_name == null || Presta_name == "") {Presta_name = "cancel";}
|
||||
document.getElementById("NamePresta").value = Presta_name;
|
||||
}
|
||||
function DeletePresta() {
|
||||
var Presta_name = prompt("Entrer un nom pour le Prestashop a supprimé :", "");
|
||||
if (Presta_name == null || Presta_name == "") {Presta_name = "cancel";}
|
||||
document.getElementById("Presta_X").value = Presta_name;
|
||||
}
|
||||
</script>
|
||||
</center>
|
||||
HTML;
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,169 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Serveurs BTS NDRC</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!------------------------ Définitions des styles ------------------------->
|
||||
<style>
|
||||
table, th, td {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
</style>
|
||||
<!-- ------------------------------------------------------------------- -->
|
||||
<body>
|
||||
|
||||
<center>
|
||||
<h1>Service Informatique H3 Campus </h1>
|
||||
|
||||
<?php include 'menu.php';
|
||||
include 'ssh.php';
|
||||
$host="192.168.150.233";
|
||||
error_reporting(E_ERROR | E_PARSE | E_STRICT);
|
||||
|
||||
//print_r($_POST) ;
|
||||
|
||||
//<!-- ******************** Fonctions Bouttons ************************** --->
|
||||
if(array_key_exists('Reset', $_POST)) { FnReset($host); }
|
||||
if(array_key_exists('NamePresta', $_POST)) { FnCreatePresta($host); }
|
||||
if(array_key_exists('Presta_X', $_POST)) { FnDeletePresta($host); }
|
||||
|
||||
/**************************************** PRESTASHOP function PHP **************************************** */
|
||||
function FnCreatePresta($hostaddr) {
|
||||
$dockerName=$_POST['NamePresta'];
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
/* Variables */
|
||||
$port=7000; //port de départ...
|
||||
$dockerlxc="/root/PS/$dockerName.yml"; //Nom fichier compose
|
||||
|
||||
|
||||
//recherche du premier port disponible
|
||||
$connection = @fsockopen($hostaddr, $port);
|
||||
while (is_resource($connection)) { $port++; fclose($connection);$connection = @fsockopen($hostaddr, $port,$errno,$errstr,10); }
|
||||
|
||||
|
||||
/* Création des fichiers compose et db */
|
||||
$Result=ssh_command($hostaddr,"cp /root/PS/ps.yml.save ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/prestashop1/$dockerName/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/8001/$port/g' ".$dockerlxc);
|
||||
|
||||
//création du conteneur docker...
|
||||
$Result=ssh_command($hostaddr, "export DOCKER_CLIENT_TIMEOUT=240 && export DOCKER_HTTP_TIMEOUT=240 && export COMPOSE_HTTP_TIMEOUT=240 && docker-compose -f $dockerlxc up -d >PS_$dockerName.log");
|
||||
sleep(20);
|
||||
|
||||
// Vide l'instruction de créer une machine et puis refresh
|
||||
unset($_POST["NamePresta"]);
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
function FnDeletePresta($host) {
|
||||
$dockerName=$_POST['Presta_X'];
|
||||
$dockerlxc="/root/PS/$dockerName.yml"; //Nom fichier compose
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
$Result=ssh_command($host, "docker stop $dockerName >>PS_$dockerName.log");
|
||||
$Result=ssh_command($host, "docker rm $dockerName >>PS_$dockerName.log");
|
||||
header("Refresh:0");
|
||||
}
|
||||
?>
|
||||
<!--- ********************************************************************---->
|
||||
|
||||
|
||||
<h2>Prestashop PARIS</h2>
|
||||
|
||||
|
||||
<!-- *********************** Tableau avec les serveurs de base de données ! ******************* -->
|
||||
<?php
|
||||
$Result=ssh_command($host, "docker ps -a | grep -i mysqlps | awk '{print \$NF}' ");
|
||||
if ($Result<>NULL)
|
||||
{
|
||||
echo <<<TABLEAU
|
||||
<table style='width:220px'>
|
||||
<tr><th>Serveurs de bases de données</th></tr>
|
||||
<tr><td align='center'><font color='green'>Bases de données Prestashop fonctionnelles </font></td>
|
||||
</tr>
|
||||
</table>
|
||||
TABLEAU;
|
||||
}
|
||||
else echo "<b><font color='red'>Attention les bases de données ne sont pas lancées correctement !</font></b><br/><br/>";
|
||||
?>
|
||||
<br/>
|
||||
<!-- Tableau avec les serveurs PRESTASHOP -->
|
||||
<table style="width:600px">
|
||||
<tr><th>Serveurs Prestashop</th>
|
||||
<td style="width:400px">
|
||||
<form name="formPresta" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" id="formPresta">
|
||||
<input type="submit" name="submit" value="Créer un Prestashop" onclick="CreatePresta()" />
|
||||
<input type="hidden" name="NamePresta" id="NamePresta" />
|
||||
<input type="submit" name="submit" value="Supprimer un Prestashop" onclick="DeletePresta()" />
|
||||
<input type="hidden" name="Presta_X" id="Presta_X" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
/* Recherche de tous les Prestashop */
|
||||
$Result=ssh_command($host, "docker ps | grep -i prestashop\/prestashop | awk '{print \$NF}' ");
|
||||
foreach( $Result as $value ){
|
||||
#Acquire port : docker ps -a | grep -i $value | awk '{print $11}' | cut -d - -f1| cut -d : -f4
|
||||
$portlist =ssh_command($host, "docker ps | grep -i prestashop\/prestashop | awk '{print $11,\$NF}'| grep -i $value | cut -d - -f1| cut -d : -f4");
|
||||
$i=0;
|
||||
foreach($portlist as $portfinal) {
|
||||
$i++;
|
||||
if (!$portfinal==null and !$portfinal=="") {
|
||||
echo "<tr >";
|
||||
echo "<td align='center'> $value </td><td><a href='http://$host:$portfinal' target='_blank'> Accéder à $value</a> </td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
</center>
|
||||
|
||||
|
||||
<!-- Boutton reset --->
|
||||
<?php
|
||||
function FnReset($host) {
|
||||
$Result=ssh_command($host, "docker stop $(docker ps -a -q)");
|
||||
$Result=ssh_command($host, "docker rm $(docker ps -a -q)");
|
||||
$Result=ssh_command($host, "docker network prune -f");
|
||||
$Result=ssh_command($host, "rm -f /root/WP/*.yml");
|
||||
$Result=ssh_command($host, "rm -f /root/WP/*.sql");
|
||||
}
|
||||
?>
|
||||
<br><br><br><br><br>
|
||||
|
||||
<!---
|
||||
<p style='text-align: right'>
|
||||
<form method="post">
|
||||
<input type="submit" name="Reset" class="button" value="Reset" />
|
||||
</form>
|
||||
</p>
|
||||
--->s
|
||||
|
||||
<?php
|
||||
|
||||
/* BOUTONS */
|
||||
echo <<< HTML
|
||||
<center>
|
||||
<script type="text/javascript">
|
||||
function CreatePresta() {
|
||||
var Presta_name = prompt("Entrer un nom pour le Prestashop :", "Prestashop");
|
||||
if (Presta_name == null || Presta_name == "") {Presta_name = "cancel";}
|
||||
document.getElementById("NamePresta").value = Presta_name;
|
||||
}
|
||||
function DeletePresta() {
|
||||
var Presta_name = prompt("Entrer un nom pour le Prestashop a supprimé :", "");
|
||||
if (Presta_name == null || Presta_name == "") {Presta_name = "cancel";}
|
||||
document.getElementById("Presta_X").value = Presta_name;
|
||||
}
|
||||
</script>
|
||||
</center>
|
||||
HTML;
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,168 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Serveurs BTS NDRC</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!------------------------ Définitions des styles ------------------------->
|
||||
<style>
|
||||
table, th, td {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
</style>
|
||||
<!-- ------------------------------------------------------------------- -->
|
||||
<body>
|
||||
|
||||
<center>
|
||||
<h1>Service Informatique H3 Campus </h1>
|
||||
|
||||
<?php include 'menu.php';
|
||||
include 'ssh.php';
|
||||
$host="192.168.150.233"; /** <<<<<<<<<<<<<<<<<<<<<< A MODIFIER */
|
||||
error_reporting(E_ERROR | E_PARSE | E_STRICT);
|
||||
|
||||
//print_r($_POST) ;
|
||||
|
||||
//<!-- ******************** Fonctions Bouttons ************************** --->
|
||||
if(array_key_exists('Reset', $_POST)) { FnReset($host); }
|
||||
if(array_key_exists('NamePresta', $_POST)) { FnCreatePresta($host); }
|
||||
if(array_key_exists('Presta_X', $_POST)) { FnDeletePresta($host); }
|
||||
|
||||
/**************************************** PRESTASHOP function PHP **************************************** */
|
||||
function FnCreatePresta($hostaddr) {
|
||||
$dockerName=$_POST['NamePresta'];
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
/* Variables */
|
||||
$port=7000; //port de départ...
|
||||
$dockerlxc="/root/PS/$dockerName.yml"; //Nom fichier compose
|
||||
|
||||
//recherche du premier port disponible
|
||||
$connection = @fsockopen($hostaddr, $port);
|
||||
while (is_resource($connection)) { $port++; fclose($connection);$connection = @fsockopen($hostaddr, $port,$errno,$errstr,10); }
|
||||
|
||||
|
||||
/* Création des fichiers compose et db */
|
||||
$Result=ssh_command($hostaddr,"cp /root/PS/ps.yml.save ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/prestashop1/$dockerName/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/8001/$port/g' ".$dockerlxc);
|
||||
|
||||
//création du conteneur docker...
|
||||
$Result=ssh_command($hostaddr, "export DOCKER_CLIENT_TIMEOUT=240 && export DOCKER_HTTP_TIMEOUT=240 && export COMPOSE_HTTP_TIMEOUT=240 && docker-compose -f $dockerlxc up -d >PS_$dockerName.log");
|
||||
sleep(20);
|
||||
|
||||
// Vide l'instruction de créer une machine et puis refresh
|
||||
unset($_POST["NamePresta"]);
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
function FnDeletePresta($host) {
|
||||
$dockerName=$_POST['Presta_X'];
|
||||
$dockerlxc="/root/PS/$dockerName.yml"; //Nom fichier compose
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
$Result=ssh_command($host, "docker stop $dockerName >>PS_$dockerName.log");
|
||||
$Result=ssh_command($host, "docker rm $dockerName >>PS_$dockerName.log");
|
||||
header("Refresh:0");
|
||||
}
|
||||
?>
|
||||
<!--- ********************************************************************---->
|
||||
|
||||
|
||||
<h2>Prestashop POISSY</h2>
|
||||
|
||||
|
||||
<!-- *********************** Tableau avec les serveurs de base de données ! ******************* -->
|
||||
<?php
|
||||
$Result=ssh_command($host, "docker ps -a | grep -i mysqlps | awk '{print \$NF}' ");
|
||||
if ($Result<>NULL)
|
||||
{
|
||||
echo <<<TABLEAU
|
||||
<table style='width:220px'>
|
||||
<tr><th>Serveurs de bases de données</th></tr>
|
||||
<tr><td align='center'><font color='green'>Bases de données Prestashop fonctionnelles </font></td>
|
||||
</tr>
|
||||
</table>
|
||||
TABLEAU;
|
||||
}
|
||||
else echo "<b><font color='red'>Attention les bases de données ne sont pas lancées correctement !</font></b><br/><br/>";
|
||||
?>
|
||||
<br/>
|
||||
|
||||
<!-- Tableau avec les serveurs PRESTASHOP -->
|
||||
<table style="width:600px">
|
||||
<tr><th>Serveurs Prestashop</th>
|
||||
<td style="width:400px">
|
||||
<form name="formPresta" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" id="formPresta">
|
||||
<input type="submit" name="submit" value="Créer un Prestashop" onclick="CreatePresta()" />
|
||||
<input type="hidden" name="NamePresta" id="NamePresta" />
|
||||
<input type="submit" name="submit" value="Supprimer un Prestashop" onclick="DeletePresta()" />
|
||||
<input type="hidden" name="Presta_X" id="Presta_X" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
/* Recherche de tous les Prestashop */
|
||||
$Result=ssh_command($host, "docker ps | grep -i prestashop\/prestashop | awk '{print \$NF}' ");
|
||||
foreach( $Result as $value ){
|
||||
#Acquire port : docker ps -a | grep -i $value | awk '{print $11}' | cut -d - -f1| cut -d : -f4
|
||||
$portlist =ssh_command($host, "docker ps | grep -i prestashop\/prestashop | awk '{print $11,\$NF}'| grep -i $value | cut -d - -f1| cut -d : -f4");
|
||||
$i=0;
|
||||
foreach($portlist as $portfinal) {
|
||||
$i++;
|
||||
if (!$portfinal==null and !$portfinal=="") {
|
||||
echo "<tr >";
|
||||
echo "<td align='center'> $value </td><td><a href='http://$host:$portfinal' target='_blank'> Accéder à $value</a> </td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
</center>
|
||||
|
||||
|
||||
<!-- Boutton reset --->
|
||||
<?php
|
||||
function FnReset($host) {
|
||||
$Result=ssh_command($host, "docker stop $(docker ps -a -q)");
|
||||
$Result=ssh_command($host, "docker rm $(docker ps -a -q)");
|
||||
$Result=ssh_command($host, "docker network prune -f");
|
||||
$Result=ssh_command($host, "rm -f /root/WP/*.yml");
|
||||
$Result=ssh_command($host, "rm -f /root/WP/*.sql");
|
||||
}
|
||||
?>
|
||||
<br><br><br><br><br>
|
||||
|
||||
<!---
|
||||
<p style='text-align: right'>
|
||||
<form method="post">
|
||||
<input type="submit" name="Reset" class="button" value="Reset" />
|
||||
</form>
|
||||
</p>
|
||||
--->
|
||||
<?php
|
||||
|
||||
/* BOUTONS */
|
||||
echo <<< HTML
|
||||
<center>
|
||||
<script type="text/javascript">
|
||||
function CreatePresta() {
|
||||
var Presta_name = prompt("Entrer un nom pour le Prestashop :", "Prestashop");
|
||||
if (Presta_name == null || Presta_name == "") {Presta_name = "cancel";}
|
||||
document.getElementById("NamePresta").value = Presta_name;
|
||||
}
|
||||
function DeletePresta() {
|
||||
var Presta_name = prompt("Entrer un nom pour le Prestashop a supprimé :", "");
|
||||
if (Presta_name == null || Presta_name == "") {Presta_name = "cancel";}
|
||||
document.getElementById("Presta_X").value = Presta_name;
|
||||
}
|
||||
</script>
|
||||
</center>
|
||||
HTML;
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
<?php include 'menu.php';
|
||||
include 'ssh.php';
|
||||
$host="192.168.170.233"; /* <<<<<<<<<<<<<<<<<<< A MODIFIER */
|
||||
error_reporting(E_ERROR | E_PARSE | E_STRICT);
|
||||
|
||||
//print_r($_POST) ;
|
||||
|
||||
//<!-- ******************** Fonctions Bouttons ************************** --->
|
||||
if(array_key_exists('Reset', $_POST)) { FnReset($host); }
|
||||
//Paris
|
||||
if(array_key_exists('NameWP', $_POST)) { FnCreateWP($host); }
|
||||
if(array_key_exists('WP_X', $_POST)) { FnDeleteWP($host); }
|
||||
|
||||
/************************************************************************************************************** */
|
||||
|
||||
/**************************************** WORDPRESS function PHP PARIS **************************************** */
|
||||
function FnCreateWP($hostaddr) {
|
||||
$dockerName=$_POST['NameWP'];
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
/* Variables */
|
||||
$port=8000; //port de départ...
|
||||
$dockerlxc="/root/WP/$dockerName.yml"; //Nom fichier compose
|
||||
$sqlfile ="/root/WP/sql/$dockerName-sql";
|
||||
|
||||
//recherche du premier port disponible
|
||||
$connection = @fsockopen($hostaddr, $port);
|
||||
while (is_resource($connection)) { $port++; fclose($connection);$connection = @fsockopen($hostaddr, $port,$errno,$errstr,10); }
|
||||
|
||||
|
||||
/* Création des fichiers compose et db */
|
||||
$Result=ssh_command($hostaddr,"cp /root/WP/wp.yml.save ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/wordpress1/$dockerName/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/8001/$port/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"echo 'CREATE DATABASE IF NOT EXISTS $dockerName;'> $sqlfile" );
|
||||
$Result=ssh_command($hostaddr,"echo 'GRANT ALL PRIVILEGES ON $dockerName.* TO 'wp_user'@'localhost';'>> $sqlfile");
|
||||
|
||||
/* Création de la table correspondante dans la base de donnée */
|
||||
$Result=ssh_command($hostaddr,"docker-compose -f /root/WP/db.yml exec -T db mysql -uroot -plinux wordpress < $sqlfile >$sqlfile.log");
|
||||
sleep(10);
|
||||
//création du conteneur docker...
|
||||
$Result=ssh_command($hostaddr, "export COMPOSE_HTTP_TIMEOUT=240 && docker-compose -f $dockerlxc up -d >$dockerlxc.log");
|
||||
|
||||
// Vide l'instruction de créer une machine et puis refresh
|
||||
unset($_POST["NameWP"]);
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
function FnDeleteWP($host) {
|
||||
$dockerName=$_POST['WP_X'];
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
$Result=ssh_command($host, "docker stop $dockerName");
|
||||
$Result=ssh_command($host, "docker rm $dockerName");
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
/*************************************************************************************************************** */
|
||||
?>
|
||||
|
|
@ -0,0 +1,175 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Serveurs BTS NDRC</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!------------------------ Définitions des styles ------------------------->
|
||||
<style>
|
||||
table, th, td {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
</style>
|
||||
<!-- ------------------------------------------------------------------- -->
|
||||
<body>
|
||||
|
||||
<center>
|
||||
<h1>Service Informatique H3 Campus </h1><br><br>
|
||||
|
||||
<?php include 'menu.php';
|
||||
include 'ssh.php';
|
||||
$host="192.168.170.233";
|
||||
error_reporting(E_ERROR | E_PARSE | E_STRICT);
|
||||
|
||||
//print_r($_POST) ;
|
||||
|
||||
//<!-- ******************** Fonctions Bouttons ************************** --->
|
||||
if(array_key_exists('Reset', $_POST)) { FnReset($host); }
|
||||
//Paris
|
||||
if(array_key_exists('NameWP', $_POST)) { FnCreateWP($host); }
|
||||
if(array_key_exists('WP_X', $_POST)) { FnDeleteWP($host); }
|
||||
|
||||
/************************************************************************************************************** */
|
||||
|
||||
/**************************************** WORDPRESS function PHP PARIS **************************************** */
|
||||
function FnCreateWP($hostaddr) {
|
||||
$dockerName=$_POST['NameWP'];
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
/* Variables */
|
||||
$port=8000; //port de départ...
|
||||
$dockerlxc="/root/WP/$dockerName.yml"; //Nom fichier compose
|
||||
$sqlfile ="/root/WP/sql/$dockerName-sql";
|
||||
|
||||
//recherche du premier port disponible
|
||||
$connection = @fsockopen($hostaddr, $port);
|
||||
while (is_resource($connection)) { $port++; fclose($connection);$connection = @fsockopen($hostaddr, $port,$errno,$errstr,10); }
|
||||
|
||||
|
||||
/* Création des fichiers compose et db */
|
||||
$Result=ssh_command($hostaddr,"cp /root/WP/wp.yml.save ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/wordpress1/$dockerName/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/8001/$port/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"echo 'CREATE DATABASE IF NOT EXISTS $dockerName;'> $sqlfile" );
|
||||
$Result=ssh_command($hostaddr,"echo 'GRANT ALL PRIVILEGES ON $dockerName.* TO 'wp_user'@'localhost';'>> $sqlfile");
|
||||
|
||||
/* Création de la table correspondante dans la base de donnée */
|
||||
$Result=ssh_command($hostaddr,"docker-compose -f /root/WP/db.yml exec -T db mysql -uroot -plinux wordpress < $sqlfile >$sqlfile.log");
|
||||
sleep(10);
|
||||
//création du conteneur docker...
|
||||
$Result=ssh_command($hostaddr, "export COMPOSE_HTTP_TIMEOUT=240 && docker-compose -f $dockerlxc up -d >$dockerlxc.log");
|
||||
|
||||
// Vide l'instruction de créer une machine et puis refresh
|
||||
unset($_POST["NameWP"]);
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
function FnDeleteWP($host) {
|
||||
$dockerName=$_POST['WP_X'];
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
$Result=ssh_command($host, "docker stop $dockerName");
|
||||
$Result=ssh_command($host, "docker rm $dockerName");
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
/*************************************************************************************************************** */
|
||||
?>
|
||||
|
||||
<h2>Wordpress Paris</h2>
|
||||
|
||||
|
||||
<!-- *********************** Tableau avec les serveurs de base de données ! ******************* -->
|
||||
<?php
|
||||
$Result=ssh_command($host, "docker ps | grep -i mysqldb | awk '{print \$NF}' ");
|
||||
if ($Result<>NULL)
|
||||
{
|
||||
echo <<<TABLEAU
|
||||
<table style='width:220px'>
|
||||
<tr><th>Serveurs de bases de données</th></tr>
|
||||
<tr><td align='center'><font color='green'>Bases de données Wordpress fonctionnelles </font></td>
|
||||
</tr>
|
||||
</table>
|
||||
TABLEAU;
|
||||
}
|
||||
else echo "<b><font color='red'>Attention les bases de données ne sont pas lancées correctement !</font></b><br/><br/>";
|
||||
?>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<!-- Tableau avec les serveurs WORDPRESS -->
|
||||
|
||||
<table style="width:600px">
|
||||
<tr>
|
||||
<td colspan="2" align='center'><B>PARIS</B></td>
|
||||
</tr>
|
||||
<tr><th>Nom du Wordpress</th>
|
||||
<td style="width:400px">
|
||||
<form name="formWP" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" id="formWP">
|
||||
<input type="submit" name="submit" value="Créer un Wordpress" onclick="createWP()" />
|
||||
<input type="hidden" name="NameWP" id="NameWP" />
|
||||
<input type="submit" name="submit" value="Supprimer un Wordpress" onclick="DelWP()" />
|
||||
<input type="hidden" name="WP_X" id="WP_X" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
/* Recherche de tous les Wordpress */
|
||||
$Result=ssh_command($host, "docker ps | grep -i wordpress:latest | awk '{print \$NF}' ");
|
||||
foreach( $Result as $value ){
|
||||
#Acquire port : docker ps -a | grep -i $value | awk '{print $11}' | cut -d - -f1| cut -d : -f4
|
||||
$portlist =ssh_command($host, "docker ps | grep -i wordpress:latest | awk '{print $11,\$NF}'|grep -i $value | cut -d - -f1| cut -d : -f4");
|
||||
$i=0;
|
||||
foreach($portlist as $portfinal) {
|
||||
$i++;
|
||||
if (!$portfinal==null and !$portfinal=="") {
|
||||
echo "<tr >";
|
||||
echo "<td align='center'> $value </td><td><a href='http://$host:$portfinal' target='_blank'> Accéder à $value</a> </td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
|
||||
</center>
|
||||
|
||||
|
||||
<!-- Boutton reset --->
|
||||
<?php
|
||||
function FnReset($host) {
|
||||
$Result=ssh_command($host, "docker stop $(docker ps -a -q)");
|
||||
$Result=ssh_command($host, "docker rm $(docker ps -a -q)");
|
||||
$Result=ssh_command($host, "docker network prune -f");
|
||||
$Result=ssh_command($host, "rm -f /root/WP/*.yml");
|
||||
$Result=ssh_command($host, "rm -f /root/WP/*.sql");
|
||||
}
|
||||
?>
|
||||
<br><br><br><br><br>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
/* BOUTONS */
|
||||
echo <<< HTML
|
||||
<center>
|
||||
<script type="text/javascript">
|
||||
function createWP() {
|
||||
var wp_name = prompt("Entrer un nom pour le Wordpress :", "wordpress");
|
||||
if (wp_name == null || wp_name == "") {wp_name = "cancel";}
|
||||
document.getElementById("NameWP").value = wp_name;
|
||||
}
|
||||
function DelWP() {
|
||||
var wp_name = prompt("Entrer un nom pour le Wordpress a supprimé :", "");
|
||||
if (wp_name == null || wp_name == "") {wp_name = "cancel";}
|
||||
document.getElementById("WP_X").value = wp_name;
|
||||
}
|
||||
</script>
|
||||
</center>
|
||||
HTML;
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,175 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Serveurs BTS NDRC</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!------------------------ Définitions des styles ------------------------->
|
||||
<style>
|
||||
table, th, td {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
</style>
|
||||
<!-- ------------------------------------------------------------------- -->
|
||||
<body>
|
||||
|
||||
<center>
|
||||
<h1>Service Informatique H3 Campus </h1><br><br>
|
||||
|
||||
<?php include 'menu.php';
|
||||
include 'ssh.php';
|
||||
$host="192.168.170.233"; /* <<<<<<<<<<<<<<<<<<< A MODIFIER */
|
||||
error_reporting(E_ERROR | E_PARSE | E_STRICT);
|
||||
|
||||
//print_r($_POST) ;
|
||||
|
||||
//<!-- ******************** Fonctions Bouttons ************************** --->
|
||||
if(array_key_exists('Reset', $_POST)) { FnReset($host); }
|
||||
//Poissy
|
||||
if(array_key_exists('NameWP', $_POST)) { FnCreateWP($host); }
|
||||
if(array_key_exists('WP_X', $_POST)) { FnDeleteWP($host); }
|
||||
|
||||
/************************************************************************************************************** */
|
||||
|
||||
/**************************************** WORDPRESS function PHP PARIS **************************************** */
|
||||
function FnCreateWP($hostaddr) {
|
||||
$dockerName=$_POST['NameWP'];
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
/* Variables */
|
||||
$port=8000; //port de départ...
|
||||
$dockerlxc="/root/WP/$dockerName.yml"; //Nom fichier compose
|
||||
$sqlfile ="/root/WP/sql/$dockerName-sql";
|
||||
|
||||
//recherche du premier port disponible
|
||||
$connection = @fsockopen($hostaddr, $port);
|
||||
while (is_resource($connection)) { $port++; fclose($connection);$connection = @fsockopen($hostaddr, $port,$errno,$errstr,10); }
|
||||
|
||||
|
||||
/* Création des fichiers compose et db */
|
||||
$Result=ssh_command($hostaddr,"cp /root/WP/wp.yml.save ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/wordpress1/$dockerName/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/8001/$port/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"echo 'CREATE DATABASE IF NOT EXISTS $dockerName;'> $sqlfile" );
|
||||
$Result=ssh_command($hostaddr,"echo 'GRANT ALL PRIVILEGES ON $dockerName.* TO 'wp_user'@'localhost';'>> $sqlfile");
|
||||
|
||||
/* Création de la table correspondante dans la base de donnée */
|
||||
$Result=ssh_command($hostaddr,"docker-compose -f /root/WP/db.yml exec -T db mysql -uroot -plinux wordpress < $sqlfile >$sqlfile.log");
|
||||
sleep(10);
|
||||
//création du conteneur docker...
|
||||
$Result=ssh_command($hostaddr, "export COMPOSE_HTTP_TIMEOUT=240 && docker-compose -f $dockerlxc up -d >$dockerlxc.log");
|
||||
|
||||
// Vide l'instruction de créer une machine et puis refresh
|
||||
unset($_POST["NameWP"]);
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
function FnDeleteWP($host) {
|
||||
$dockerName=$_POST['WP_X'];
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
$Result=ssh_command($host, "docker stop $dockerName");
|
||||
$Result=ssh_command($host, "docker rm $dockerName");
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
/*************************************************************************************************************** */
|
||||
?>
|
||||
|
||||
<h2>Wordpress Poissy</h2>
|
||||
|
||||
|
||||
<!-- *********************** Tableau avec les serveurs de base de données ! ******************* -->
|
||||
<?php
|
||||
$Result=ssh_command($host, "docker ps | grep -i mysqldb | awk '{print \$NF}' ");
|
||||
if ($Result<>NULL)
|
||||
{
|
||||
echo <<<TABLEAU
|
||||
<table style='width:220px'>
|
||||
<tr><th>Serveurs de bases de données</th></tr>
|
||||
<tr><td align='center'><font color='green'>Bases de données Wordpress fonctionnelles </font></td>
|
||||
</tr>
|
||||
</table>
|
||||
TABLEAU;
|
||||
}
|
||||
else echo "<b><font color='red'>Attention les bases de données ne sont pas lancées correctement !</font></b><br/><br/>";
|
||||
?>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<!-- Tableau avec les serveurs WORDPRESS -->
|
||||
|
||||
<table style="width:600px">
|
||||
<tr>
|
||||
<td colspan="2" align='center'><B>POISSY</B></td>
|
||||
</tr>
|
||||
<tr><th>Nom du Wordpress</th>
|
||||
<td style="width:400px">
|
||||
<form name="formWP" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" id="formWP">
|
||||
<input type="submit" name="submit" value="Créer un Wordpress" onclick="createWP()" />
|
||||
<input type="hidden" name="NameWP" id="NameWP" />
|
||||
<input type="submit" name="submit" value="Supprimer un Wordpress" onclick="DelWP()" />
|
||||
<input type="hidden" name="WP_X" id="WP_X" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
/* Recherche de tous les Wordpress */
|
||||
$Result=ssh_command($host, "docker ps | grep -i wordpress:latest | awk '{print \$NF}' ");
|
||||
foreach( $Result as $value ){
|
||||
#Acquire port : docker ps -a | grep -i $value | awk '{print $11}' | cut -d - -f1| cut -d : -f4
|
||||
$portlist =ssh_command($host, "docker ps | grep -i wordpress:latest | awk '{print $11,\$NF}'|grep -i $value | cut -d - -f1| cut -d : -f4");
|
||||
$i=0;
|
||||
foreach($portlist as $portfinal) {
|
||||
$i++;
|
||||
if (!$portfinal==null and !$portfinal=="") {
|
||||
echo "<tr >";
|
||||
echo "<td align='center'> $value </td><td><a href='http://$host:$portfinal' target='_blank'> Accéder à $value</a> </td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
|
||||
</center>
|
||||
|
||||
|
||||
<!-- Boutton reset --->
|
||||
<?php
|
||||
function FnReset($host) {
|
||||
$Result=ssh_command($host, "docker stop $(docker ps -a -q)");
|
||||
$Result=ssh_command($host, "docker rm $(docker ps -a -q)");
|
||||
$Result=ssh_command($host, "docker network prune -f");
|
||||
$Result=ssh_command($host, "rm -f /root/WP/*.yml");
|
||||
$Result=ssh_command($host, "rm -f /root/WP/*.sql");
|
||||
}
|
||||
?>
|
||||
<br><br><br><br><br>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
/* BOUTONS */
|
||||
echo <<< HTML
|
||||
<center>
|
||||
<script type="text/javascript">
|
||||
function createWP() {
|
||||
var wp_name = prompt("Entrer un nom pour le Wordpress :", "wordpress");
|
||||
if (wp_name == null || wp_name == "") {wp_name = "cancel";}
|
||||
document.getElementById("NameWP").value = wp_name;
|
||||
}
|
||||
function DelWP() {
|
||||
var wp_name = prompt("Entrer un nom pour le Wordpress a supprimé :", "");
|
||||
if (wp_name == null || wp_name == "") {wp_name = "cancel";}
|
||||
document.getElementById("WP_X").value = wp_name;
|
||||
}
|
||||
</script>
|
||||
</center>
|
||||
HTML;
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,200 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Serveurs BTS NDRC</title>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-latest.min.js"></script>
|
||||
<script>
|
||||
$(window).load(function() {
|
||||
$(".section").fadeOut("3000");
|
||||
$(".Code").load();
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!------------------------ Définitions des styles ------------------------->
|
||||
<style>
|
||||
table, th, td {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
</style>
|
||||
<!-- ------------------------------------------------------------------- -->
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<center>
|
||||
|
||||
<h1>Service Informatique H3 Campus </h1><br><br>
|
||||
|
||||
<?php include 'menu.php';
|
||||
include 'ssh.php';
|
||||
$host="192.168.170.233"; /* <<<<<<<<<<<<<<<<<<< A MODIFIER */
|
||||
error_reporting(E_ERROR | E_PARSE | E_STRICT);
|
||||
|
||||
//print_r($_POST) ;
|
||||
?>
|
||||
|
||||
<?php
|
||||
//<!-- ******************** Fonctions Bouttons ************************** --->
|
||||
if(array_key_exists('Reset', $_POST)) { FnReset($host); }
|
||||
//Paris
|
||||
if(array_key_exists('NameWP', $_POST)) { FnCreateWP($host); }
|
||||
if(array_key_exists('WP_X', $_POST)) { FnDeleteWP($host); }
|
||||
|
||||
/************************************************************************************************************** */
|
||||
|
||||
/**************************************** WORDPRESS function PHP PARIS **************************************** */
|
||||
function FnCreateWP($hostaddr) {
|
||||
$dockerName=$_POST['NameWP'];
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
/* Variables */
|
||||
$port=8000; //port de départ...
|
||||
$dockerlxc="/root/WP/$dockerName.yml"; //Nom fichier compose
|
||||
$sqlfile ="/root/WP/sql/$dockerName-sql";
|
||||
|
||||
|
||||
//recherche du premier port disponible
|
||||
$connection = @fsockopen($hostaddr, $port);
|
||||
while (is_resource($connection)) { $port++; fclose($connection);$connection = @fsockopen($hostaddr, $port,$errno,$errstr,10); }
|
||||
|
||||
|
||||
/* Création des fichiers compose et db */
|
||||
$Result=ssh_command($hostaddr,"cp /root/WP/wp.yml.save ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/wordpress1/$dockerName/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"sed -i 's/8001/$port/g' ".$dockerlxc);
|
||||
$Result=ssh_command($hostaddr,"echo 'CREATE DATABASE IF NOT EXISTS $dockerName;'> $sqlfile" );
|
||||
$Result=ssh_command($hostaddr,"echo 'GRANT ALL PRIVILEGES ON $dockerName.* TO 'wp_user'@'localhost';'>> $sqlfile");
|
||||
|
||||
/* Création de la table correspondante dans la base de donnée */
|
||||
$Result=ssh_command($hostaddr,"docker-compose -f /root/WP/db.yml exec -T db mysql -uroot -plinux wordpress < $sqlfile >$sqlfile.log");
|
||||
sleep(10);
|
||||
//création du conteneur docker...
|
||||
$Result=ssh_command($hostaddr, "export COMPOSE_HTTP_TIMEOUT=240 && docker-compose -f $dockerlxc up -d >$dockerlxc.log");
|
||||
|
||||
// Vide l'instruction de créer une machine et puis refresh
|
||||
unset($_POST["NameWP"]);
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
function FnDeleteWP($host) {
|
||||
$dockerName=$_POST['WP_X'];
|
||||
if ($dockerName==="cancel") {exit;}
|
||||
$Result=ssh_command($host, "docker stop $dockerName");
|
||||
$Result=ssh_command($host, "docker rm $dockerName");
|
||||
header("Refresh:0");
|
||||
}
|
||||
|
||||
/*************************************************************************************************************** */
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<div class="section">
|
||||
<div class="zone_loader">
|
||||
<span class="loader loader-quart"></span>
|
||||
<span class="loading">Chargement en cours...</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="Code">
|
||||
<h2>Wordpress Poissy</h2>
|
||||
|
||||
|
||||
<!-- *********************** Tableau avec les serveurs de base de données ! ******************* -->
|
||||
<?php
|
||||
$Result=ssh_command($host, "docker ps | grep -i mysqldb | awk '{print \$NF}' ");
|
||||
if ($Result<>NULL)
|
||||
{
|
||||
echo <<<TABLEAU
|
||||
<table style='width:220px'>
|
||||
<tr><th>Serveurs de bases de données</th></tr>
|
||||
<tr><td align='center'><font color='green'>Bases de données Wordpress fonctionnelles </font></td>
|
||||
</tr>
|
||||
</table>
|
||||
TABLEAU;
|
||||
}
|
||||
else echo "<b><font color='red'>Attention les bases de données ne sont pas lancés correctement !</font></b><br/><br/>";
|
||||
?>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<!-- Tableau avec les serveurs WORDPRESS -->
|
||||
|
||||
<table style="width:600px">
|
||||
<tr>
|
||||
<td colspan="2" align='center'><B>POISSY</B></td>
|
||||
</tr>
|
||||
<tr><th>Nom du Wordpress</th>
|
||||
<td style="width:400px">
|
||||
<form name="formWP" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" id="formWP">
|
||||
<input type="submit" name="submit" value="Créer un Wordpress" onclick="createWP()" />
|
||||
<input type="hidden" name="NameWP" id="NameWP" />
|
||||
<input type="submit" name="submit" value="Supprimer un Wordpress" onclick="DelWP()" />
|
||||
<input type="hidden" name="WP_X" id="WP_X" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
/* Recherche de tous les Wordpress */
|
||||
$Result=ssh_command($host, "docker ps | grep -i wordpress:latest | awk '{print \$NF}' ");
|
||||
foreach( $Result as $value ){
|
||||
#Acquire port : docker ps -a | grep -i $value | awk '{print $11}' | cut -d - -f1| cut -d : -f4
|
||||
$portlist =ssh_command($host, "docker ps | grep -i wordpress:latest | awk '{print $11,\$NF}'|grep -i $value | cut -d - -f1| cut -d : -f4");
|
||||
$i=0;
|
||||
foreach($portlist as $portfinal) {
|
||||
$i++;
|
||||
if (!$portfinal==null and !$portfinal=="") {
|
||||
echo "<tr >";
|
||||
echo "<td align='center'> $value </td><td><a href='http://$host:$portfinal' target='_blank'> Accéder à $value</a> </td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
|
||||
</center>
|
||||
|
||||
<!-- Boutton reset --->
|
||||
<?php
|
||||
function FnReset($host) {
|
||||
$Result=ssh_command($host, "docker stop $(docker ps -a -q)");
|
||||
$Result=ssh_command($host, "docker rm $(docker ps -a -q)");
|
||||
$Result=ssh_command($host, "docker network prune -f");
|
||||
$Result=ssh_command($host, "rm -f /root/WP/*.yml");
|
||||
$Result=ssh_command($host, "rm -f /root/WP/*.sql");
|
||||
}
|
||||
?>
|
||||
<br><br><br><br><br>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
/* BOUTONS */
|
||||
echo <<< HTML
|
||||
<center>
|
||||
<script type="text/javascript">
|
||||
function createWP() {
|
||||
var wp_name = prompt("Entrer un nom pour le Wordpress :", "wordpress");
|
||||
if (wp_name == null || wp_name == "") {wp_name = "cancel";}
|
||||
document.getElementById("NameWP").value = wp_name;
|
||||
}
|
||||
function DelWP() {
|
||||
var wp_name = prompt("Entrer un nom pour le Wordpress a supprimé :", "");
|
||||
if (wp_name == null || wp_name == "") {wp_name = "cancel";}
|
||||
document.getElementById("WP_X").value = wp_name;
|
||||
}
|
||||
</script>
|
||||
</center>
|
||||
HTML;
|
||||
?>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php include 'menu.php'; ?>
|
||||
|
||||
<br><br><br><br>
|
||||
|
||||
<center>
|
||||
<img src="img/security.jpeg" alt="">
|
||||
</center>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
include("Net/SSH2.php")
|
||||
|
||||
/* Etablir une liaison avec public/private key */
|
||||
function connect_to($machine)
|
||||
{
|
||||
/* Connection sur le port 22 de $machine en utilisanr RSA */
|
||||
$connection=@ssh2_connect($machine, 22,
|
||||
array("hostkey"=>"ssh-rsa"));
|
||||
if(!$connection)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* le fingerprint n'est pas teste, c'est voulu, il est juste affiche */
|
||||
$fingerprint=@ssh2_fingerprint($connection,
|
||||
SSH2_FINGERPRINT_MD5 | SSH2_FINGERPRINT_HEX);
|
||||
|
||||
/* Utilisation de public/private key */
|
||||
if(@ssh2_auth_pubkey_file($connection, "user",
|
||||
"public_key", "private_key", "passphrase"))
|
||||
{
|
||||
return array($connection,$fingerprint);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Executer une commande, retour les flux stderr et stdout de la commande */
|
||||
function ssh_command($connection, $cmd)
|
||||
{
|
||||
/* Exec commande */
|
||||
$stdout_stream=@ssh2_exec($connection, $cmd);
|
||||
if(!$stdout_stream)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Extrait le flux stderr, a l'origine mixe dans stdout */
|
||||
$stderr_stream=@ssh2_fetch_stream($stdout_stream,
|
||||
SSH2_STREAM_STDERR);
|
||||
if(!$stderr_stream)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Les flux sont bloquant pour lire le contenu ensuite l'afficher */
|
||||
if(!@stream_set_blocking($stdout_stream, true))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(!@stream_set_blocking($stderr_stream, true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
return array($stdout_stream, $stderr_stream);
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,368 @@
|
|||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>Apache2 Debian Default Page: It works</title>
|
||||
<style type="text/css" media="screen">
|
||||
* {
|
||||
margin: 0px 0px 0px 0px;
|
||||
padding: 0px 0px 0px 0px;
|
||||
}
|
||||
|
||||
body, html {
|
||||
padding: 3px 3px 3px 3px;
|
||||
|
||||
background-color: #D8DBE2;
|
||||
|
||||
font-family: Verdana, sans-serif;
|
||||
font-size: 11pt;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div.main_page {
|
||||
position: relative;
|
||||
display: table;
|
||||
|
||||
width: 800px;
|
||||
|
||||
margin-bottom: 3px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding: 0px 0px 0px 0px;
|
||||
|
||||
border-width: 2px;
|
||||
border-color: #212738;
|
||||
border-style: solid;
|
||||
|
||||
background-color: #FFFFFF;
|
||||
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div.page_header {
|
||||
height: 99px;
|
||||
width: 100%;
|
||||
|
||||
background-color: #F5F6F7;
|
||||
}
|
||||
|
||||
div.page_header span {
|
||||
margin: 15px 0px 0px 50px;
|
||||
|
||||
font-size: 180%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.page_header img {
|
||||
margin: 3px 0px 0px 40px;
|
||||
|
||||
border: 0px 0px 0px;
|
||||
}
|
||||
|
||||
div.table_of_contents {
|
||||
clear: left;
|
||||
|
||||
min-width: 200px;
|
||||
|
||||
margin: 3px 3px 3px 3px;
|
||||
|
||||
background-color: #FFFFFF;
|
||||
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.table_of_contents_item {
|
||||
clear: left;
|
||||
|
||||
width: 100%;
|
||||
|
||||
margin: 4px 0px 0px 0px;
|
||||
|
||||
background-color: #FFFFFF;
|
||||
|
||||
color: #000000;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.table_of_contents_item a {
|
||||
margin: 6px 0px 0px 6px;
|
||||
}
|
||||
|
||||
div.content_section {
|
||||
margin: 3px 3px 3px 3px;
|
||||
|
||||
background-color: #FFFFFF;
|
||||
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.content_section_text {
|
||||
padding: 4px 8px 4px 8px;
|
||||
|
||||
color: #000000;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
div.content_section_text pre {
|
||||
margin: 8px 0px 8px 0px;
|
||||
padding: 8px 8px 8px 8px;
|
||||
|
||||
border-width: 1px;
|
||||
border-style: dotted;
|
||||
border-color: #000000;
|
||||
|
||||
background-color: #F5F6F7;
|
||||
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
div.content_section_text p {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
div.content_section_text ul, div.content_section_text li {
|
||||
padding: 4px 8px 4px 16px;
|
||||
}
|
||||
|
||||
div.section_header {
|
||||
padding: 3px 6px 3px 6px;
|
||||
|
||||
background-color: #8E9CB2;
|
||||
|
||||
color: #FFFFFF;
|
||||
font-weight: bold;
|
||||
font-size: 112%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div.section_header_red {
|
||||
background-color: #CD214F;
|
||||
}
|
||||
|
||||
div.section_header_grey {
|
||||
background-color: #9F9386;
|
||||
}
|
||||
|
||||
.floating_element {
|
||||
position: relative;
|
||||
float: left;
|
||||
}
|
||||
|
||||
div.table_of_contents_item a,
|
||||
div.content_section_text a {
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.table_of_contents_item a:link,
|
||||
div.table_of_contents_item a:visited,
|
||||
div.table_of_contents_item a:active {
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
div.table_of_contents_item a:hover {
|
||||
background-color: #000000;
|
||||
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
div.content_section_text a:link,
|
||||
div.content_section_text a:visited,
|
||||
div.content_section_text a:active {
|
||||
background-color: #DCDFE6;
|
||||
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
div.content_section_text a:hover {
|
||||
background-color: #000000;
|
||||
|
||||
color: #DCDFE6;
|
||||
}
|
||||
|
||||
div.validator {
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main_page">
|
||||
<div class="page_header floating_element">
|
||||
<img src="/icons/openlogo-75.png" alt="Debian Logo" class="floating_element"/>
|
||||
<span class="floating_element">
|
||||
Apache2 Debian Default Page
|
||||
</span>
|
||||
</div>
|
||||
<!-- <div class="table_of_contents floating_element">
|
||||
<div class="section_header section_header_grey">
|
||||
TABLE OF CONTENTS
|
||||
</div>
|
||||
<div class="table_of_contents_item floating_element">
|
||||
<a href="#about">About</a>
|
||||
</div>
|
||||
<div class="table_of_contents_item floating_element">
|
||||
<a href="#changes">Changes</a>
|
||||
</div>
|
||||
<div class="table_of_contents_item floating_element">
|
||||
<a href="#scope">Scope</a>
|
||||
</div>
|
||||
<div class="table_of_contents_item floating_element">
|
||||
<a href="#files">Config files</a>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<div class="content_section floating_element">
|
||||
|
||||
|
||||
<div class="section_header section_header_red">
|
||||
<div id="about"></div>
|
||||
It works!
|
||||
</div>
|
||||
<div class="content_section_text">
|
||||
<p>
|
||||
This is the default welcome page used to test the correct
|
||||
operation of the Apache2 server after installation on Debian systems.
|
||||
If you can read this page, it means that the Apache HTTP server installed at
|
||||
this site is working properly. You should <b>replace this file</b> (located at
|
||||
<tt>/var/www/html/index.html</tt>) before continuing to operate your HTTP server.
|
||||
</p>
|
||||
|
||||
|
||||
<p>
|
||||
If you are a normal user of this web site and don't know what this page is
|
||||
about, this probably means that the site is currently unavailable due to
|
||||
maintenance.
|
||||
If the problem persists, please contact the site's administrator.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="section_header">
|
||||
<div id="changes"></div>
|
||||
Configuration Overview
|
||||
</div>
|
||||
<div class="content_section_text">
|
||||
<p>
|
||||
Debian's Apache2 default configuration is different from the
|
||||
upstream default configuration, and split into several files optimized for
|
||||
interaction with Debian tools. The configuration system is
|
||||
<b>fully documented in
|
||||
/usr/share/doc/apache2/README.Debian.gz</b>. Refer to this for the full
|
||||
documentation. Documentation for the web server itself can be
|
||||
found by accessing the <a href="/manual">manual</a> if the <tt>apache2-doc</tt>
|
||||
package was installed on this server.
|
||||
|
||||
</p>
|
||||
<p>
|
||||
The configuration layout for an Apache2 web server installation on Debian systems is as follows:
|
||||
</p>
|
||||
<pre>
|
||||
/etc/apache2/
|
||||
|-- apache2.conf
|
||||
| `-- ports.conf
|
||||
|-- mods-enabled
|
||||
| |-- *.load
|
||||
| `-- *.conf
|
||||
|-- conf-enabled
|
||||
| `-- *.conf
|
||||
|-- sites-enabled
|
||||
| `-- *.conf
|
||||
</pre>
|
||||
<ul>
|
||||
<li>
|
||||
<tt>apache2.conf</tt> is the main configuration
|
||||
file. It puts the pieces together by including all remaining configuration
|
||||
files when starting up the web server.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>ports.conf</tt> is always included from the
|
||||
main configuration file. It is used to determine the listening ports for
|
||||
incoming connections, and this file can be customized anytime.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Configuration files in the <tt>mods-enabled/</tt>,
|
||||
<tt>conf-enabled/</tt> and <tt>sites-enabled/</tt> directories contain
|
||||
particular configuration snippets which manage modules, global configuration
|
||||
fragments, or virtual host configurations, respectively.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
They are activated by symlinking available
|
||||
configuration files from their respective
|
||||
*-available/ counterparts. These should be managed
|
||||
by using our helpers
|
||||
<tt>
|
||||
a2enmod,
|
||||
a2dismod,
|
||||
</tt>
|
||||
<tt>
|
||||
a2ensite,
|
||||
a2dissite,
|
||||
</tt>
|
||||
and
|
||||
<tt>
|
||||
a2enconf,
|
||||
a2disconf
|
||||
</tt>. See their respective man pages for detailed information.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
The binary is called apache2. Due to the use of
|
||||
environment variables, in the default configuration, apache2 needs to be
|
||||
started/stopped with <tt>/etc/init.d/apache2</tt> or <tt>apache2ctl</tt>.
|
||||
<b>Calling <tt>/usr/bin/apache2</tt> directly will not work</b> with the
|
||||
default configuration.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="section_header">
|
||||
<div id="docroot"></div>
|
||||
Document Roots
|
||||
</div>
|
||||
|
||||
<div class="content_section_text">
|
||||
<p>
|
||||
By default, Debian does not allow access through the web browser to
|
||||
<em>any</em> file apart of those located in <tt>/var/www</tt>,
|
||||
<a href="http://httpd.apache.org/docs/2.4/mod/mod_userdir.html" rel="nofollow">public_html</a>
|
||||
directories (when enabled) and <tt>/usr/share</tt> (for web
|
||||
applications). If your site is using a web document root
|
||||
located elsewhere (such as in <tt>/srv</tt>) you may need to whitelist your
|
||||
document root directory in <tt>/etc/apache2/apache2.conf</tt>.
|
||||
</p>
|
||||
<p>
|
||||
The default Debian document root is <tt>/var/www/html</tt>. You
|
||||
can make your own virtual hosts under /var/www. This is different
|
||||
to previous releases which provides better security out of the box.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="section_header">
|
||||
<div id="bugs"></div>
|
||||
Reporting Problems
|
||||
</div>
|
||||
<div class="content_section_text">
|
||||
<p>
|
||||
Please use the <tt>reportbug</tt> tool to report bugs in the
|
||||
Apache2 package with Debian. However, check <a
|
||||
href="http://bugs.debian.org/cgi-bin/pkgreport.cgi?ordering=normal;archive=0;src=apache2;repeatmerged=0"
|
||||
rel="nofollow">existing bug reports</a> before reporting a new bug.
|
||||
</p>
|
||||
<p>
|
||||
Please report bugs specific to modules (such as PHP and others)
|
||||
to respective packages, not to the web server itself.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="validator">
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 7.1 KiB |
|
|
@ -0,0 +1,333 @@
|
|||
<style type="text/css">
|
||||
/*
|
||||
#menu li {
|
||||
background: #012B55 ;
|
||||
list-style: none ;
|
||||
color: #fff ;
|
||||
display: inline ;
|
||||
margin-right: 1px ;
|
||||
}
|
||||
#menu li a {
|
||||
text-decoration: none ;
|
||||
text-align: center ;
|
||||
background: #012B55 ;
|
||||
color: #fff ;
|
||||
border: 1px solid #012B55 ;
|
||||
font-weight:bold;
|
||||
line-height: 1em ;
|
||||
padding: 5px 40px ;
|
||||
}
|
||||
#menu li a:hover, #menu li a:focus, #menu li a:active {
|
||||
background: #024282 ;
|
||||
}
|
||||
*/
|
||||
body, ul, li {
|
||||
font-size:14px;
|
||||
font-family:Arial, Helvetica, sans-serif;
|
||||
line-height:21px;
|
||||
text-align:left;
|
||||
}
|
||||
@page { margin: 1% }
|
||||
|
||||
#menu {
|
||||
list-style:none;
|
||||
width:940px;
|
||||
margin:30px auto 0px auto;
|
||||
height:43px;
|
||||
padding:0px 20px 0px 20px;
|
||||
|
||||
/* Rounded Corners */
|
||||
|
||||
-moz-border-radius: 10px;
|
||||
-webkit-border-radius: 10px;
|
||||
border-radius: 10px;
|
||||
|
||||
/* Background color and gradients */
|
||||
|
||||
background: #102457;
|
||||
background: -moz-linear-gradient(top, #0272a7, #102457);
|
||||
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#0272a7), to(#102457));
|
||||
|
||||
/* Borders */
|
||||
|
||||
border: 1px solid #002232;
|
||||
|
||||
-moz-box-shadow:inset 0px 0px 1px #edf9ff;
|
||||
-webkit-box-shadow:inset 0px 0px 1px #edf9ff;
|
||||
box-shadow:inset 0px 0px 1px #edf9ff;
|
||||
}
|
||||
|
||||
#menu li {
|
||||
float:left;
|
||||
display:block;
|
||||
text-align:center;
|
||||
position:relative;
|
||||
padding: 4px 10px 4px 10px;
|
||||
margin-right:30px;
|
||||
margin-top:7px;
|
||||
border:none;
|
||||
}
|
||||
|
||||
#menu li:hover {
|
||||
border: 1px solid #777777;
|
||||
padding: 4px 9px 4px 9px;
|
||||
|
||||
/* Background color and gradients */
|
||||
|
||||
background: #F4F4F4;
|
||||
background: -moz-linear-gradient(top, #F4F4F4, #EEEEEE);
|
||||
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#F4F4F4), to(#EEEEEE));
|
||||
|
||||
/* Rounded corners */
|
||||
|
||||
-moz-border-radius: 5px 5px 0px 0px;
|
||||
-webkit-border-radius: 5px 5px 0px 0px;
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
}
|
||||
|
||||
#menu li a {
|
||||
font-family:Arial, Helvetica, sans-serif;
|
||||
font-size:14px;
|
||||
color: #EEEEEE;
|
||||
display:block;
|
||||
outline:0;
|
||||
text-decoration:none;
|
||||
text-shadow: 1px 1px 1px #000;
|
||||
}
|
||||
|
||||
#menu li:hover a {
|
||||
color:#161616;
|
||||
text-shadow: 1px 1px 1px #ffffff;
|
||||
}
|
||||
#menu li .drop {
|
||||
padding-right:21px;
|
||||
background:url("img/drop.png") no-repeat right 8px;
|
||||
}
|
||||
#menu li:hover .drop {
|
||||
background:url("img/drop.png") no-repeat right 7px;
|
||||
}
|
||||
#menu li .info {
|
||||
padding-right:11px;
|
||||
background:url("img/info.png") no-repeat right 7px;
|
||||
}
|
||||
|
||||
|
||||
.dropdown_1column,
|
||||
.dropdown_2columns,
|
||||
.dropdown_3columns,
|
||||
.dropdown_4columns,
|
||||
.dropdown_5columns {
|
||||
margin:4px auto;
|
||||
float:left;
|
||||
position:absolute;
|
||||
left:-999em; /* Hides the drop down */
|
||||
text-align:left;
|
||||
padding:10px 5px 10px 5px;
|
||||
border:1px solid #777777;
|
||||
border-top:none;
|
||||
|
||||
/* Gradient background */
|
||||
background:#F4F4F4;
|
||||
background: -moz-linear-gradient(top, #EEEEEE, #BBBBBB);
|
||||
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#EEEEEE), to(#BBBBBB));
|
||||
|
||||
/* Rounded Corners */
|
||||
-moz-border-radius: 0px 5px 5px 5px;
|
||||
-webkit-border-radius: 0px 5px 5px 5px;
|
||||
border-radius: 0px 5px 5px 5px;
|
||||
}
|
||||
|
||||
.dropdown_1column {width: 140px;}
|
||||
.dropdown_2columns {width: 280px;}
|
||||
.dropdown_3columns {width: 420px;}
|
||||
.dropdown_4columns {width: 560px;}
|
||||
.dropdown_5columns {width: 700px;}
|
||||
|
||||
#menu li:hover .dropdown_1column,
|
||||
#menu li:hover .dropdown_2columns,
|
||||
#menu li:hover .dropdown_3columns,
|
||||
#menu li:hover .dropdown_4columns,
|
||||
#menu li:hover .dropdown_5columns {
|
||||
left:-1px;
|
||||
top:auto;
|
||||
}
|
||||
|
||||
.col_1,
|
||||
.col_2,
|
||||
.col_3,
|
||||
.col_4,
|
||||
.col_5 {
|
||||
display:inline;
|
||||
float: left;
|
||||
position: relative;
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.col_1 {width:130px;}
|
||||
.col_2 {width:270px;}
|
||||
.col_3 {width:410px;}
|
||||
.col_4 {width:550px;}
|
||||
.col_5 {width:690px;}
|
||||
|
||||
#menu .menu_right {
|
||||
float:right;
|
||||
margin-right:0px;
|
||||
}
|
||||
#menu li .align_right {
|
||||
/* Rounded Corners */
|
||||
-moz-border-radius: 5px 0px 5px 5px;
|
||||
-webkit-border-radius: 5px 0px 5px 5px;
|
||||
border-radius: 5px 0px 5px 5px;
|
||||
}
|
||||
|
||||
#menu li:hover .align_right {
|
||||
left:auto;
|
||||
right:-1px;
|
||||
top:auto;
|
||||
}
|
||||
|
||||
#menu p, #menu h2, #menu h3, #menu ul li {
|
||||
font-family:Arial, Helvetica, sans-serif;
|
||||
line-height:21px;
|
||||
font-size:12px;
|
||||
text-align:left;
|
||||
text-shadow: 1px 1px 1px #FFFFFF;
|
||||
}
|
||||
#menu h2 {
|
||||
font-size:21px;
|
||||
font-weight:400;
|
||||
letter-spacing:-1px;
|
||||
margin:7px 0 14px 0;
|
||||
padding-bottom:14px;
|
||||
border-bottom:1px solid #666666;
|
||||
}
|
||||
#menu h3 {
|
||||
font-size:14px;
|
||||
margin:7px 0 14px 0;
|
||||
padding-bottom:7px;
|
||||
border-bottom:1px solid #888888;
|
||||
}
|
||||
#menu p {
|
||||
line-height:18px;
|
||||
margin:0 0 10px 0;
|
||||
}
|
||||
|
||||
#menu li:hover div a {
|
||||
font-size:12px;
|
||||
color:#015b86;
|
||||
}
|
||||
#menu li:hover div a:hover {
|
||||
color:#029feb;
|
||||
}
|
||||
|
||||
|
||||
.strong {
|
||||
font-weight:bold;
|
||||
}
|
||||
.italic {
|
||||
font-style:italic;
|
||||
}
|
||||
|
||||
.imgshadow { /* Better style on light background */
|
||||
background:#FFFFFF;
|
||||
padding:4px;
|
||||
border:1px solid #777777;
|
||||
margin-top:5px;
|
||||
-moz-box-shadow:0px 0px 5px #666666;
|
||||
-webkit-box-shadow:0px 0px 5px #666666;
|
||||
box-shadow:0px 0px 5px #666666;
|
||||
}
|
||||
.img_left { /* Image sticks to the left */
|
||||
width:auto;
|
||||
float:left;
|
||||
margin:5px 15px 5px 5px;
|
||||
}
|
||||
|
||||
#menu li .black_box {
|
||||
background-color:#333333;
|
||||
color: #eeeeee;
|
||||
text-shadow: 1px 1px 1px #000;
|
||||
padding:4px 6px 4px 6px;
|
||||
|
||||
/* Rounded Corners */
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
|
||||
/* Shadow */
|
||||
-webkit-box-shadow:inset 0 0 3px #000000;
|
||||
-moz-box-shadow:inset 0 0 3px #000000;
|
||||
box-shadow:inset 0 0 3px #000000;
|
||||
}
|
||||
|
||||
#menu li ul {
|
||||
list-style:none;
|
||||
padding:0;
|
||||
margin:0 0 12px 0;
|
||||
}
|
||||
#menu li ul li {
|
||||
font-size:12px;
|
||||
line-height:24px;
|
||||
position:relative;
|
||||
text-shadow: 1px 1px 1px #ffffff;
|
||||
padding:0;
|
||||
margin:0;
|
||||
float:none;
|
||||
text-align:left;
|
||||
width:130px;
|
||||
}
|
||||
#menu li ul li:hover {
|
||||
background:none;
|
||||
border:none;
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
#menu li .greybox li {
|
||||
background:#F4F4F4;
|
||||
border:1px solid #bbbbbb;
|
||||
margin:0px 0px 4px 0px;
|
||||
padding:4px 6px 4px 6px;
|
||||
width:116px;
|
||||
|
||||
/* Rounded Corners */
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
-khtml-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
#menu li .greybox li:hover {
|
||||
background:#ffffff;
|
||||
border:1px solid #aaaaaa;
|
||||
padding:4px 6px 4px 6px;
|
||||
margin:0px 0px 4px 0px;
|
||||
}
|
||||
|
||||
#menu li .submenu
|
||||
{
|
||||
position:fixed;
|
||||
margin: -25px 0px 0px 100px;
|
||||
z-index: 50;
|
||||
visibility:hidden;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<div id='menu'>
|
||||
<li><a href='accueil.php'>Accueil </a></li>
|
||||
<li><a href='H3campus.php'> Wordpress/PrestaShop</a>
|
||||
<div class="dropdown_1column">
|
||||
<div class="col_1">
|
||||
<ul class="simple">
|
||||
<li><a href="WP_Paris.php">Wordpress sur Paris</a></li>
|
||||
<li><a href="WP_Poissy.php">Wordpress sur Poissy</a></li>
|
||||
<li><a href="PS_Paris.php">PrestShop sur Paris</a></li>
|
||||
<li><a href="PS_Poissy.php">PrestShop sur Poissy</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li><a href='#'>Service Info.</a></li>
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
$port=8000; //port de départ...
|
||||
|
||||
//recherche du premier port disponible
|
||||
$connection = @fsockopen('192.168.150.233', $port,$errno,$errstr,10);
|
||||
echo "Erreur n°$errno : $errstr";
|
||||
while (is_resource($connection)) { $port++; fclose($connection); $connection = @fsockopen('192.168.150.233', $port,$errno,$errstr,10); }
|
||||
echo "<h2>Port disponible : $port </h2>";
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
document.onreadystatechange = function(e)
|
||||
{
|
||||
if(document.readyState=="interactive")
|
||||
{
|
||||
var all = document.getElementsByTagName("*");
|
||||
for (var i=0, max=all.length; i < max; i++)
|
||||
{
|
||||
set_ele(all[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function check_element(ele)
|
||||
{
|
||||
var all = document.getElementsByTagName("*");
|
||||
var totalele=all.length;
|
||||
var per_inc=100/all.length;
|
||||
|
||||
if($(ele).on())
|
||||
{
|
||||
var prog_width=per_inc+Number(document.getElementById("progress_width").value);
|
||||
document.getElementById("progress_width").value=prog_width;
|
||||
$("#bar1").animate({width:prog_width+"%"},10,function(){
|
||||
if(document.getElementById("bar1").style.width=="100%")
|
||||
{
|
||||
$(".progress").fadeOut("slow");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
set_ele(ele);
|
||||
}
|
||||
}
|
||||
|
||||
function set_ele(set_element)
|
||||
{
|
||||
check_element(set_element);
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
body
|
||||
{
|
||||
margin:0px; auto;
|
||||
padding:0px;
|
||||
font-family:helvetica;
|
||||
}
|
||||
.progress
|
||||
{
|
||||
position: fixed;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 9999;
|
||||
background-color: #F2F2F2;
|
||||
}
|
||||
.bar
|
||||
{
|
||||
background-color: #819FF7;
|
||||
width:0%;
|
||||
height:5px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.percent
|
||||
{
|
||||
position:absolute;
|
||||
display:inline-block;
|
||||
top:3px;
|
||||
left:48%;
|
||||
}
|
||||
#wrapper
|
||||
{
|
||||
width:995px;
|
||||
padding:0px;
|
||||
margin:0px auto;
|
||||
font-family:helvetica;
|
||||
text-align:center;
|
||||
}
|
||||
h1
|
||||
{
|
||||
text-align:center;
|
||||
font-size:35px;
|
||||
margin-top:60px;
|
||||
color:#A9BCF5;
|
||||
}
|
||||
h1 p
|
||||
{
|
||||
text-align:center;
|
||||
margin:0px;
|
||||
font-size:18px;
|
||||
text-decoration:underline;
|
||||
color:grey;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
|
||||
# Gestion des conteneurs dockers
|
||||
---
|
||||
|
||||
## Wordpress
|
||||
|
||||
## Prestashop
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
<html>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include 'ssh.php';
|
||||
$host="192.168.150.233"; //docker
|
||||
|
||||
$dockerlxc="/root/WP/wordpress9.yml"; //Nom fichier compose
|
||||
$sqlfile="/root/WP/sql.sql";
|
||||
|
||||
/* Création de la table correspondante dans la base de donnée */
|
||||
echo "docker-compose -f /root/WP/db.yml exec -T db mysql -uroot -plinux wordpress < $sqlfile";
|
||||
$Result=ssh_command($host,"docker-compose -f /root/WP/db.yml exec -T db mysql -uroot -plinux wordpress < $sqlfile");
|
||||
print_r($Result);
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
$output = shell_exec('cat /etc/hosts');
|
||||
echo "<pre>$output</pre>";
|
||||
?>
|
||||
Loading…
Reference in New Issue