index.php

Home » projects » shana server » index.php
shana server Nessun commento

Per accedere ai servizi userò un’interfaccia web in php; come template di base userò bootstrap un framework sviluppato da twitter che integra già diversi css e java-script. Inoltre userò l’interfaccia anche come monitor di sistema delle funzionalità di base in attesa di installare nagios.

Le caratteristiche da tenere in osservazione sono

  • Server uptime, l’intenzione è di non doverlo riavviare
  • CPU load
  • RAM load
  • Hard-disk usage
  • Hard-disk temperature
  • Download, attuale e totale
  • Upload, attuale e totale

Apache2 una volta installato cerca il file index.html come pagina di default; nelle precedenti versioni di apache si modificava il file httpd.conf inserendo alla voce DirectoryIndex la sequenza di file in base alla priorità ad esempio:

[code]DirectoryIndex index.html index.htm index.php[/code]

In apache2 il file da modificare è /etc/apache2/mods-enabled/dir.conf che si presenta così:

[code]<IfModule mod_dir.c>

DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm

</IfModule>[/code]

che modifichiamo nel seguente spostando index.php prima di tutti gli altri

[code]<IfModule mod_dir.c>

DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm

</IfModule>[/code]

Infine riavviamo il servizio apache

[code]service apache2 restart[/code]

[php]

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="A simple interface for Media Server">
<meta name="author" content="Bl4cKd00M">

<title>shana media server</title>

<!– Bootstrap core CSS –>
<link href="css/bootstrap.min.css" rel="stylesheet">

<!– Custom styles for this template –>
<link href="css/cover.css" rel="stylesheet">

<!– Just for debugging purposes. Don’t actually copy this line! –>
<!–[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]–>

<!– HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries –>
<!–[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]–>
<?php
include ‘function.php’;
?>
</head>

<body>

<div class="site-wrapper">

<div class="site-wrapper-inner">

<div class="cover-container">

<div class="masthead clearfix">
<div class="inner">
<h3 class="masthead-brand">shana</h3>
<ul class="nav masthead-nav">
<li class="active"><a href="http://<code class="plain plain">NAME.HOMEPC.IT</code>/index.php">Home</a></li>
<li><a href="http://<code class="plain plain">NAME.HOMEPC.IT</code>:9091">Transmission</a></li>
<li><a href="/owncloud/">owncloud</a></li>
</ul>
</div>
</div>

<div class="inner cover">
<p class="lead">
<table class="table table-condensed">
<tr>
<td><span class="glyphicon glyphicon-time"></span> Server uptime:</td>
<td><?php get_uptime(); ?></td>
</tr>
<tr>
<td><span class="glyphicon glyphicon-stats"></span> CPU load:</td>
<td></td>
</tr>
<tr>
<td><span class="glyphicon glyphicon-tasks"></span> RAM load:</td>
<td><?php echo get_memory(); ?>% of 1 GiB</td>
</tr>
<tr>
<td><span class="glyphicon glyphicon-hdd"></span> Hard-disk usage:</td>
<td><?php echo get_hdd(); ?> of 500.0 GiB</td>
</tr>
<tr>
<td><span class="glyphicon glyphicon-fire"></span> Hard-disk temperature:</td>
<td><?php echo get_hddtemp(); ?></td>
</tr>
<tr>
<td><span class="glyphicon glyphicon-cloud-download"></span> Download:
</td>
<td></td>
</tr>
<tr>
<td><span class="glyphicon glyphicon-cloud-upload"></span> Upload:</td>
<td></td>
</tr>

</table>
</p>
</div>

<div class="mastfoot">
<div class="inner">
<p>Cover template for <a href="http://getbootstrap.com">Bootstrap</a>, by <a href="mailto:[email protected]">Bl4cKd00M’s</a>.</p>
</div>
</div>

</div>

</div>

</div>

<!– Bootstrap core JavaScript
================================================== –>
<!– Placed at the end of the document so the pages load faster –>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/docs.min.js"></script>
</body>
</html>[/php]

LEAVE A COMMENT