Salut,
voilà je cherche le moyen de, via un script .cgi ou .pl d'afficher le résultat de cette commande unix sur le serveur web :
pure-ftpwho -w >/usr/local/httpd/htdocs/traffic_ftp.html
Voici le résultat sur le shell:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
| linux~#:pure-ftpwho -w
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=ISO-8859-15" />
<title>Pure-FTPd server status</title>
<style type="text/css">
html {
background-color: #369;
}
body {
background-color: #fff;
color: #000;
margin: 12px;
padding: 8px;
border: 2px solid #000;
font-family: "Trebuchet MS",Verdana,Geneva,Arial,Helvetica,sans-serif;
font-size: 0.8em;
}
h1 {
text-align: center;
border-bottom: 1px solid #666;
margin: 0.5em 1em;
}
#ftp-status {
text-align: center;
}
table {
margin: 0 auto;
}
thead th {
background-color: #369;
color: #fff;
}
th,td {
padding: 0.1em 0.5em;
}
tr:hover {
background-color: #def;
}
</style>
</head>
<body>
<h1>Pure-FTPd server status</h1>
<div id="ftp-status">
<table summary="Pure-FTPd server status">
<thead>
<tr>
<th scope="col">PID</th>
<th scope="col">Account</th>
<th scope="col">Time</th>
<th scope="col">State</th>
<th scope="col" abbr="File">File name</th>
<th scope="col" abbr="Peer">Remote host</th>
<th scope="col" abbr="Kb">Kbytes</th>
<th scope="col" abbr="Local">Local host</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">18365</th>
<td>glinux</td>
<td>00:01</td>
<td>IDLE</td>
<td> </td>
<td>localhost.localdomain</td>
<td> </td>
<td>localhost.localdomain:21</td>
</tr>
</tbody>
</table>
</div>
</body>
</html> |
Et voici le résultat sur le navigateur:

Comment faire ?
Car je dois chaque fois tapper la commande sur le shell et ensuite me dirigez vers la page pour afficher le résultat et j'aimerais que ça se fasse automatiquement dés que je vais sur http://localhost/traffic_ftp.html ou http://localhost/script_traffic.cgi
Partager