Commit ce6d678ac99d12903c095874031345ac778015a6
Committed by
Daniela Feitosa
1 parent
afb05ea7
Exists in
master
and in
22 other branches
Create a noosfero configuration file for varnish
Today the varnish-noosfero.vcl has only the basic backend configurations and the vcl_error routine to be compatible with the noosfero error page. In the future more noosfero configurations for varnish may be appended to this file. (ActionItem1877)
Showing
3 changed files
with
159 additions
and
5 deletions
Show diff stats
INSTALL.varnish
| @@ -50,14 +50,22 @@ apache-compatible format. You should change your statistics generation software | @@ -50,14 +50,22 @@ apache-compatible format. You should change your statistics generation software | ||
| 50 | 50 | ||
| 51 | # invoke-rc.d varnish restart | 51 | # invoke-rc.d varnish restart |
| 52 | 52 | ||
| 53 | -6) Configure varnish to store separate caches for each language | 53 | +6) Configure varnish to fit noosfero |
| 54 | +(assuming Noosfero is installed in /var/lib/noosfero) | ||
| 54 | 55 | ||
| 55 | -6a) Add the following line to your /etc/varnish/default.vcl file (assuming | ||
| 56 | -Noosfero is installed in /var/lib/noosfero): | 56 | +6a) Configure noosfero specific rotines to varnish |
| 57 | + | ||
| 58 | +Add the following line to your /etc/varnish/default.vcl file: | ||
| 59 | + | ||
| 60 | + include "/var/lib/noosfero/etc/noosfero/varnish-noosfero.vcl"; | ||
| 61 | + | ||
| 62 | +6b) Configure varnish to store separate caches for each language | ||
| 63 | + | ||
| 64 | +Add the following line to your /etc/varnish/default.vcl file: | ||
| 57 | 65 | ||
| 58 | include "/var/lib/noosfero/etc/noosfero/varnish-accept-language.vcl"; | 66 | include "/var/lib/noosfero/etc/noosfero/varnish-accept-language.vcl"; |
| 59 | 67 | ||
| 60 | -6b) Restart Varnish | 68 | +8) Restart Varnish |
| 61 | 69 | ||
| 62 | # invoke-rc.d varnish restart | 70 | # invoke-rc.d varnish restart |
| 63 | 71 |
| @@ -0,0 +1,137 @@ | @@ -0,0 +1,137 @@ | ||
| 1 | + | ||
| 2 | +backend default { | ||
| 3 | + .host = "127.0.0.1"; | ||
| 4 | + .port = "8080"; | ||
| 5 | +} | ||
| 6 | + | ||
| 7 | +sub vcl_error { | ||
| 8 | + set obj.http.Content-Type = "text/html; charset=utf-8"; | ||
| 9 | + | ||
| 10 | + synthetic {" | ||
| 11 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
| 12 | +<html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 13 | + <head> | ||
| 14 | + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | ||
| 15 | + <meta http-equiv="refresh" content="60"/> | ||
| 16 | + <title>Technical problems</title> | ||
| 17 | + <link rel="stylesheet" type="text/css" href="/designs/themes/default/errors.css"/> | ||
| 18 | + <link rel="shortcut icon" href='/designs/themes/default/favicon.ico' type="image/x-icon" /> | ||
| 19 | + <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js'></script> | ||
| 20 | + <script type='text/javascript'> | ||
| 21 | + function display_error_message(language) { | ||
| 22 | + if (!language) { | ||
| 23 | + var language = ((navigator.language) ? navigator.language : navigator.userLanguage).replace('-', '_'); | ||
| 24 | + } | ||
| 25 | + element = $(language); | ||
| 26 | + if (!element) { | ||
| 27 | + element = $(language.replace(/_.*$/, '')); | ||
| 28 | + } | ||
| 29 | + if (!element) { | ||
| 30 | + element = $('en'); | ||
| 31 | + } | ||
| 32 | + $$('.message').each(function(item) { item.hide() }); | ||
| 33 | + element.getElementsBySelector('h1').each(function(title) { document.title = title.innerHTML; }); | ||
| 34 | + element.show(); | ||
| 35 | + } | ||
| 36 | + </script> | ||
| 37 | +</head> | ||
| 38 | +<body onload='display_error_message()'> | ||
| 39 | + <div id='wrap'> | ||
| 40 | + <div id='header'> | ||
| 41 | + <div id='logo'> </div> | ||
| 42 | + <div id='details'><b>"} obj.status "</b> - " obj.response {"</div> | ||
| 43 | + </div> | ||
| 44 | + | ||
| 45 | + <div id='de' style='display: none' class='message'> | ||
| 46 | + <h1>Kurzzeitiges Systemproblem</h1> | ||
| 47 | + <p> | ||
| 48 | + Unser technisches Team arbeitet gerade daran, bitte probieren Sie es nachher erneut. Wir entschuldigen uns für die Unannehmlichkeiten. | ||
| 49 | + </p> | ||
| 50 | + <ul> | ||
| 51 | + <li><a href='javascript: history.back()'>Zurück</a></li> | ||
| 52 | + <li><a href='/'>Gehe zur Homepage</a></li> | ||
| 53 | + </ul> | ||
| 54 | + </div> | ||
| 55 | + | ||
| 56 | + <div id='en' style='display: none' class='message'> | ||
| 57 | + <h1>Temporary system problem</h1> | ||
| 58 | + <p> | ||
| 59 | + Our technical team is working on it, please try again later. Sorry for the inconvenience. | ||
| 60 | + </p> | ||
| 61 | + <ul> | ||
| 62 | + <li><a href='javascript: history.back()'>Go back</a></li> | ||
| 63 | + <li><a href='/'>Go to the site home page</a></li> | ||
| 64 | + </ul> | ||
| 65 | + </div> | ||
| 66 | + | ||
| 67 | + <div id='es' style='display: none' class='message'> | ||
| 68 | + <h1>Temporary system problem</h1> | ||
| 69 | + <p> | ||
| 70 | + Our technical team is working on it, please try again later. Sorry for the inconvenience. | ||
| 71 | + </p> | ||
| 72 | + <ul> | ||
| 73 | + <li><a href='javascript: history.back()'>Go back</a></li> | ||
| 74 | + <li><a href='/'>Go to the site home page</a></li> | ||
| 75 | + </ul> | ||
| 76 | + </div> | ||
| 77 | + | ||
| 78 | + <div id='fr' style='display: none' class='message'> | ||
| 79 | + <h1>Problème temporaire du système.</h1> | ||
| 80 | + <p> | ||
| 81 | + Notre équipe technique est en train d'y travailler. Merci de réessayer plus tard. Nous sommes désolés de la gêne occasionnée. | ||
| 82 | + </p> | ||
| 83 | + <ul> | ||
| 84 | + <li><a href='javascript: history.back()'>Retour</a></li> | ||
| 85 | + <li><a href='/'>Aller à la page d'accueil du site</a></li> | ||
| 86 | + </ul> | ||
| 87 | + </div> | ||
| 88 | + | ||
| 89 | + <div id='hy' style='display: none' class='message'> | ||
| 90 | + <h1>Temporary system problem</h1> | ||
| 91 | + <p> | ||
| 92 | + Our technical team is working on it, please try again later. Sorry for the inconvenience. | ||
| 93 | + </p> | ||
| 94 | + <ul> | ||
| 95 | + <li><a href='javascript: history.back()'>Վերադառնալ</a></li> | ||
| 96 | + <li><a href='/'>Go to the site home page</a></li> | ||
| 97 | + </ul> | ||
| 98 | + </div> | ||
| 99 | + | ||
| 100 | + <div id='pt' style='display: none' class='message'> | ||
| 101 | + <h1>Problema temporário no sistema</h1> | ||
| 102 | + <p> | ||
| 103 | + Nossa equipe técnica está trabalhando nele, por favor tente mais tarde. Perdoe o incoveniente. | ||
| 104 | + </p> | ||
| 105 | + <ul> | ||
| 106 | + <li><a href='javascript: history.back()'>Voltar</a></li> | ||
| 107 | + <li><a href='/'>Ir para a página inicial do site.</a></li> | ||
| 108 | + </ul> | ||
| 109 | + </div> | ||
| 110 | + | ||
| 111 | + <div id='ru' style='display: none' class='message'> | ||
| 112 | + <h1>Временная ошибка системы</h1> | ||
| 113 | + <p> | ||
| 114 | + Техники уже работают над проблемой, пожалуйста, попробуйте позже. | ||
| 115 | + </p> | ||
| 116 | + <ul> | ||
| 117 | + <li><a href='javascript:history.back()'>Назад</a></li> | ||
| 118 | + <li><a href='/'>Перейти на домашнюю страницу сайта</a></li> | ||
| 119 | + </ul> | ||
| 120 | + </div> | ||
| 121 | + | ||
| 122 | + <div id='languages'> | ||
| 123 | + <a href="javascript: display_error_message('de')">Deutsch</a> | ||
| 124 | + <a href="javascript: display_error_message('en')">English</a> | ||
| 125 | + <a href="javascript: display_error_message('es')">Español</a> | ||
| 126 | + <a href="javascript: display_error_message('fr')">Français</a> | ||
| 127 | + <a href="javascript: display_error_message('hy')">հայերեն լեզու</a> | ||
| 128 | + <a href="javascript: display_error_message('pt')">Português</a> | ||
| 129 | + <a href="javascript: display_error_message('ru')">русский язык</a> | ||
| 130 | + </div> | ||
| 131 | + | ||
| 132 | + </div> | ||
| 133 | +</body> | ||
| 134 | +</html> | ||
| 135 | + "}; | ||
| 136 | + return(deliver); | ||
| 137 | +} |
public/designs/themes/base/errors.css
| @@ -19,17 +19,26 @@ body { | @@ -19,17 +19,26 @@ body { | ||
| 19 | background: #ccc url(imgs/menu-top-bg-right.png) top right no-repeat; | 19 | background: #ccc url(imgs/menu-top-bg-right.png) top right no-repeat; |
| 20 | height: 42px; | 20 | height: 42px; |
| 21 | margin-top: 48px; | 21 | margin-top: 48px; |
| 22 | + position: relative; | ||
| 22 | } | 23 | } |
| 23 | 24 | ||
| 24 | #logo { | 25 | #logo { |
| 25 | background: url(imgs/menu-top-bg-left.png) 0px 29px no-repeat; | 26 | background: url(imgs/menu-top-bg-left.png) 0px 29px no-repeat; |
| 26 | position: absolute; | 27 | position: absolute; |
| 27 | - top: 40px; | 28 | + top: -29px; |
| 28 | height: 92px; | 29 | height: 92px; |
| 29 | width: 400px; | 30 | width: 400px; |
| 30 | z-index: 2; | 31 | z-index: 2; |
| 31 | } | 32 | } |
| 32 | 33 | ||
| 34 | +#details { | ||
| 35 | + position: absolute; | ||
| 36 | + bottom: 1px; | ||
| 37 | + right: 13px; | ||
| 38 | + color: #EEE; | ||
| 39 | + Xtext-shadow: 1px 1px 1px #fff; | ||
| 40 | +} | ||
| 41 | + | ||
| 33 | .message, | 42 | .message, |
| 34 | #languages { | 43 | #languages { |
| 35 | margin: 0px 20px; | 44 | margin: 0px 20px; |