You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

142 lines
7.1 KiB
HTML

4 years ago
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tasks of the Contingent Librarian</title>
<link rel="stylesheet" type="text/css" href="tasks.css">
<script src="tasks.js"></script>
</head>
<body>
<div class="cardback"><DOCUMENT_FRAGMENT><div class="mw-parser-output"><div class="thumb tright"><div class="thumbinner" style="width:152px;"><a class="image" href="https://pzwiki.wdka.nl/mw-mediadesign/images/thumb/c/c2/Amateur_librarian.jpeg/640px-Amateur_librarian.jpeg"><img alt="" class="thumbimage" decoding="async" src="https://pzwiki.wdka.nl/mw-mediadesign/images/thumb/c/c2/Amateur_librarian.jpeg/320px-Amateur_librarian.jpeg"></a> <div class="thumbcaption"><div class="magnify"><a class="internal" href="File:Amateur_librarian.jpeg.html" title="Enlarge"></a></div>Quote from <i>Why and How to Become an Amateur Librarian</i></div></div></div>
<p>Snippets:
</p>
<div class="toc" id="toc"><input class="toctogglecheckbox" id="toctogglecheckbox" role="button" style="display:none" type="checkbox"><div class="toctitle" dir="ltr" lang="en"><h2>Contents</h2><span class="toctogglespan"><label class="toctogglelabel" for="toctogglecheckbox"></label></span></div>
<ul>
<li class="toclevel-1"><a href="#nginx_configuration"><span class="tocnumber">1</span> <span class="toctext">nginx configuration</span></a></li>
<li class="toclevel-1"><a href="#nginx_service_file"><span class="tocnumber">2</span> <span class="toctext">nginx service file</span></a>
<ul>
<li class="toclevel-2"><a href="#On_Debian.2FUbuntu.2FRHEL.2FCentOS_Linux"><span class="tocnumber">2.1</span> <span class="toctext">On Debian/Ubuntu/RHEL/CentOS Linux</span></a></li>
<li class="toclevel-2"><a href="#If_nginx_is_compiled_and_installed_from_the_source_code"><span class="tocnumber">2.2</span> <span class="toctext">If nginx is compiled and installed from the source code</span></a></li>
</ul>
</li>
</ul>
</div>
<h1><span class="mw-headline" id="nginx_configuration">nginx configuration</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/mw-mediadesign/index.php?title=User:Simon/Trim4/prototypes/nginx_configuration&amp;action=edit&amp;section=T-1" title="Edit section: ">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
<p>nginx is a web server software that the bootleg library runs on. This configuration allows maximum uploads of 100mb:
</p>
<pre>server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
location /bootleglibrary {
auth_basic "ヽ(°〇°)ノ";
auth_basic_user_file /etc/nginx/htpasswd;
client_max_body_size 100M;
proxy_bind $server_addr;
proxy_pass http://127.0.0.1:20190;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Script-Name /bootleglibrary;
}
}
</pre>
<h1><span class="mw-headline" id="nginx_service_file">nginx service file</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/mw-mediadesign/index.php?title=User:Simon/Trim4/prototypes/nginx_configuration&amp;action=edit&amp;section=T-2" title="Edit section: ">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
<p>To enable, start, stop, or check the status of the nginx web server, a service file is needed. To create one in a systemd Linux distribution, make this file:
</p><p><code>/lib/systemd/system/nginx.service</code>
</p><p>with the following contents:
</p>
<pre># Stop dance for nginx
# =======================
#
# ExecStop sends SIGSTOP (graceful stop) to the nginx process.
# If, after 5s (--retry QUIT/5) nginx is still running, systemd takes control
# and sends SIGTERM (fast shutdown) to the main process.
# After another 5s (TimeoutStopSec=5), and if nginx is alive, systemd sends
# SIGKILL to all the remaining processes in the process group (KillMode=mixed).
#
# nginx signals reference doc:
# http://nginx.org/en/docs/control.html
#
[Unit]
Description=A high performance web server and a reverse proxy server
Documentation=man:nginx(8)
After=network.target nss-lookup.target
[Service]
Type=forking
PIDFile=/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t -q -g 'daemon on; master_process on;'
ExecStart=/usr/sbin/nginx -g 'daemon on; master_process on;'
ExecReload=/usr/sbin/nginx -g 'daemon on; master_process on;' -s reload
ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid
TimeoutStopSec=5
KillMode=mixed
[Install]
WantedBy=multi-user.target
</pre>
<p><br>
</p>
<h2><span id="On_Debian/Ubuntu/RHEL/CentOS_Linux"></span><span class="mw-headline" id="On_Debian.2FUbuntu.2FRHEL.2FCentOS_Linux">On Debian/Ubuntu/RHEL/CentOS Linux</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/mw-mediadesign/index.php?title=User:Simon/Trim4/prototypes/nginx_configuration&amp;action=edit&amp;section=T-3" title="Edit section: ">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<p>Use the following command:
<code># /etc/init.d/nginx restart</code>
</p><p>OR
</p><p><code># /etc/init.d/nginx reload</code>
</p><p>OR
</p><p><code># service nginx restart</code>
</p><p>OR
</p><p><code># service nginx reload</code>
</p><p>OR if you are using systemd based Linux distro:
</p><p><code>$ sudo systemctl restart nginx</code>
</p><p>OR
</p><p><code>$ sudo systemctl reload nginx</code>
</p><p>To view status:
</p><p><code># service nginx status</code>
</p><p>OR
</p><p><code>$ sudo systemctl status nginx</code>
</p><p>However, the recommend way is as follows. This should work with any Linux distributions or Unix-like operating systems:
</p><p><code># nginx -s reload</code>
</p><p>OR
</p><p><code># /path/to/full/nginx -s reload</code>
</p>
<h2><span class="mw-headline" id="If_nginx_is_compiled_and_installed_from_the_source_code">If nginx is compiled and installed from the source code</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/mw-mediadesign/index.php?title=User:Simon/Trim4/prototypes/nginx_configuration&amp;action=edit&amp;section=T-4" title="Edit section: ">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<p>If nginx binary is installed at /usr/local/nginx/sbin/nginx, enter:
</p><p><code># /usr/local/nginx/sbin/nginx -s reload</code>
</p>
<!--
NewPP limit report
Cached time: 20200616194254
Cache expiry: 86400
Dynamic content: false
CPU time usage: 0.014 seconds
Real time usage: 0.024 seconds
Preprocessor visited node count: 13/1000000
Preprocessor generated node count: 42/1000000
Postexpand include size: 1423/2097152 bytes
Template argument size: 0/2097152 bytes
Highest expansion depth: 2/40
Expensive parser function count: 0/100
Unstrip recursion depth: 0/20
Unstrip postexpand size: 1614/5000000 bytes
-->
<!--
Transclusion expansion time report (%,ms,calls,template)
100.00% 4.618 1 User:Simon/Trim4/prototypes/nginx_configuration
100.00% 4.618 1 -total
-->
<!-- Saved in parser cache with key wdka_mw_mediadesign-mw_:pcache:idhash:31693-0!canonical and timestamp 20200616194254 and revision id 173901
-->
</div></DOCUMENT_FRAGMENT></div>
</body>
</html>