root@sandbox:/var/log# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
10.0.8.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.10.0 10.0.8.1 255.255.255.0 UG 0 0 0 tun0
root@sandbox:/var/log# ping 192.168.10.2
PING 192.168.10.2 (192.168.10.2) 56(84) bytes of data.
64 bytes from 192.168.10.2: icmp_seq=1 ttl=64 time=80.1 ms
^C
--- 192.168.10.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 80.199/80.199/80.199/0.000 ms
root@sandbox:/var/log#
fastcgi_param SSL_SDN $ssl_client_s_dn;
fastcgi_param SSL_VERIFY $ssl_client_verify;
fastcgi_param SSL_SERIAL $ssl_client_serial;
set $SSL_SDN_CN "";
if ( $ssl_client_s_dn ~ /CN=(?<CN>[^\/]+)$ ) {
add_header X-SSL-Client-S-CN $1;
add_header X-SSL-Client-Serial $ssl_client_serial;
add_header X-SSL-Client-Verify $ssl_client_verify;
add_header X-SSL-Client-S-DN $ssl_client_s_dn;
set $SSL_SDN_CN $1;
}
fastcgi_param SSL_SDN_CN $SSL_SDN_CN;
А то что я получил ssl_certificate и ssl_certificate_key с let's encrypt с помощью ispmanager может мешать работе?
openssl rsa -in /var/www/httpd-cert/user/domain.ru_le1.key -out /var/www/httpd-cert/user/domain.ru_le1.nopass.key
protected function ReadPHP()
{
$site = Info::me();
if (file_exists("{$site->vars['error_log']}/php.log"))
{
$handle = @fopen("{$site->vars['error_log']}/php.log","rb");
}
$errors = Array();
if ($handle)
{
while (!feof($handle)) {
$error = json_decode ( fgets($handle), true);
if ($error)
{
$errors[] = $error;
}
}
fclose($handle);
}
$this->setVar('errors',$errors);
return $this;
}
<style>
.codeError {padding: 10px; background-color: white; position: absolute; float: left; top: 0; left: 0; width: 100%; margin: 0; }
.codeError table {border: 0; margin: 0; padding: 0; float: left; }
.codeError td {text-align: left; font: 10px Verdana; vertical-align: top; white-space: nowrap; margin: 0; padding: 0; border: none !important; background: none !important;}
.codeError .stack {border: 0; margin: 0; padding: 0;}
.codeError .stack td {color: #006600; border: 0; margin: 0; padding: 0 15px 0 0; vertical-align: top; }
.codeError .file td {color: #808080; }
.codeError .file .current {color: crimson; }
.codeError .dberror {font: 11px Courier New; color: crimson; vertical-align: top; margin: 0; padding: 0;}
</style>
<?php
if (count($errors)) {
foreach ($errors as $error)
{
?>
<div class="codeError" style="position: static !important; float: none !important;">
<table style="position: static !important; float: none !important;">
<tr>
<td><strong>error level: </strong> </td>
<td><?=$error['error_level']?></td>
</tr>
<tr>
<td><strong>error date: </strong> </td>
<td><?=DateUtils::getFormatDate("d F, Y, H:i",$error['error_date'])?> (<?=DateUtils::interval($error['error_date'])?>)</td>
</tr>
<tr>
<td><strong>error message: </strong> </td>
<td><?=$error['error_message']?></td>
</tr>
<tr>
<td><strong>error in file: </strong> </td>
<td><?=$error['error_file']?></td>
</tr>
<tr>
<td><strong></strong> </td>
<td>
<table>
<tr>
<td><strong>line <?=$error['error_line']?>:</strong> </td>
<td><?=$error['error_string']?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><strong>context: </strong> </td>
<td>
<table class="file">
<tr>
<td><strong>...</strong></td>
<td></td>
</tr>
<?php
foreach ($error['context'] as $context)
{
?>
<tr>
<td<?php echo ($context['current']?' class="current"':'')?>><strong><?=$context['line']?>:</strong> </td>
<td style="white-space:pre;"<?php echo ($context['current']?' class="current"':'')?>><?=htmlentities($context['buffer'])?></td>
</tr>
<?php
}
?>
<tr>
<td><strong>...</strong></td>
<td></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><strong>code stack: </strong> </td>
<td>
<table class="stack" cellpadding="0" cellspacing="0">
<?php
foreach ($error['stack'] as $stack)
{
?>
<tr>
<td valign="top"><?=$stack['file']?></td>
<td><?=$stack['line']?></td>
<td><?=$stack['function']?></td>
</tr>
<?php
}
?>
</table>
</td>
</tr>
<tr>
<td><strong>useragent: </strong> </td>
<td><?=urldecode($error['useragent'])?></td>
</tr>
<tr>
<td><strong>error_url: </strong> </td>
<td><?=urldecode($error['error_url'])?></td>
</tr>
<tr>
<td><strong>referer: </strong> </td>
<td><?=urldecode($error['referer'])?></td>
</tr>
</table>
<hr size=1>
</div>
<?php
}
} else {
?>
<div align="center" class="bad"><strong>Ошибок не найдено!</strong></div>
<?php
}
?>
$filename = $_SERVER["DOCUMENT_ROOT"]."/temp/php.log";
error_reporting(E_ALL & ~E_NOTICE);
/*********************************************************************************
| Обработка ошибок |
*********************************************************************************/
function log_error($type, $message, $file, $line) {
log_exception( new ErrorException( $message, $type, $type, $file, $line ) );
return true;
}
function log_exception($e)
{
static $errortype = array
(
0 => 'Exception',
E_ERROR => 'Error',
E_WARNING => 'Warning',
E_PARSE => 'Parsing Error',
E_NOTICE => 'Notice',
E_CORE_ERROR => 'Core Error',
E_CORE_WARNING => 'Core Warning',
E_COMPILE_ERROR => 'Compile Error',
E_COMPILE_WARNING => 'Compile Warning',
E_USER_ERROR => 'User Error',
E_USER_WARNING => 'User Warning',
E_USER_NOTICE => 'User Notice',
E_STRICT => 'Runtime Notice',
E_DEPRECATED => 'Deprecated',
E_USER_DEPRECATED => 'User Deprecated',
E_RECOVERABLE_ERROR => 'Catchable Fatal Error'
);
if ($e->getCode() == E_NOTICE) {
return;
}
$error = array();
$file = str_replace("\\","/",$e->getFile());
$file = str_replace($_SERVER["DOCUMENT_ROOT"],'',$file);
$error['error_level'] = $errortype[$e->getCode()];
$error['error_file'] = $file;
$error['error_line'] = $e->getLine();
$error['error_message'] = str_replace($_SERVER["DOCUMENT_ROOT"],'',$e->getMessage());
$error['referer'] = $_SERVER['HTTP_REFERER'];
$error['useragent'] = $_SERVER['HTTP_USER_AGENT'];
$error['error_url'] = ($_SERVER["SERVER_PORT"] == 443 ? "https" : "http" )."://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$error['error_date'] = time();
//--------------------------------
// Error Parsing
$start = $e->getLine() - 4;
$stop = $e->getLine() + 4;
$line = 1;
$i = 0;
$fh = fopen($e->getFile(),"r");
while (!feof($fh))
{
$buffer = fgets($fh, 4096);
if ($line >= $start and $line <=$stop)
{
$buffer = preg_replace("/\t/"," ",$buffer);
$error['context'][$i]['line'] = $line;
$error['context'][$i]['buffer'] = $buffer;
$error['context'][$i]['current'] = ($line == $e->getLine() ? true : false);
$i++;
}
$line++;
}
fclose($fh);
//--------------------------------
// Back trace
//array_shift($trace);
$i = 0;
$error['stack'] = array();
foreach ($e->getTrace() as $debug)
{
if ($debug['function'] != "log_error" && $debug['function'] != "check_for_fatal") {
$debug['file'] = str_replace("\\","/",$debug['file']);
$debug['file'] = str_replace($_SERVER["DOCUMENT_ROOT"],'',$debug['file']);
$error['stack'][$i]['file'] = $debug['file'];
$error['stack'][$i]['line'] = $debug['line'];
$error['stack'][$i]['function'] = $debug['function'];
$i++;
}
}
$file_data = json_encode($error)."\n";
$filename = $_SERVER["DOCUMENT_ROOT"]."/temp/php.log";
if (! file_exists($filename)) { @file_put_contents($filename, ''); }
$file_data .= @file_get_contents($filename);
@file_put_contents($filename, $file_data);
@chmod($filename,0666);
$header = (php_sapi_name() != 'cgi') ? 'HTTP/1.1 ' : 'HTTP/1.1: ';
header($header . '500 Internal Server Error', TRUE, 500);
print "<style>\n";
print ".codeError {padding: 30px 10px; background-color: white; position: absolute; float: left; width: 90%; z-index: 1000; }\n";
print ".codeError table {border: 0; margin: 0; padding: 0; }";
print ".codeError td {text-align: left; font: 10px Verdana; vertical-align: top; white-space: nowrap; margin: 0; padding: 0;}\n";
print ".codeError .stack {border: 0; margin: 0; padding: 0;} ";
print ".codeError .stack td {color: #006600; border: 0; margin: 0; padding: 0 15px 0 0; vertical-align: top; }\n";
print ".codeError .file td {color: #808080; }\n";
print ".codeError .file .current {color: crimson; }\n";
print ".codeError .dberror {font: 12px Courier New; color: crimson; vertical-align: top; margin: 0; padding: 0;}\n";
print "</style>";
print "<div class='codeError'> \n";
print "<table style='position: static !important; float: none !important;'> \n";
print " <tr> \n";
print " <td><strong>error level: </strong> </td> \n";
print " <td>{$error['error_level']}</td> \n";
print " </tr> \n";
print " <tr> \n";
print " <td><strong>error message: </strong> </td> \n";
print " <td>{$error['error_message']}</td> \n";
print " </tr> \n";
print " <tr> \n";
print " <td><strong>error in file: </strong> </td> \n";
print " <td>{$error['error_file']}</td> \n";
print " </tr> \n";
print " <tr> \n";
print " <td><strong></strong> </td> \n";
print " <td> \n";
print " <table> \n";
print " <tr> \n";
print " <td><strong>line {$error['error_line']}:</strong> </td> \n";
print " <td>{$error['error_string']}</td> \n";
print " </tr> \n";
print " </table> \n";
print " </td> \n";
print " </tr> \n";
print " <tr> \n";
print " <td><strong>context: </strong> </td> \n";
print " <td> \n";
print " <table class='file'> \n";
print " <tr> \n";
print " <td><strong>...</strong></td> \n";
print " <td></td> \n";
print " </tr> \n";
foreach ($error['context'] as $context)
{
print " <tr> \n";
print " <td" . ($context['current']?' class="current"':'')."><strong>{$context['line']}:</strong> </td> \n";
print " <td style='white-space: pre;' ".($context['current']?' class="current"':'').">".htmlentities($context['buffer'])."</td> \n";
print " </tr> \n";
}
print " <tr> \n";
print " <td><strong>...</strong></td> \n";
print " <td></td> \n";
print " </tr> \n";
print " </table> \n";
print " </td> \n";
print " </tr> \n";
if (count($error['stack'])) {
print " <tr> \n";
print " <td><strong>code stack: </strong> </td> \n";
print " <td> \n";
print " <table class='stack' cellpadding='0' cellspacing='0'> \n";
foreach ($error['stack'] as $stack)
{
print " <tr> \n";
print " <td valign='top'>{$stack['file']}</td> \n";
print " <td>{$stack['line']}</td> \n";
print " <td>{$stack['function']}</td> \n";
print " </tr> \n";
}
print " </table> \n";
print " </td> \n";
print " </tr> \n";
}
print " <tr> \n";
print " <td> </td> \n";
print " <td> </td> \n";
print " </tr> \n";
print " <tr> \n";
print " <td><strong>referer: </strong> </td> \n";
print " <td>".urldecode($error['referer'])."</td> \n";
print " </tr> \n";
print " <tr> \n";
print " <td><strong>error_url: </strong> </td> \n";
print " <td>".urldecode($error['error_url'])."</td> \n";
print " </tr> \n";
print "</table> \n";
print "<hr size=1> \n";
print "</div> \n";
exit();
}
function check_for_fatal()
{
$error = error_get_last();
switch ($error['type'])
{
case E_ERROR:
case E_CORE_ERROR:
case E_COMPILE_ERROR:
case E_USER_ERROR:
case E_RECOVERABLE_ERROR:
case E_CORE_WARNING:
case E_COMPILE_WARNING:
case E_PARSE:
log_error( $error['type'], $error['message'], $error['file'], $error['line']);
}
}
register_shutdown_function( "check_for_fatal" );
set_error_handler( "log_error" );
set_exception_handler( "log_exception" );
0. То есть 1 задача - 1 сообщение. Я думал через обменник можно раскидать по нескольким очередям и с каждой очереди ждать ACK.
1. В моем случае к очереди будет подключен только 1 консьюмер. Пока.
2. Тут я сам понять не могу. Везде в статьях и мануалах разные наименования и не понятно имеется в виду одно и тоже или же это разные вещи. Я про эту картинку и
3. Я точно знаю, что не нужен FANOUT, но пока не могу определиться для моего случая это будет TOPIC или DIRECT. Про пропускную способность в курсе. Но для данной задача она не первоочередная задача.