Added custom 502 page and restart script

Temporary fix for the crash problem.
This commit is contained in:
Simon Brooke 2018-09-23 08:54:14 +01:00
parent bee88f502d
commit af7a8f7c25
3 changed files with 91 additions and 2 deletions

View file

@ -0,0 +1,73 @@
<!DOCTYPE html>
<html>
<head>
<!-- a page which can be served as static (by nginx) if Tomcat has crashed -->
<!-- head: if you want entire custom head content, override this block. -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="referrer" content="same-origin">
<link href="../css/yyy-common.css" rel="stylesheet" type="text/css" />
<link href="../css/yyy-site.css" rel="stylesheet" type="text/css" />
<link href="https://fonts.googleapis.com/css?family=Archivo+Black|Archivo+Narrow" rel="stylesheet"/>
<title>Project Hope: 502 Bad Gateway</title>
<!-- extra-head: put any additional markup to go into the head of your document into this block -->
<!-- e.g. script tags, link tags -->
</head>
<body>
<!-- whole-page: if you want an entire custom page layout, override this block. -->
<header>
<h1>Sorry, we have a problem</h1>
</header>
<div id="main-container" class="container">
<div id="content">
<div class="container-fluid">
<div class="row-fluid">
<div class="col-lg-12">
<div class="centering text-center">
<div class="text-center">
<h2><span class="text-danger">Error: 502 Bad Gateway</span></h2>
<p>
We are suffering an intermittent problem causing an occasional crash of
the Project Hope canvassing application. We apologise for this, and are
working on a permanent fix.
</p>
<p>
The application will restart automatically
within five minutes, please take a short break.
</p>
<hr>
</div>
</div>
</div>
</div>
</div>
</div>
<br clear="both"/>
</div>
<!-- foot: override this block if you don't want the standard footer -->
<footer>
<div id="credits">
<div>
<img height="16" width="16" alt="Clojure" src="/img/credits/luminus-logo.png"/>Built with <a href="http://www.luminusweb.net/">LuminusWeb</a> ||
<img height="16" width="16" alt="Clojure" src="/img/credits/clojure-icon.gif"/> Powered by <a href="http://clojure.org">Clojure</a> ||
<img height="16" width="16" alt="GitHub" src="/img/credits/github-logo-transparent.png"/>Find me/fork me on <a href="https://github.com/simon-brooke/youyesyet">Github</a> ||
<img height="16" width="16" alt="Free Software Foundation" src="/img/credits/gnu.small.png"/>Licensed under the <a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU General Public License version 2.0</a>
</div>
</div>
</footer>
</body>
</html>

View file

@ -74,12 +74,12 @@
<!-- foot: override this block if you don't want the standard footer -->
<footer>
<div id="credits">
<div>
<!-- div>
<img src="{{servlet-context}}/img/credits/ric-logo.png" width="24" height="24"/>
A project of the
<a href="https://radical.scot/">Radical Independence Campaign</a> ||
Version {{version}}
</div>
</div -->
<div>
<img height="16" width="16" alt="Clojure" src="{{servlet-context}}/img/credits/luminus-logo.png"/>Built with <a href="http://www.luminusweb.net/">LuminusWeb</a> ||
<img height="16" width="16" alt="Clojure" src="{{servlet-context}}/img/credits/clojure-icon.gif"/> Powered by <a href="http://clojure.org">Clojure</a> ||

16
tomcat-restart.sh Normal file
View file

@ -0,0 +1,16 @@
#!/bin/bash
# There's a problem with YouYesYet which causes Tomcat to fall over
# from time to time; it needs fixed. This is a temporary stopgap
# simon, 20180918
wget -S https://www.projecthope.scot 2>&1 | grep 'HTTP/1.1 5'
if [ "$?" = "0" ]
then
header=`wget -S https://www.projecthope.scot 2>&1 | grep 'HTTP/1.1 5'`
timestamp=`date`
echo "${timestamp} : ${header} : Restarting Tomcat"
service tomcat8 restart
fi