Commit a0914e83 authored by Cobra_Fast's avatar Cobra_Fast

Load page from external file. Add prettier page.

parent 097be316
<!DOCTYPE html>
<html>
<head>
<title>503 Service Unavailable</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
HTML, BODY { margin: 0; padding: 0; }
BODY { font-family: sans-serif; background: #eee; }
H1 { margin: 0; padding: 0; }
DIV.center { width: 45%; min-width: 600px; margin: 0 auto; background: #fff; padding: 2em; }
DIV.fr { float: right; font-size: 32px; margin-top: -4px; }
HR { border: 0; border-top: 2px solid #eee; margin: 2em -2em; }
P { font-size: 10pt; }
</style>
</head>
<body>
<div class="center">
<h1>503 Service Unavailable <div class="fr">🔧</div></h1>
<hr />
<p style="font-size: 12pt;">
Auf diesem Server werden Wartungsarbeiten durchgeführt. Bitte versuchen Sie es später erneut.
<br /><br />
This server is currently undergoing maintenance. Please try again at a later time.
</p>
<hr />
<p>
Zur Zeit darf aus technischen Gründen oder aus Gründen des Datenschutzes kein regulärer Web-Betrieb stattfinden.<br />
Diese Seite sehen Sie nur, wenn ein Techniker bereits am Problem arbeitet oder regelmäßige Wartungsarbeiten durchführt.
<br /><br />
Regular web-service must be interrupted for technical reasons or reasons of data protection at this time.<br />
You only see this page when an engineer is already working on the problem or is performing routine maintenance.
</p>
</div>
</body>
</html>
\ No newline at end of file
#!/usr/bin/env php
<?php
$str = '<!DOCTYPE html>
<html><head><title>503 Service Unavailable - Maintenance</title></head>
<body><h1>503 Service Unavailable</h1>
Server is under maintenance. Please try again later.</body></html>';
$str = file_get_contents('503.html');
$port = 80;
echo 'MaintHTTPd starting up on port ' . $port . '...' . "\n";
......@@ -23,7 +20,7 @@ while (true)
{
if (is_resource($conn = @stream_socket_accept($socket)))
{
fwrite($conn, "HTTP/1.1 503 Service unavailable\r\nContent-Type: text/html\r\nContent-Length: " . $strlen . "\r\n\r\n" . $str . "\r\n\r\n");
fwrite($conn, "HTTP/1.1 503 Service unavailable\r\nContent-Type: text/html; charset=utf-8\r\nContent-Length: " . $strlen . "\r\n\r\n" . $str . "\r\n\r\n");
fclose($conn);
echo "\r" . 'Served ' . ++$i . ' requests. (' . sprintf('%.2f', ($i/(time() - $start))) . '/s) ';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment