This repository has been archived by the owner on May 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.php
executable file
·85 lines (67 loc) · 2.32 KB
/
config.php
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
77
78
79
80
81
82
83
84
85
<?
/*
Configurazione del modulo mod_status di apache2
/etc/apache2/mod-enabled/status.conf:
<IfModule mod_status.c>
ExtendedStatus On
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>
</IfModule>
*/
require_once('easyblog/geoip.lib.php');
//define function geoip()
require_once('simple_html_dom.php');
//parser html
$domains = file('domains.conf', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
//domini dei virtual hosts
$defaultdom = $domains[0];
//dominio visualizzato di default
$myip = $_SERVER['SERVER_ADDR'];
//ip del server locale per escluderlo dagli accessi
$urlstatus = "http://127.0.0.1/server-status";
//indirizzo di mod_status di apache
$modes = array('_'=>'Waiting for Connection', 'S'=>'Starting up', 'R'=>'Reading Request',
'W'=>'Sending Reply', 'K'=>'Keepalive (read)', 'D'=>'DNS Lookup',
'C'=>'Closing connection', 'L'=>'Logging', 'G'=>'Gracefully finishing',
'I'=>'Idle cleanup of worker', '.'=>'Open slot with no current process');
$modes_short = array('_'=>'wait','S'=>'start','R'=>'read','W'=>'reply','K'=>'keepalive','D'=>'dns',
'C'=>'close','L'=>'log','G'=>'grace','I'=>'clean','.'=>'open');
function json_indent($json) {
$result = '';
$pos = 0;
$strLen = strlen($json);
$indentStr = ' ';
$newLine = "\n";
for($i = 0; $i <= $strLen; $i++) {
// Grab the next character in the string
$char = substr($json, $i, 1);
// If this character is the end of an element,
// output a new line and indent the next line
if($char == '}' || $char == ']') {
$result .= $newLine;
$pos --;
for ($j=0; $j<$pos; $j++) {
$result .= $indentStr;
}
}
// Add the character to the result string
$result .= $char;
// If the last character was the beginning of an element,
// output a new line and indent the next line
if ($char == ',' || $char == '{' || $char == '[') {
$result .= $newLine;
if ($char == '{' || $char == '[') {
$pos ++;
}
for ($j = 0; $j < $pos; $j++) {
$result .= $indentStr;
}
}
}
return $result;
}
?>