fr33.info
https://wiki.fr33.info/
2024-03-19T06:12:46+00:00fr33.info
https://wiki.fr33.info/
https://wiki.fr33.info/ttps://wiki.fr33.info/lib/tpl/adoradark/images/favicon.icotext/html2024-01-18T20:59:34+00:00tkilla (tkilla@undisclosed.example.com)VPN
https://wiki.fr33.info/doku.php/linux/network/vpn
<h1 class="sectionedit1" id="vpn">VPN</h1>
<div class="level1">
</div>
<!-- EDIT{"target":"section","name":"VPN","hid":"vpn","codeblockOffset":0,"secid":1,"range":"1-20"} -->
<h2 class="sectionedit2" id="openvpn">openVPN</h2>
<div class="level2">
<p>
TBD
</p>
</div>
<!-- EDIT{"target":"section","name":"openVPN","hid":"openvpn","codeblockOffset":0,"secid":2,"range":"21-47"} -->
<h2 class="sectionedit3" id="headscaletailscale">Headscale / Tailscale</h2>
<div class="level2">
<p>
Headscale is the open source variant of Tailscale.
</p>
<p>
Install it on your Server: <a href="https://headscale.net/running-headscale-linux/" class="urlextern" target="_blank" title="https://headscale.net/running-headscale-linux/" rel="noopener">https://headscale.net/running-headscale-linux/</a>
</p>
<p>
Proxy it via nginx to get httpS. Nginx Example Config:
</p>
<pre class="code">map $http_upgrade $connection_upgrade {
default keep-alive;
'websocket' upgrade;
'' close;
}
server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name <YOUR DOMAIN>;
ssl_certificate /etc/letsencrypt/live/<YOUR DOMAIN>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<YOUR DOMAIN>/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
location / {
proxy_pass https://<HEADSCALE SERVER IP>:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $server_name;
proxy_redirect http:// https://;
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
}
} </pre>
<p>
Install Tailscale Client on your Clients: <a href="https://tailscale.com/download/linux" class="urlextern" target="_blank" title="https://tailscale.com/download/linux" rel="noopener">https://tailscale.com/download/linux</a>
</p>
<p>
Then run:
</p>
<pre class="code">tailscale up --login-server https://<YOUR DOMAIN></pre>
<p>
which will give you the server Add command in the browser. Mission complete :)
</p>
</div>
<!-- EDIT{"target":"section","name":"Headscale \/ Tailscale","hid":"headscaletailscale","codeblockOffset":0,"secid":3,"range":"48-6484"} -->
<h2 class="sectionedit4" id="tinc">tinc</h2>
<div class="level2">
<pre class="code">apt install tinc net-tools</pre>
<p>
Generate keys:
</p>
<pre class="code">tincd -n <netname> -K8192</pre>
<p>
Setup tinc.conf, tinc-up, tinc-down
</p>
<p>
Configure the /hosts/<hostname> file like:
</p>
<pre class="code">Address = <myip>
Port = 55555
Subnet = 10.5.0.xxx</pre>
<p>
Copy the generated hosts/<hostname> file to *all* other servers and get the other host files
</p>
<p>
Start tinc:
</p>
<pre class="code">tincd -n <netname> </pre>
<p>
For debugging, do not detach:
</p>
<pre class="code">tincd -n <netname> -D</pre>
<p>
Enable at boot via systemd
</p>
<pre class="code">systemctl enable tinc@vpnname</pre>
</div>
<!-- EDIT{"target":"section","name":"tinc","hid":"tinc","codeblockOffset":0,"secid":4,"range":"6485-"} -->text/html2023-12-03T14:06:01+00:00tkilla (tkilla@undisclosed.example.com)Backen
https://wiki.fr33.info/doku.php/food/rezepte/backen
<h1 class="sectionedit1" id="backen">Backen</h1>
<div class="level1">
</div>
<!-- EDIT{"target":"section","name":"Backen","hid":"backen","codeblockOffset":0,"secid":1,"range":"1-22"} -->
<h2 class="sectionedit2" id="schokotorte_ai_rezept">Schokotorte AI Rezept</h2>
<div class="level2">
</div>
<!-- EDIT{"target":"section","name":"Schokotorte AI Rezept","hid":"schokotorte_ai_rezept","codeblockOffset":0,"secid":2,"range":"23-57"} -->
<h3 class="sectionedit3" id="zutaten">Zutaten</h3>
<div class="level3">
<ul>
<li class="level1"><div class="li"> <strong>150g dunkle Schokolade</strong></div>
</li>
<li class="level1"><div class="li"> <strong>175g Butter oder fettige Margarine</strong></div>
</li>
<li class="level1"><div class="li"> <strong>70g Agavendicksaft</strong></div>
</li>
<li class="level1"><div class="li"> <strong>4 große Eier</strong> (getrennt)</div>
</li>
<li class="level1"><div class="li"> <strong>150g Mehl</strong></div>
</li>
<li class="level1"><div class="li"> <strong>30g Kakaopulver</strong></div>
</li>
<li class="level1"><div class="li"> <strong>1½ TL Backpulver</strong></div>
</li>
<li class="level1"><div class="li"> <strong>1 Prise Salz</strong></div>
</li>
<li class="level1"><div class="li"> <strong>100ml Sahne oder Vollmilch</strong></div>
</li>
<li class="level1"><div class="li"> Optional: <strong>1 TL Vanilleextrakt</strong></div>
</li>
</ul>
</div>
<!-- EDIT{"target":"section","name":"Zutaten","hid":"zutaten","codeblockOffset":0,"secid":3,"range":"58-372"} -->
<h3 class="sectionedit4" id="anleitung">Anleitung</h3>
<div class="level3">
<ol>
<li class="level1 node"><div class="li"> <strong>Vorbereitung</strong>:</div>
<ul>
<li class="level2"><div class="li"> Heizen Sie den Backofen auf 175°C (Umluft 155°C) vor.</div>
</li>
<li class="level2"><div class="li"> Fetten Sie eine 24 cm Springform ein oder legen Sie sie mit Backpapier aus.</div>
</li>
</ul>
</li>
</ol>
<ol>
<li class="level1"><div class="li"> <strong>Schritt 1</strong>: Schokolade und Margarine zusammen im Wasserbad oder bei niedriger Hitze in der Mikrowelle schmelzen. Beiseite stellen und etwas abkühlen lassen.</div>
</li>
</ol>
<ol>
<li class="level1"><div class="li"> <strong>Schritt 2</strong>: Eier trennen. Eiweiß in einer sauberen Schüssel zu festem Eischnee schlagen.</div>
</li>
</ol>
<ol>
<li class="level1"><div class="li"> <strong>Schritt 3</strong>: Eigelbe mit Agavendicksaft (und Vanilleextrakt, falls verwendet) und Sahne oder Milch schaumig schlagen.</div>
</li>
</ol>
<ol>
<li class="level1"><div class="li"> <strong>Schritt 4</strong>: Mehl, Kakaopulver, Backpulver und Salz in einer separaten Schüssel sieben und gut vermischen.</div>
</li>
</ol>
<ol>
<li class="level1"><div class="li"> <strong>Schritt 5</strong>: Geschmolzene Schokoladen-Margarine-Mischung vorsichtig unter die Eigelb-Sahne-Mischung heben. Dann die trockenen Zutaten hinzufügen und leicht unterheben. Zum Schluss den Eischnee vorsichtig unterheben, um die Luftigkeit zu bewahren.</div>
</li>
</ol>
<ol>
<li class="level1"><div class="li"> <strong>Schritt 6</strong>: Den Teig in die vorbereitete Form geben und im Backofen für etwa 30-35 Minuten backen. Stäbchenprobe durchführen, um sicherzustellen, dass der Kuchen durchgebacken ist.</div>
</li>
</ol>
<ol>
<li class="level1"><div class="li"> <strong>Schritt 7</strong>: Den Kuchen in der Form etwas abkühlen lassen, dann auf ein Kuchengitter stürzen und vollständig auskühlen lassen.</div>
</li>
</ol>
<ol>
<li class="level1"><div class="li"> <strong>Schritt 8</strong>: Nach Belieben mit Puderzucker bestäuben, mit Schokoladenglasur überziehen oder mit frischen Früchten garnieren.</div>
</li>
</ol>
</div>
<!-- EDIT{"target":"section","name":"Anleitung","hid":"anleitung","codeblockOffset":0,"secid":4,"range":"373-1784"} -->
<h3 class="sectionedit5" id="tipps">Tipps</h3>
<div class="level3">
<ul>
<li class="level1"><div class="li"> <strong>Margarine</strong>: Stellen Sie sicher, dass Sie eine Margarine mit hohem Fettgehalt verwenden, für eine optimale Kuchenstruktur.</div>
</li>
<li class="level1"><div class="li"> <strong>Sahne/Milch</strong>: Diese Zutaten machen den Kuchen feuchter und verbessern die Textur.</div>
</li>
<li class="level1"><div class="li"> <strong>Eischnee</strong>: Eischnee sorgt für eine luftige Kuchenstruktur.</div>
</li>
<li class="level1"><div class="li"> <strong>Unterheben</strong>: Seien Sie beim Unterheben der Zutaten vorsichtig, um die eingearbeitete Luft zu erhalten.</div>
</li>
</ul>
</div>
<!-- EDIT{"target":"section","name":"Tipps","hid":"tipps","codeblockOffset":0,"secid":5,"range":"1785-2198"} -->
<h2 class="sectionedit6" id="vegane_pfannkuchen_1_supersimpel">Vegane Pfannkuchen #1 supersimpel</h2>
<div class="level2">
<ul>
<li class="level1"><div class="li"> 500 ml Wasser oder Sojamilch</div>
</li>
<li class="level1"><div class="li"> 250 g Mehl, zur Hälfte zb. </div>
</li>
<li class="level1"><div class="li"> 1 Prise Salz</div>
</li>
<li class="level1"><div class="li"> 4 EL Zucker + evtl. 1 TL Vanillezucker für süße Pfannkuchen oder nur 1 TL Zucker für herzhafte Pfannkuchen</div>
</li>
<li class="level1"><div class="li"> Öl oder vegane Margarine</div>
</li>
</ul>
<p>
s.u.
</p>
</div>
<!-- EDIT{"target":"section","name":"Vegane Pfannkuchen #1 supersimpel","hid":"vegane_pfannkuchen_1_supersimpel","codeblockOffset":0,"secid":6,"range":"2199-2480"} -->
<h2 class="sectionedit7" id="pfannkuchen">Pfannkuchen</h2>
<div class="level2">
<ul>
<li class="level1"><div class="li"> 3 Eier</div>
</li>
<li class="level1"><div class="li"> 3 Prisen Salz</div>
</li>
<li class="level1"><div class="li"> 420ml Milch</div>
</li>
<li class="level1"><div class="li"> 240g Mehl</div>
</li>
<li class="level1"><div class="li"> Butter oder Öl</div>
</li>
</ul>
<p>
reicht dicke für 2 Personen als Hauptspeise.
</p>
<p>
Eier, Milch, Salz und Mehl mit einem Mixer vermischen. Öl in einer Pfanne erhitzen und eine Portion Teig hineingeben, so dass der Pfannenboden bedeckt ist. Wenn der Rand braun wird und alles nicht mehr flüssig ist: umdrehen. Kurz später ist der Pfannkuchen fertig.
</p>
</div>
<!-- EDIT{"target":"section","name":"Pfannkuchen","hid":"pfannkuchen","codeblockOffset":0,"secid":7,"range":"2481-2902"} -->
<h2 class="sectionedit8" id="eierkuchen_kk">Eierkuchen KK</h2>
<div class="level2">
<ul>
<li class="level1"><div class="li"> Einen halben lLiter Milch</div>
</li>
<li class="level1"><div class="li"> 3 Eier</div>
</li>
<li class="level1"><div class="li"> Vannelienzucker</div>
</li>
<li class="level1"><div class="li"> Zucker </div>
</li>
<li class="level1"><div class="li"> Mehl</div>
</li>
<li class="level1"><div class="li"> 1 TL Backpulver </div>
</li>
<li class="level1"><div class="li"> </div>
</li>
</ul>
<p>
Aus diesen Zutaten einen eher dünnflüssigen Teig rühren. In einer Pfanne mit Butter Pfannkuchen backen.
</p>
</div>
<!-- EDIT{"target":"section","name":"Eierkuchen KK","hid":"eierkuchen_kk","codeblockOffset":0,"secid":8,"range":"2903-3148"} -->
<h2 class="sectionedit9" id="reibekuchen">Reibekuchen</h2>
<div class="level2">
<ul>
<li class="level1"><div class="li"> </div>
</li>
<li class="level1"><div class="li"> 1 kg Kartoffeln</div>
</li>
<li class="level1"><div class="li"> 1 Ei</div>
</li>
<li class="level1"><div class="li"> Paniermehl</div>
</li>
<li class="level1"><div class="li"> 1 Zwiebel</div>
</li>
<li class="level1"><div class="li"> Öl</div>
</li>
<li class="level1"><div class="li"> 1 Teelöffel Salz</div>
</li>
</ul>
<p>
Kartoffeln und Zwiebel schälen und reiben. Alle Zutaten zufügen, am besten mit der Hand alles verrühren.
In heißem Öl Reibekuchen backen.
Dazu Apfelmus.
</p>
<p>
<br/>
</p>
</div>
<!-- EDIT{"target":"section","name":"Reibekuchen","hid":"reibekuchen","codeblockOffset":0,"secid":9,"range":"3149-3435"} -->
<h2 class="sectionedit10" id="kaesekuchen_-_new_york_cheesecake">Käsekuchen - New York Cheesecake</h2>
<div class="level2">
<p>
Boden:
</p>
<ul>
<li class="level1"><div class="li"> 200g Kekse</div>
</li>
<li class="level1"><div class="li"> 1 Teelöffel Honig </div>
</li>
<li class="level1"><div class="li"> 80g Butter</div>
</li>
</ul>
<p>
Füllung:
</p>
<ul>
<li class="level1"><div class="li"> 500g Philadelphia</div>
</li>
<li class="level1"><div class="li"> 350g Ricotta</div>
</li>
<li class="level1"><div class="li"> 170g Joghurt</div>
</li>
<li class="level1"><div class="li"> 2 Eier</div>
</li>
<li class="level1"><div class="li"> 40g Mehl oder Maisstärke</div>
</li>
<li class="level1"><div class="li"> 100g Zucker</div>
</li>
<li class="level1"><div class="li"> 1/2 Zitrone</div>
</li>
</ul>
<p>
18 -24 cm Springform
</p>
<p>
Butter und Honig in einem Topf schmelzen. Kekse klein hacken und in die Butter geben. Aus dem Gemisch einen Boden in der mit Backpapier ausgelegten Springform bauen. 1/2 Stunde im Kühlschrank aushärten lassen.
</p>
<p>
Alle Zutaten für die Füllung mixen und in die Springform geben.
</p>
<p>
1 Stunde und 20 Minuten bei 160 Grad backen, bis es ein wenig braun wird an derOberfläche (bei unserem Ofen 2 1/2 Stunden). Anschließend 5 Stunden kühlen. Pronto!
</p>
<ul>
<li class="level1"><div class="li"> v1: <a href="http://www.ricettedellanonna.net/new-york-cheesecake-cheesecake-classica-al-philadelphia/" class="urlextern" target="_blank" title="http://www.ricettedellanonna.net/new-york-cheesecake-cheesecake-classica-al-philadelphia/" rel="noopener">http://www.ricettedellanonna.net/new-york-cheesecake-cheesecake-classica-al-philadelphia/</a></div>
</li>
</ul>
</div>
<!-- EDIT{"target":"section","name":"K\u00e4sekuchen - New York Cheesecake","hid":"kaesekuchen_-_new_york_cheesecake","codeblockOffset":0,"secid":10,"range":"3436-"} -->text/html2023-04-14T20:16:16+00:00tkilla (tkilla@undisclosed.example.com)Nextcloud - [Collabora Setup]
https://wiki.fr33.info/doku.php/communitycloud/services/nextcloud
<h1 class="sectionedit1" id="nextcloud">Nextcloud</h1>
<div class="level1">
</div>
<!-- EDIT{"target":"section","name":"Nextcloud","hid":"nextcloud","codeblockOffset":0,"secid":1,"range":"1-25"} -->
<h2 class="sectionedit2" id="setup">Setup</h2>
<div class="level2">
<p>
<strong>Nextcloud config.php:</strong>
</p>
<p>
Caching with php-apcu and local memcached server:
</p>
<pre class="code">...
'default_language' => 'de',
'default_locale' => 'de_DE',
'default_phone_region' => 'DE',
'memcache.local' => '\\OC\\Memcache\\APCu',
'memcache.distributed' => '\\OC\\Memcache\\Memcached',
'memcached_servers' =>
array (
0 =>
array (
0 => 'localhost',
1 => 11211,
),
),
...</pre>
<p>
<strong>Cronjob:</strong>
</p>
<p>
Don't use AJAX cron, use system cron:
</p>
<ul>
<li class="level1"><div class="li">/5 * * * * <user> php -f /var/www/<domain>/cloud/wwwroot/cron.php</div>
</li>
</ul>
<p>
run Cron / OCC manually:
</p>
<pre class="code">sudo -u <user> php -f /var/www/<domain>/cloud/wwwroot/cron.php</pre>
</div>
<!-- EDIT{"target":"section","name":"Setup","hid":"setup","codeblockOffset":0,"secid":2,"range":"26-673"} -->
<h2 class="sectionedit3" id="collabora_setup">Collabora Setup</h2>
<div class="level2">
<p>
Collabora CODE replaces Onlyoffice and works like a Pad.
</p>
<p>
<strong>There are .deb Packages, use them!</strong> <a href="https://www.collaboraoffice.com/code/linux-packages/" class="urlextern" target="_blank" title="https://www.collaboraoffice.com/code/linux-packages/" rel="noopener">https://www.collaboraoffice.com/code/linux-packages/</a>
</p>
<ul>
<li class="level1"><div class="li"> NGINX is required as reverse proxy. Setup <a href="http://localhost:9980" class="urlextern" target="_blank" title="http://localhost:9980" rel="noopener">http://localhost:9980</a> …</div>
</li>
<li class="level1"><div class="li"> Create letsencrypt certs for your office.<domain> Subdomain and use httpS</div>
</li>
<li class="level1"><div class="li"> use <a href="httpS://office" class="urlextern" target="_blank" title="httpS://office" rel="noopener">httpS://office</a>.<domain> in the Collabora App Settings </div>
</li>
<li class="level1"><div class="li"> Setup SSL in /etc/loolwsd/loolwsd.xml: Browser SSL = false, termination = true!!</div>
</li>
</ul>
<ul>
<li class="level1"><div class="li"> In bullseye loolwsd was renamed to <strong>coolwd</strong> <img src="https://wiki.fr33.info/lib/images/smileys/icon_eek.gif" class="icon" alt="8-o" /></div>
</li>
</ul>
<p>
<br/>
</p>
<p>
<strong>/etc/loolwsd/loolwsd.xml Changes:</strong>
</p>
<pre class="code"><enable type="bool" desc="Controls whether SSL encryption between browser and loolwsd is enabled (do not disable for production deployment). If default is false, must first be compiled with SSL support to enable." default="true">false</enable></pre>
<pre class="code"><termination desc="Connection via proxy where loolwsd acts as working via https, but actually uses http." type="bool" default="true">true</termination></pre>
<p>
<strong> Also setting by commandline works (coolwsd in bullseye):</strong>
</p>
<pre class="code">loolconfig set ssl.enable false
loolconfig set ssl.termination true
loolconfig set storage.wopi.host nextcloud.example.com
loolconfig set-admin-password
systemctl status loolwsd</pre>
<p>
<br/>
<strong>Links:</strong>
</p>
<ul>
<li class="level1"><div class="li"> Config Tips: <a href="https://www.linuxbabe.com/ubuntu/integrate-collabora-onlinenextcloud-without-docker" class="urlextern" target="_blank" title="https://www.linuxbabe.com/ubuntu/integrate-collabora-onlinenextcloud-without-docker" rel="noopener">https://www.linuxbabe.com/ubuntu/integrate-collabora-onlinenextcloud-without-docker</a></div>
</li>
<li class="level1"><div class="li"> find the admin system here: https:<em> <…> /loleaflet/dist/admin/admin.html
* Example nginx conf: <a href="https://help.nextcloud.com/t/nginx-collabora-behind-nginx-reverse-proxy/77889" class="urlextern" target="_blank" title="https://help.nextcloud.com/t/nginx-collabora-behind-nginx-reverse-proxy/77889" rel="noopener">https://help.nextcloud.com/t/nginx-collabora-behind-nginx-reverse-proxy/77889</a>
</div>
</li>
</ul>
</div>
<!-- EDIT{"target":"section","name":"Collabora Setup","hid":"collabora_setup","codeblockOffset":0,"secid":3,"range":"674-"} -->text/html2023-03-25T10:58:57+00:00tkilla (tkilla@undisclosed.example.com)PHP - [Install PHP 7.4 in Debian Buster / SURY REPO]
https://wiki.fr33.info/doku.php/linux/webserver/php
<h1 class="sectionedit1" id="php">PHP</h1>
<div class="level1">
</div>
<!-- EDIT{"target":"section","name":"PHP","hid":"php","codeblockOffset":0,"secid":1,"range":"1-21"} -->
<h2 class="sectionedit2" id="php-fpm_setup">PHP-FPM Setup</h2>
<div class="level2">
<p>
Configure pools for each domain/vhost to separate the domains and run scripts as separte user. This works well with ssh-sftp setup.because scripts are owned by the same user as the sftp user - not www-data.
</p>
<p>
<strong>Pool per domain config:</strong>
</p>
<pre class="code">cd /etc/php5/fpm/pool.d/
cp www.conf {user1.conf,user2.conf}</pre>
<p>
replace all appearances of “www” in user.conf
</p>
<pre class="code">/etc/init.d/php-fpm restart</pre>
<p>
<strong>Add a user for each pool:</strong>
</p>
<p>
The username must be an exisiting user in the system. e.g.:
</p>
<pre class="code">adduser --disabled-login USERNAME
adduser www-data USERNAME
mkdir /var/www/USERNAME
chown -R USERNAME:USERNAME /var/www/USERNAME
chmod 750 /var/www/USERNAME</pre>
</div>
<!-- EDIT{"target":"section","name":"PHP-FPM Setup","hid":"php-fpm_setup","codeblockOffset":0,"secid":2,"range":"22-688"} -->
<h2 class="sectionedit3" id="nginx_php-fpm">nginx & PHP-FPM</h2>
<div class="level2">
<p>
PHP-FPM can run over a http connection or a unix socket. unix socket is faster.
</p>
<p>
<strong>vhost php config via unix socket:</strong>
</p>
<pre class="code">server {
...
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# replace USERNAME by system/php-fpm-pool user:
fastcgi_pass unix:/var/run/php5-fpm-USERNAME.sock;
}</pre>
</div>
<!-- EDIT{"target":"section","name":"nginx & PHP-FPM","hid":"nginx_php-fpm","codeblockOffset":0,"secid":3,"range":"689-1226"} -->
<h2 class="sectionedit4" id="php_modules">PHP Modules</h2>
<div class="level2">
<p>
Wordpress required:
</p>
<pre class="code"> apt install php-iconv php-exif php-memcached php-soap php-yaml php-imap php-markdown php-readline php-curl php-opcache php-zip php-dom php-mbstring php-imagick php-fileinfo php-json php-xml php-simplexml</pre>
</div>
<!-- EDIT{"target":"section","name":"PHP Modules","hid":"php_modules","codeblockOffset":0,"secid":4,"range":"1227-1483"} -->
<h2 class="sectionedit5" id="apache_php-fpm">Apache & PHP-FPM</h2>
<div class="level2">
<p>
Use php-fpm for better performance and better security: run each domain in its own “pool” - processes per user. This way you also have less permission problems with sftp.
</p>
<pre class="code">apt-get install apache2 libapache2-mod-fastcgi php5-fpm
a2enmod actions
cp /etc/apache2/mods-enabled/fastcgi.conf /etc/apache2/mods-enabled/fastcgi.conf.backup
mcedit /etc/apache2/mods-enabled/fastcgi.conf
<IfModule mod_fastcgi.c>
AddType application/x-httpd-fastphp5 .php
Action application/x-httpd-fastphp5 /php5-fcgi
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization
<Directory /usr/lib/cgi-bin>
Require all granted
</Directory>
</IfModule></pre>
<pre class="code">apache2ctl configtest
/etc/init.d/apache2 restart</pre>
<p>
check if a phpfpm “www” pool process is running
</p>
<p>
You need to edit your vhosts to use the new pool.
Replace USERNAME by the poolname you just created and VHOSTNAME by a dfifferent name in each vhost:
</p>
<pre class="code"><VirtualHost *:80>
...
<IfModule mod_fastcgi.c>
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi-${USERNAME}-VHOSTNAME
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi-${USERNAME}-VHOSTNAME -socket /var/run/php5-fpm-${USERNAME}.sock -pass-header Authorization
</IfModule>
...</pre>
<p>
Links:
</p>
<ul>
<li class="level1"><div class="li"> <a href="https://www.linode.com/docs/websites/apache/install-php-fpm-and-apache-on-debian-8" class="urlextern" target="_blank" title="https://www.linode.com/docs/websites/apache/install-php-fpm-and-apache-on-debian-8" rel="noopener">https://www.linode.com/docs/websites/apache/install-php-fpm-and-apache-on-debian-8</a></div>
</li>
<li class="level1"><div class="li"> <a href="http://www.dimitri.eu/php-fpm-apache-split-config-per-site/" class="urlextern" target="_blank" title="http://www.dimitri.eu/php-fpm-apache-split-config-per-site/" rel="noopener">http://www.dimitri.eu/php-fpm-apache-split-config-per-site/</a></div>
</li>
</ul>
</div>
<!-- EDIT{"target":"section","name":"Apache & PHP-FPM","hid":"apache_php-fpm","codeblockOffset":0,"secid":5,"range":"1484-3004"} -->
<h2 class="sectionedit6" id="performance">Performance</h2>
<div class="level2">
<p>
For PHP-FPM the same optimization as for default php modules apply.
</p>
</div>
<!-- EDIT{"target":"section","name":"Performance","hid":"performance","codeblockOffset":0,"secid":6,"range":"3005-3098"} -->
<h3 class="sectionedit7" id="configure_pool">Configure pool</h3>
<div class="level3">
<p>
These settings with initial pm.start_servers = 5 is quite good for a server with 32gb RAM and up to 20-30 sites. This starts 5 processes, which take up to php_admin_value[memory_limit] = 512M each, but usually around 100mb per process when running a small wordpress. So this pool always uses 5*100mb = 500mb and may required much more, if the site is busy and more servers are started.
</p>
<p>
On small servers, use pm = ondemand, which starts servers only when used. This is slower than pm = dynamic
</p>
<pre class="code">pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 2
pm.max_spare_servers = 5</pre>
<p>
High performance server with one busy site:
</p>
<pre class="code">pm = dynamic
pm.max_children = 50
pm.start_servers = 25
pm.min_spare_servers = 20
pm.max_spare_servers = 25</pre>
<p>
Test how much RAM your site needs. This is the max, not the regular used memory. Most sites run with ~100mb, but require more for special tasks.
</p>
<pre class="code">php_admin_value[memory_limit] = 512M </pre>
</div>
<!-- EDIT{"target":"section","name":"Configure pool","hid":"configure_pool","codeblockOffset":0,"secid":7,"range":"3099-4086"} -->
<h3 class="sectionedit8" id="php-fpm_status_page_in_console">PHP-FPM Status Page in Console</h3>
<div class="level3">
<pre class="code">apt-get install libfcgi0ldbl
SCRIPT_NAME=/status SCRIPT_FILENAME=/status QUERY_STRING= REQUEST_METHOD=GET cgi-fcgi -bind -connect /var/run/php5-fpm-$VHOSTNAME.sock</pre>
<ul>
<li class="level1"><div class="li"> <a href="https://www.thatsgeeky.com/2012/02/directly-connecting-to-php-fpm/" class="urlextern" target="_blank" title="https://www.thatsgeeky.com/2012/02/directly-connecting-to-php-fpm/" rel="noopener">https://www.thatsgeeky.com/2012/02/directly-connecting-to-php-fpm/</a></div>
</li>
</ul>
</div>
<!-- EDIT{"target":"section","name":"PHP-FPM Status Page in Console","hid":"php-fpm_status_page_in_console","codeblockOffset":0,"secid":8,"range":"4087-4374"} -->
<h3 class="sectionedit9" id="phpini_settings">php.ini settings</h3>
<div class="level3">
<ul>
<li class="level1"><div class="li"> zlib.output_compression = On # + test compression setting from 1-9</div>
</li>
<li class="level1"><div class="li"> short_tags = Off</div>
</li>
<li class="level1"><div class="li"> …</div>
</li>
</ul>
</div>
<!-- EDIT{"target":"section","name":"php.ini settings","hid":"phpini_settings","codeblockOffset":0,"secid":9,"range":"4375-4504"} -->
<h3 class="sectionedit10" id="opcache">Opcache</h3>
<div class="level3">
<p>
APC is deprecated and incompatible with latest php verions. Just use opache. Install, enable module and configure:
</p>
<p>
/etc/php5/mods-available/opcache.ini
</p>
<pre class="code">zend_extension=opcache.so
opcache.enable=1
; moooore cache:
opcache.memory_consumption=1024
opcache.max_accelerated_files=50000
; php script changes will appear after one minute, but this is faster than the default:
opcache.revalidate_freq=60
opcache.interned_strings_buffer=16</pre>
<pre class="code">; required for nextcloud / paypal sdk / ..:
opcache.save_comments=1
opcache.load_comments=1
opcache.validate_timestamps=1
opcache.consistency_checks=0
opcache.error_log=/var/log/php5-opcache.log
opcache.log_verbosity_level=1</pre>
</div>
<!-- EDIT{"target":"section","name":"Opcache","hid":"opcache","codeblockOffset":0,"secid":10,"range":"4505-5229"} -->
<h2 class="sectionedit11" id="hhvm">HHVM</h2>
<div class="level2">
<p>
rocks! It's much faster than PHP-FPM, but not considered completly stable. Setup is easy, debian packages are available somewhere.
</p>
<p>
in nginx vhost config, just disable the fpm block and include the included config in the vhost:
</p>
<pre class="code">include hhvm.conf;</pre>
</div>
<!-- EDIT{"target":"section","name":"HHVM","hid":"hhvm","codeblockOffset":0,"secid":11,"range":"5230-5500"} -->
<h2 class="sectionedit12" id="php5-fpm_and_php70_parallel_setup">PHP5-FPM and PHP7.0 parallel Setup</h2>
<div class="level2">
<p>
On debian jessie this works very well. Just install all php7.0 packages from backports.
</p>
</div>
<!-- EDIT{"target":"section","name":"PHP5-FPM and PHP7.0 parallel Setup","hid":"php5-fpm_and_php70_parallel_setup","codeblockOffset":0,"secid":12,"range":"5501-5637"} -->
<h3 class="sectionedit13" id="install_packages">Install packages:</h3>
<div class="level3">
<pre class="code"> apt-get install php7.0-mbstring php7.0-apcu php7.0-cli php7.0-common php7.0-curl php7.0-fpm php7.0-gd php7.0-imagick php7.0-imap php7.0-intl php7.0-json php7.0-mcrypt php7.0-memcache php7.0-memcached php7.0-mysqlnd php7.0-pspell php7.0-readline php7.0-recode php7.0-snmp php7.0-sqlite php7.0-tidy php7.0-xmlrpc php7.0-xsl
</pre>
</div>
<!-- EDIT{"target":"section","name":"Install packages:","hid":"install_packages","codeblockOffset":0,"secid":13,"range":"5638-5995"} -->
<h3 class="sectionedit14" id="check_which_version_is_the_default_now_and_adjust">Check which version is the default now and adjust:</h3>
<div class="level3">
<pre class="code">php -v
update-alternatives --co==== Headline ====</pre>
<p>
nfig php
</p>
</div>
<!-- EDIT{"target":"section","name":"Check which version is the default now and adjust:","hid":"check_which_version_is_the_default_now_and_adjust","codeblockOffset":0,"secid":14,"range":"5996-6121"} -->
<h3 class="sectionedit15" id="nginx_config_-_just_replace_the_socket">Nginx Config - just replace the socket:</h3>
<div class="level3">
<pre class="code">fastcgi_pass unix:/run/php/php7.0-fpm.sock;</pre>
<p>
fastcgi.conf, etc ~should~ be compatible
</p>
</div>
<!-- EDIT{"target":"section","name":"Nginx Config - just replace the socket:","hid":"nginx_config_-_just_replace_the_socket","codeblockOffset":0,"secid":15,"range":"6122-6261"} -->
<h3 class="sectionedit16" id="php70-fpm_config">PHP7.0-FPM Config:</h3>
<div class="level3">
<p>
edit or copy configs from php5:
</p>
<ul>
<li class="level1"><div class="li"> /etc/php/7.0/fpm/php-fpm.conf</div>
</li>
<li class="level1"><div class="li"> /etc/php/7.0/fpm/php.ini</div>
</li>
<li class="level1"><div class="li"> all configs in /etc/php/7.0/mods-available/</div>
</li>
</ul>
<p>
Pools:
Move a site-pool from php5 or create a new one in: /etc/php/7.0/fpm/pool.d/
</p>
<p>
You only need to adjust the socket line, to point to /var/run/php7.0-fpm-SITENAME.sock
</p>
<p>
Check, if all required php modules are installed and configured.. good luck :)
</p>
</div>
<!-- EDIT{"target":"section","name":"PHP7.0-FPM Config:","hid":"php70-fpm_config","codeblockOffset":0,"secid":16,"range":"6262-6688"} -->
<h2 class="sectionedit17" id="install_php_74_in_debian_bustersury_repo">Install PHP 7.4 in Debian Buster / SURY REPO</h2>
<div class="level2">
<p>
php7.4-fpm needs systemd :(
</p>
<p>
Add Sury Repo:
</p>
<pre class="code">apt -y install lsb-release apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
apt update
apt install php7.4</pre>
<p>
Install Modules:
</p>
<pre class="code">apt-get install php7.4-{fpm,bcmath,bz2,intl,gd,mbstring,mysql,zip,mysql,memcache,memcached,xml,json,curl}</pre>
<pre class="code">/etc/init.d/php7.4-fpm restart</pre>
</div>
<!-- EDIT{"target":"section","name":"Install PHP 7.4 in Debian Buster \/ SURY REPO","hid":"install_php_74_in_debian_bustersury_repo","codeblockOffset":0,"secid":17,"range":"6689-"} -->text/html2023-02-14T23:09:42+00:00tkilla (tkilla@undisclosed.example.com)Pasta - [Spaghetti alla Carbonara]
https://wiki.fr33.info/doku.php/food/rezepte/pasta
<h1 class="sectionedit1" id="pasta">Pasta</h1>
<div class="level1">
</div>
<!-- EDIT{"target":"section","name":"Pasta","hid":"pasta","codeblockOffset":0,"secid":1,"range":"1-22"} -->
<h2 class="sectionedit2" id="gnocchi_gorgonzola">Gnocchi Gorgonzola</h2>
<div class="level2">
<ul>
<li class="level1"><div class="li"> 500 g Gnocchi</div>
</li>
<li class="level1"><div class="li"> 150 g Gorgonzola</div>
</li>
<li class="level1"><div class="li"> 200 g Sahne</div>
</li>
<li class="level1"><div class="li"> Muskat</div>
</li>
<li class="level1"><div class="li"> Salz</div>
</li>
<li class="level1"><div class="li"> Pfeffer</div>
</li>
<li class="level1"><div class="li"> frischer Basilikum</div>
</li>
</ul>
<p>
Gnocchi kochen. Sahne erwärmen, Gorgonzola entrinden und klein schneiden und zur Sahne geben. Mit etwas Salz (nicht zu viel, der Käse ist schon salzig!), frisch gemahlenem Pfeffer und Muskatnuss abschmecken, dann frische Basilikumblätter oder Petersilie zugeben.
</p>
<p>
<br/>
</p>
</div>
<!-- EDIT{"target":"section","name":"Gnocchi Gorgonzola","hid":"gnocchi_gorgonzola","codeblockOffset":0,"secid":2,"range":"23-437"} -->
<h2 class="sectionedit3" id="gnocchi_mit_spinat-sahne-sosse_und_pinienkernen">Gnocchi mit Spinat-Sahne-Soße und Pinienkernen</h2>
<div class="level2">
<ul>
<li class="level1"><div class="li"> 500g Gnocchi aus dem Kühlregal</div>
</li>
<li class="level1"><div class="li"> 300 g Blattspinat, frisch oder TK</div>
</li>
<li class="level1"><div class="li"> 1/2 Becher Soja Cuisine Sahne</div>
</li>
<li class="level1"><div class="li"> 50 g Pinienkerne</div>
</li>
<li class="level1"><div class="li"> 1 Prise(n) Salz und Pfeffer</div>
</li>
<li class="level1"><div class="li"> 1 Prise(n) Muskat</div>
</li>
<li class="level1"><div class="li"> 1 Prise(n) Zucker</div>
</li>
<li class="level1"><div class="li"> 1 Zehe/n Knoblauch</div>
</li>
<li class="level1"><div class="li"> 20 g Butter </div>
</li>
</ul>
<p>
Gnocchi in Salzwasser kochen. TK-Spinat zubereiten oder frischen Spinat blanchieren. Die Pinienkerne in einer trockenen Pfanne kurz goldbraun rösten.
</p>
<p>
Gnocchi in zerlassener Butter anbraten. Mit Sahne oder Cremefine ablöschen. Den Spinat dazugeben. Die Knoblauchzehe durchpressen und dazugeben. Mit Salz, Pfeffer, Muskat und Zucker abschmecken.
</p>
</div>
<!-- EDIT{"target":"section","name":"Gnocchi mit Spinat-Sahne-So\u00dfe und Pinienkernen","hid":"gnocchi_mit_spinat-sahne-sosse_und_pinienkernen","codeblockOffset":0,"secid":3,"range":"438-1104"} -->
<h2 class="sectionedit4" id="spaghetti_alla_carbonara">Spaghetti alla Carbonara</h2>
<div class="level2">
<p>
4 Portionen
</p>
<ul>
<li class="level1"><div class="li"> 500g Spaghetti (ohne Sahne nur 300g Spaghetti verwenden)</div>
</li>
<li class="level1"><div class="li"> 150 - 200g Speck </div>
</li>
<li class="level1"><div class="li"> 3-4 Eier</div>
</li>
<li class="level1"><div class="li"> 250ml Sahne</div>
</li>
<li class="level1"><div class="li"> 1 Zwiebel</div>
</li>
<li class="level1"><div class="li"> 100g Pecorino</div>
</li>
<li class="level1"><div class="li"> Salz und Pfeffer</div>
</li>
<li class="level1"><div class="li"> Muskat</div>
</li>
<li class="level1"><div class="li"> frische Petersilie</div>
</li>
</ul>
<p>
Sahne und Zwiebel werden nur in der südtiroler Variante verwedet.
</p>
<p>
Speck in einer Pfanne mit wenig Öl auslassen. So lange braten, bis keine weißen Fettstücke mehr zu sehen sind. Zwiebeln kleinschneiden und mit dem Speck weich braten. Nudeln kochen.
</p>
<p>
Eier, Sahne, Salz und Pfeffer, eine Messerspitze Muskat und geriebenen Pecorino in einem Gefäß vermischen.
</p>
<p>
Die Nudeln in die Pfanne zu Speck und Zwiebeln geben und schwenken, um das Öl zu verteilen. Eier-Sahne Soße hinzufügen und schwenken bis das Gemisch stockt. Frische Pettersilie darüber streuen.
</p>
</div>
<!-- EDIT{"target":"section","name":"Spaghetti alla Carbonara","hid":"spaghetti_alla_carbonara","codeblockOffset":0,"secid":4,"range":"1105-1919"} -->
<h2 class="sectionedit5" id="spaghetti_sosse_bolognese">Spaghetti Soße Bolognese</h2>
<div class="level2">
<ul>
<li class="level1"><div class="li"> 1 Pfund Gehacktes</div>
</li>
<li class="level1"><div class="li"> Zwiebel, Knoblauchzehe</div>
</li>
<li class="level1"><div class="li"> Brühwürfel</div>
</li>
<li class="level1"><div class="li"> Pizza-Gewürz</div>
</li>
<li class="level1"><div class="li"> 1 Dose geschälte, gekochte Tomaten</div>
</li>
</ul>
<p>
Gehacktes mit Zwiebel und Knoblauchzehe anbraten. Man kann Rotwein hinzufügen und den dann verkochen lassen. Ansonsten eine Dose geschälte gekochte Tomaten mit Saft hinzufügen. Die Tomaten etwas zerkleinern.
</p>
<p>
Diese Soße nimmt man auch für Lasagne. Zwischen den Nudelblättern ( vorgekochte ) Schichten ,obenauf noch Parmesankäse streuen und nach Anleitung 20 Minuten in den Backofen.
</p>
</div>
<!-- EDIT{"target":"section","name":"Spaghetti So\u00dfe Bolognese","hid":"spaghetti_sosse_bolognese","codeblockOffset":0,"secid":5,"range":"1920-2478"} -->
<h2 class="sectionedit6" id="sosse_mit_thunfisch">Soße mit Thunfisch</h2>
<div class="level2">
<ul>
<li class="level1"><div class="li"> Helle Soße von Maggi oder Knorr</div>
</li>
<li class="level1"><div class="li"> Schmand</div>
</li>
<li class="level1"><div class="li"> 1 Dose Tunfisch</div>
</li>
<li class="level1"><div class="li"> Basilikum, Knoblauch</div>
</li>
</ul>
<p>
Klein geschnittene Knoblauchzehe in etwas Fett andünsten. Wasser zugeben. Schmand mit Schneebesen einrühren. Helle Soße, Gewürze und klein geteilten Tunfisch ohne Öl zugeben.
</p>
</div>
<!-- EDIT{"target":"section","name":"So\u00dfe mit Thunfisch","hid":"sosse_mit_thunfisch","codeblockOffset":0,"secid":6,"range":"2479-"} -->text/html2022-11-06T21:39:04+00:00tkilla (tkilla@undisclosed.example.com)Bootloader
https://wiki.fr33.info/doku.php/linux/filesystems/boot
<h1 class="sectionedit1" id="bootloader">Bootloader</h1>
<div class="level1">
<p>
<strong>linux boot process tricks</strong>
</p>
</div>
<!-- EDIT{"target":"section","name":"Bootloader","hid":"bootloader","codeblockOffset":0,"secid":1,"range":"1-57"} -->
<h3 class="sectionedit2" id="howto_clone_harddisc_and_boot_new_system">howto clone harddisc and boot new system</h3>
<div class="level3">
<p>
<strong>To transfer all system files,</strong> it's best to get a live USB-stick or CD and boot into it <br/>
(all live-distros from ubuntu to systemrescuecd are ok). <br/>
In a livesystem, you can mount the partitions and transfer the data anyway you like (as root user):
</p>
<p>
1. <strong>rsync</strong> needs params and data must be excluded, (but works f&f in a running system), eg., :
</p>
<pre class="code">rsync -a -v -z -h --perms -E -o -g --times --compress --update --delete \
--exclude="/proc/*" --exclude="/sys/*" --exclude="/mnt/*" --exclude="/media/*" / /mnt/newsys/</pre>
<p>
→ may cause strange bugs, like permissions in /var/run/, maybe /dev probs
</p>
<p>
2. simple <strong>copy</strong> with “<strong>cp</strong>” (untested):
</p>
<pre class="code">cp -afv /from/sourcesystem/* /mnt/newsys/
[ or ]
cp -ax /from/sourcesystem/* /mnt/newsys/</pre>
<p>
3. <strong>dd</strong> - clones each sector - can only be used, if both partitions have exactly the same size!
</p>
<p>
4. <strong>parted</strong> - no ext4, only from livesystems
</p>
<p>
etc…
</p>
<hr />
<p>
<br/>
<strong>Fix partition-identifier UUIDs in fstab</strong> of the new system. <br/>
The UUIDs need to be replaced by the new UUIDs in <strong>/mnt/newsys/etc/fstab</strong>
This shows 'em all: :)
</p>
<pre class="code">ls -l /dev/disk/by-uuid/ </pre>
<hr />
<p>
<br/>
</p>
<p>
<strong>Install grub2 bootloader</strong> to the new disc - <br/>
unfortunately a complete change-root environment is required to fool grub-install:
</p>
<p>
<strong>mount dev, proc, sys</strong> via “bind”-option <strong>into the new root / chroot</strong>:
</p>
<pre class="code">mount -o bind /dev /mnt/newsys/dev
mount -t proc none /mnt/newsys/proc
mount -t sysfs none /mnt/newsys/sys</pre>
<p>
<strong>Enter</strong> the new (virtual) root system:
</p>
<pre class="code">chroot /mnt/newsys/</pre>
<p>
Now inside this future system, grub2 installer scripts will work - <br/>
<strong>generate a new (/mnt/newsys) /boot/grub/grub.cfg</strong>:
</p>
<pre class="code">update-grub</pre>
<p>
In case of error “no such disc” run
</p>
<pre class="code">grub-mkdevicemap</pre>
<p>
<strong>Install to the MBR (no partition number) of the new disc, finally:</strong>
</p>
<pre class="code">grub-install /dev/sdX</pre>
<p>
reboot & good luck!
</p>
<hr />
<p>
<br/>
</p>
<p>
<strong> initramfs </strong>
the step after the bootloader needs all (fs, rais,..) modules to mount root, check: /etc/initramfs-tools/modules
</p>
<p>
update existing initramfs:
</p>
<pre class="code">update-initramfs -u -k all </pre>
<p>
<strong> RAID </strong>
if you changed your raid setup, you need to update initramfs:
</p>
<pre class="code">dpkg-reconfigure mdadm </pre>
<p>
make sure these modules are in /etc/initramfs-tools/modules
</p>
<pre class="code">raid0
raid1
md</pre>
<p>
<br/>
References: <a href="http://unix.stackexchange.com/questions/5297/debian-grub2-moving-root-partition-to-new-drive" class="urlextern" target="_blank" title="http://unix.stackexchange.com/questions/5297/debian-grub2-moving-root-partition-to-new-drive" rel="noopener">http://unix.stackexchange.com/questions/5297/debian-grub2-moving-root-partition-to-new-drive</a>
</p>
<p>
<br/>
</p>
</div>
<!-- EDIT{"target":"section","name":"howto clone harddisc and boot new system","hid":"howto_clone_harddisc_and_boot_new_system","codeblockOffset":0,"secid":2,"range":"58-2429"} -->
<h3 class="sectionedit3" id="howto_boot_from_grub2_rescue_console">howto boot from grub2 rescue console</h3>
<div class="level3">
<p>
If you drop to the grub rescue after cloning a system disc or something, it's possible to boot an existing system.
</p>
<p>
Enter this, to start a system on sda3 for example: sda = hd0 + partition 3 = (hd0,3)
</p>
<pre class="code">set prefix=(hd0,3)/boot/grub
insmod (hd0,3)/boot/grub/linux.mod</pre>
<p>
if this works, the console gets upgraded to standard grub console.
</p>
<p>
if it doesn't work, try another partition. grub counts partitions from 1 (not 0), btw.
</p>
<p>
This boots arch linux:
</p>
<pre class="code">set root=(hd0,3)
linux /boot/vmlinuz26 root=/dev/sda5
initrd /boot/kernel26.img
boot</pre>
<p>
This is required to boot debian - unfortunately the filenames contain versionnumbers :(
</p>
<pre class="code">set root=(hd0,3)
linux /boot/vmlinuz-3.1.0-1-amd64 root=/dev/sda3
initrd /boot/initrd.img-3.1.0-1-amd64
boot</pre>
<p>
This should boot your system. Just re-install grub:
</p>
<pre class="code">update-grub
grub-install /dev/sdX</pre>
</div>
<!-- EDIT{"target":"section","name":"howto boot from grub2 rescue console","hid":"howto_boot_from_grub2_rescue_console","codeblockOffset":0,"secid":3,"range":"2430-3326"} -->
<h2 class="sectionedit4" id="bugs">Bugs</h2>
<div class="level2">
<p>
Inside a chroot, grub complains
</p>
<pre class="code"># update-grub
Generating grub configuration file ...
WARNING: Device /dev/ram0 not initialized in udev database even after waiting 10000000 microseconds.
...</pre>
<p>
Fix:
</p>
<p>
Outside chroot /debian/:
</p>
<pre class="code">mkdir /debian/run/udev
mount --bind /run/udev /debian/run/udev
mount --bind /run/udev /mnt/run/udev</pre>
</div>
<!-- EDIT{"target":"section","name":"Bugs","hid":"bugs","codeblockOffset":0,"secid":4,"range":"3327-3895"} -->
<h2 class="sectionedit5" id="crypto_bugs">Crypto Bugs</h2>
<div class="level2">
<p>
Grub complains root device couldn't be found
</p>
<p>
Fix:
- set
</p>
<pre class="code">GRUB_ENABLE_CRYPTODISK=y</pre>
<pre class="code">apt install cryptsetup-initramfs lvm2</pre>
<p>
- if it is a brtfs, set in /etc/initramfs/modules
</p>
<pre class="code">btrfs </pre>
<p>
Commands to execute in chroot to reinstall grub:
</p>
<pre class="code">update-initramfs -c -k all
grub-install /dev/sdX
update-grub</pre>
<p>
If update-grub echos: “cannot find device for / in fstab” and you have a btrfs rootsys:
</p>
<pre class="code">mount -o "subvol=@" /dev/mapper/vgubuntu-root </pre>
<p>
is required to mount the @ subvol!
</p>
</div>
<!-- EDIT{"target":"section","name":"Crypto Bugs","hid":"crypto_bugs","codeblockOffset":0,"secid":5,"range":"3896-"} -->text/html2022-10-20T20:31:05+00:00tkilla (tkilla@undisclosed.example.com)Backup
https://wiki.fr33.info/doku.php/linux/backup
<h1 class="sectionedit1" id="backup">Backup</h1>
<div class="level1">
<p>
howtos for various backup systems…
</p>
</div>
<!-- EDIT{"target":"section","name":"Backup","hid":"backup","codeblockOffset":0,"secid":1,"range":"1-60"} -->
<h2 class="sectionedit2" id="simple_dd_backup_of_a_partition_or_raspi_sd_card">Simple dd backup of a partition or (raspi) SD card</h2>
<div class="level2">
<p>
Replace sdX with your SDcard (check fdisk -l)
</p>
<pre class="code">dd bs=4M if=/dev/sdX | gzip -c9 > /home/your_username/image`date +%d%m%y`.gz</pre>
<p>
2. terminal:
</p>
<pre class="code">watch progress</pre>
<p>
Restore:
</p>
<pre class="code">gzip -dc /home/your_username/image....gz | dd bs=4M of=/dev/sdX</pre>
</div>
<!-- EDIT{"target":"section","name":"Simple dd backup of a partition or (raspi) SD card","hid":"simple_dd_backup_of_a_partition_or_raspi_sd_card","codeblockOffset":0,"secid":2,"range":"61-"} -->text/html2022-09-19T17:05:33+00:00tkilla (tkilla@undisclosed.example.com)NGINX - Videostreaming
https://wiki.fr33.info/doku.php/linux/streamingserver/nginx_-_videostreaming
<h1 class="sectionedit1" id="nginx_-_videostreaming">NGINX - Videostreaming</h1>
<div class="level1">
<p>
work in progress
</p>
<p>
Nginx comes with a RTMP Plugin, which can be configured to play stream HLS, RTMP and DASH.
The Setup is a bit tricky and working values for Bitrate, etc are hard to find.
</p>
</div>
<!-- EDIT{"target":"section","name":"NGINX - Videostreaming","hid":"nginx_-_videostreaming","codeblockOffset":0,"secid":1,"range":"1-230"} -->
<h1 class="sectionedit2" id="basic_installation">Basic Installation</h1>
<div class="level1">
<p>
.. in Debian Buster is easy
</p>
<pre class="code">apt install nginx nginx-rtmp-module</pre>
<p>
Links:
</p>
<ul>
<li class="level1"><div class="li"> <a href="https://www.hostwinds.com/guide/live-streaming-from-a-vps-with-nginx-rtmp/" class="urlextern" target="_blank" title="https://www.hostwinds.com/guide/live-streaming-from-a-vps-with-nginx-rtmp/" rel="noopener">https://www.hostwinds.com/guide/live-streaming-from-a-vps-with-nginx-rtmp/</a></div>
</li>
<li class="level1"><div class="li"> <a href="https://gist.github.com/pschichtel/31fc635174bac1bc1a7c" class="urlextern" target="_blank" title="https://gist.github.com/pschichtel/31fc635174bac1bc1a7c" rel="noopener">https://gist.github.com/pschichtel/31fc635174bac1bc1a7c</a></div>
</li>
<li class="level1"><div class="li"> <a href="https://gerpei.de/eigener-live-streaming-server-setup/" class="urlextern" target="_blank" title="https://gerpei.de/eigener-live-streaming-server-setup/" rel="noopener">https://gerpei.de/eigener-live-streaming-server-setup/</a></div>
</li>
</ul>
</div>
<!-- EDIT{"target":"section","name":"Basic Installation","hid":"basic_installation","codeblockOffset":0,"secid":2,"range":"231-541"} -->
<h1 class="sectionedit3" id="security">Security</h1>
<div class="level1">
<p>
.. is not so easy.
</p>
<p>
1. Level is to allow only some IPs to publish streams via deny / allow settings in nginx
2. Level is to add a Stream Key. This does not work for me yet in OBStudio
3. ..
</p>
<p>
Links:
</p>
<ul>
<li class="level1"><div class="li"> <a href="https://blog.peer5.com/practical-approaches-for-securing-your-video-streams/" class="urlextern" target="_blank" title="https://blog.peer5.com/practical-approaches-for-securing-your-video-streams/" rel="noopener">https://blog.peer5.com/practical-approaches-for-securing-your-video-streams/</a></div>
</li>
<li class="level1"><div class="li"> <a href="https://gist.github.com/mrbar42/09c149059f72da2f09e652d4c5079919" class="urlextern" target="_blank" title="https://gist.github.com/mrbar42/09c149059f72da2f09e652d4c5079919" rel="noopener">https://gist.github.com/mrbar42/09c149059f72da2f09e652d4c5079919</a></div>
</li>
<li class="level1"><div class="li"> <a href="https://smartshitter.com/musings/2017/12/nginx-rtmp-streaming-with-simple-authentication/" class="urlextern" target="_blank" title="https://smartshitter.com/musings/2017/12/nginx-rtmp-streaming-with-simple-authentication/" rel="noopener">https://smartshitter.com/musings/2017/12/nginx-rtmp-streaming-with-simple-authentication/</a></div>
</li>
<li class="level1"><div class="li"> <a href="https://smartshitter.com/musings/2018/06/nginx-rtmp-streaming-with-slightly-improved-authentication/" class="urlextern" target="_blank" title="https://smartshitter.com/musings/2018/06/nginx-rtmp-streaming-with-slightly-improved-authentication/" rel="noopener">https://smartshitter.com/musings/2018/06/nginx-rtmp-streaming-with-slightly-improved-authentication/</a></div>
</li>
</ul>
</div>
<!-- EDIT{"target":"section","name":"Security","hid":"security","codeblockOffset":0,"secid":3,"range":"542-1115"} -->
<h1 class="sectionedit4" id="server_side_stream_switching">Server Side Stream Switching</h1>
<div class="level1">
<p>
Should be possible, found a workinf version here (see supllex server):
</p>
<ul>
<li class="level1"><div class="li"> <a href="https://github.com/arut/nginx-rtmp-module/wiki/Control-module" class="urlextern" target="_blank" title="https://github.com/arut/nginx-rtmp-module/wiki/Control-module" rel="noopener">https://github.com/arut/nginx-rtmp-module/wiki/Control-module</a></div>
</li>
<li class="level1"><div class="li"> <a href="https://nginx-rtmp.blogspot.com/2014/01/redirecting-streams-in-version-111.html" class="urlextern" target="_blank" title="https://nginx-rtmp.blogspot.com/2014/01/redirecting-streams-in-version-111.html" rel="noopener">https://nginx-rtmp.blogspot.com/2014/01/redirecting-streams-in-version-111.html</a></div>
</li>
<li class="level1"><div class="li"> <a href="https://groups.google.com/g/nginx-rtmp/c/yUcTKB9pAl0" class="urlextern" target="_blank" title="https://groups.google.com/g/nginx-rtmp/c/yUcTKB9pAl0" rel="noopener">https://groups.google.com/g/nginx-rtmp/c/yUcTKB9pAl0</a></div>
</li>
</ul>
</div>
<!-- EDIT{"target":"section","name":"Server Side Stream Switching","hid":"server_side_stream_switching","codeblockOffset":0,"secid":4,"range":"1116-1439"} -->
<h1 class="sectionedit5" id="stream_twitch_to_rtmp_server">Stream twitch to RTMP Server</h1>
<div class="level1">
<pre class="code">streamlink https://www.twitch.tv/videos/123123123 best -O | ffmpeg -i pipe:0 -c copy -f flv rtmp://xxxxx/foo/stream-A</pre>
</div>
<!-- EDIT{"target":"section","name":"Stream twitch to RTMP Server","hid":"stream_twitch_to_rtmp_server","codeblockOffset":0,"secid":5,"range":"1440-"} -->text/html2022-08-25T20:49:14+00:00tkilla (tkilla@undisclosed.example.com)Lenovo X13 - [LTE Modem EM120R_GL]
https://wiki.fr33.info/doku.php/linux/machines/lenovo_x13
<h1 class="sectionedit1" id="lenovo_x13">Lenovo X13</h1>
<div class="level1">
</div>
<!-- EDIT{"target":"section","name":"Lenovo X13","hid":"lenovo_x13","codeblockOffset":0,"secid":1,"range":"1-26"} -->
<h2 class="sectionedit2" id="lte_modem_em120r_gl">LTE Modem EM120R_GL</h2>
<div class="level2">
<p>
Check modem:
</p>
<pre class="code"> mmcli -L</pre>
<p>
Check, if its unlocked:
</p>
<pre class="code"> mbimcli -p -d /dev/wwan0mbim0 --quectel-query-radio-state</pre>
<p>
Here is a thread, how to unlock the FCC lock in the modem:
<a href="https://forums.quectel.com/t/em120r-gl-for-linux/9350/4" class="urlextern" target="_blank" title="https://forums.quectel.com/t/em120r-gl-for-linux/9350/4" rel="noopener">https://forums.quectel.com/t/em120r-gl-for-linux/9350/4</a>
</p>
<pre class="code"># Download network-manager, modem-manager, etc.,...
sudo apt update
sudo apt install network-manager network-manager-gnome modemmanager libqmi-utils gcc
# Reference: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/402#note_1064882
mkdir ~/Downloads/lenovo/snap
cd ~/Downloads/lenovo
# Download the snap
snap download lenovo-wwan-dpr --edge
# Extract the snap files
sudo mount -t squashfs -o ro lenovo-wwan-dpr_5.snap /home/$whoami/Downloads/lenovo/snap
# Download script by Joar Wandborg
wget https://gist.githubusercontent.com/joar/416f37fe81558f5be0d5131018eb7f2a/raw/b6a2a83620b044efc2d13aee86910743969218de/fcc-unlock.c
# TODO: manually modify the define statements in fcc_unlock.c appropriately
#define MBIM_DEVICE_PATH "/dev/wwan0p2MBIM"
#define MBIM2SAR_SO_PATH "/home/jonfen/Downloads/lenovo/snap/usr/lib/mbim2sar.so"
# Compile the script
gcc -o fcc_unlock_v2 fcc_unlock.c
# Run the script
sudo env VERBOSE=1 ./fcc_unlock_v2
# Enable the modem
mmcli -v --modem=0 -e</pre>
<pre class="code"># Click "+" to setup the connection
nm-connection-editor
modem-manager-gui</pre>
</div>
<!-- EDIT{"target":"section","name":"LTE Modem EM120R_GL","hid":"lte_modem_em120r_gl","codeblockOffset":0,"secid":2,"range":"27-"} -->text/html2022-07-10T07:14:38+00:00tkilla (tkilla@undisclosed.example.com)Streaming -Server und Cam -Software
https://wiki.fr33.info/doku.php/linux/streamingserver
<h1 class="sectionedit1" id="streaming_-server_und_cam_-software">Streaming -Server und Cam -Software</h1>
<div class="level1">
</div>
<!-- EDIT{"target":"section","name":"Streaming -Server und Cam -Software","hid":"streaming_-server_und_cam_-software","codeblockOffset":0,"secid":1,"range":"1-51"} -->
<h2 class="sectionedit2" id="icecast">Icecast</h2>
<div class="level2">
<p>
for Audio / Radio Streaming (and Video OGG Streaming (deprecated))
</p>
<p>
<br/>
</p>
</div>
<!-- EDIT{"target":"section","name":"Icecast","hid":"icecast","codeblockOffset":0,"secid":2,"range":"52-145"} -->
<h2 class="sectionedit3" id="nginx">Nginx</h2>
<div class="level2">
<p>
for RTMP / HLS Videostreaming
</p>
<p>
<br/>
</p>
</div>
<!-- EDIT{"target":"section","name":"Nginx","hid":"nginx","codeblockOffset":0,"secid":3,"range":"146-199"} -->
<h2 class="sectionedit4" id="owncast">Owncast</h2>
<div class="level2">
<p>
Nice Webfrontend for a Streamingserver. Almost as good as nginx, but much more userfriedly
</p>
<p>
In a docker container its up and running in a minute:
</p>
<pre class="code"># cd ~/owncast/
docker pull gabekangas/owncast:latest
docker run -v `pwd`/data:/app/data -p 8080:8080 -p 1935:1935 -it gabekangas/owncast:latest</pre>
<p>
<br/>
</p>
</div>
<!-- EDIT{"target":"section","name":"Owncast","hid":"owncast","codeblockOffset":0,"secid":4,"range":"200-527"} -->
<h2 class="sectionedit5" id="cvlc_webcam_to_stream">cvlc Webcam to Stream</h2>
<div class="level2">
<p>
Can present a Stream for other to fetch via http. It uses raspivid and all its nice options
</p>
<pre class="code">raspivid -drc high -o - -n -t 0 -w 1280 -h 720 -fps 25 | cvlc -vvv stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8099}' :demux=h264 :h264-fps=30</pre>
<p>
<a href="https://www.instructables.com/Webcam-Over-WiFi-for-OBS/" class="urlextern" target="_blank" title="https://www.instructables.com/Webcam-Over-WiFi-for-OBS/" rel="noopener">https://www.instructables.com/Webcam-Over-WiFi-for-OBS/</a>
</p>
<p>
<strong>Breaks</strong> every 4-5 Minutes for 10-20 Seconds <img src="https://wiki.fr33.info/lib/images/smileys/icon_sad.gif" class="icon" alt=":-(" />
</p>
<p>
<br/>
</p>
</div>
<!-- EDIT{"target":"section","name":"cvlc Webcam to Stream","hid":"cvlc_webcam_to_stream","codeblockOffset":0,"secid":5,"range":"528-938"} -->
<h2 class="sectionedit6" id="mjpg-streamer-experimental">mjpg-streamer-experimental</h2>
<div class="level2">
<p>
Thanx to various I/O Plugins, it can stream almost every input to http
</p>
<pre class="code">mjpg_streamer -i input_uvc.so -o output_http.so</pre>
<p>
BUT, the stream quality is very low with <strong>input_uvc</strong>.so plugin.
</p>
<pre class="code">mjpg_streamer -i "input_uvc.so --resolution 1280x720" -o "output_http.so -p 8080</pre>
<p>
<br/>
</p>
<p>
<strong>Input_raspicam</strong> Plugin looks much better, but … lets see:
</p>
<pre class="code">mjpg_streamer -i "input_raspicam.so -x 1280 -y 720 -fps 25" -o "output_http.so -p 8080</pre>
<ul>
<li class="level1"><div class="li"> <a href="https://github.com/jacksonliam/mjpg-streamer/blob/master/mjpg-streamer-experimental" class="urlextern" target="_blank" title="https://github.com/jacksonliam/mjpg-streamer/blob/master/mjpg-streamer-experimental" rel="noopener">https://github.com/jacksonliam/mjpg-streamer/blob/master/mjpg-streamer-experimental</a></div>
</li>
<li class="level1"><div class="li"> Raspicam Plugin Options: <a href="https://github.com/jacksonliam/mjpg-streamer/blob/master/mjpg-streamer-experimental/plugins/input_raspicam/README.md" class="urlextern" target="_blank" title="https://github.com/jacksonliam/mjpg-streamer/blob/master/mjpg-streamer-experimental/plugins/input_raspicam/README.md" rel="noopener">https://github.com/jacksonliam/mjpg-streamer/blob/master/mjpg-streamer-experimental/plugins/input_raspicam/README.md</a></div>
</li>
</ul>
<p>
<br/>
</p>
</div>
<!-- EDIT{"target":"section","name":"mjpg-streamer-experimental","hid":"mjpg-streamer-experimental","codeblockOffset":0,"secid":6,"range":"939-1652"} -->
<h2 class="sectionedit7" id="droidcam_android_app_mit_obs_plugins">Droidcam Android App mit OBS Plugins</h2>
<div class="level2">
<p>
very easy App. Plug and Play without network hassle. Works well and stable.
</p>
</div>
<!-- EDIT{"target":"section","name":"Droidcam Android App mit OBS Plugins","hid":"droidcam_android_app_mit_obs_plugins","codeblockOffset":0,"secid":7,"range":"1653-"} -->text/html2021-05-28T17:22:42+00:00tkilla (tkilla@undisclosed.example.com)linux:webserver:addssl.rtf - created
https://wiki.fr33.info/doku.php/?image=linux%3Awebserver%3Aaddssl.rtf&ns=linux%3Awebserver&do=media
text/html2021-05-28T17:21:49+00:00tkilla (tkilla@undisclosed.example.com)linux:webserver:addacme.rtf - created
https://wiki.fr33.info/doku.php/?image=linux%3Awebserver%3Aaddacme.rtf&ns=linux%3Awebserver&do=media
text/html2020-04-21T21:07:21+00:00tkilla (tkilla@undisclosed.example.com)webdev:deleteorders_bulk_works.zip - created
https://wiki.fr33.info/doku.php/?image=webdev%3Adeleteorders_bulk_works.zip&ns=webdev&do=media
text/html2016-12-04T11:33:52+00:00tkilla (tkilla@undisclosed.example.com)linux:debian_install:postinst_demo.txt - created
https://wiki.fr33.info/doku.php/?image=linux%3Adebian_install%3Apostinst_demo.txt&ns=linux%3Adebian_install&do=media
text/html2016-12-04T11:30:38+00:00tkilla (tkilla@undisclosed.example.com)linux:debian_install:preseed_demo.txt - created
https://wiki.fr33.info/doku.php/?image=linux%3Adebian_install%3Apreseed_demo.txt&ns=linux%3Adebian_install&do=media
text/html2016-10-02T00:36:40+00:00tkilla (tkilla@undisclosed.example.com)linux:virtualization:lxc-convert-unprivileged.txt - created
https://wiki.fr33.info/doku.php/?image=linux%3Avirtualization%3Alxc-convert-unprivileged.txt&ns=linux%3Avirtualization&do=media
text/html2014-05-27T14:35:32+00:00tkilla (tkilla@undisclosed.example.com)linux:emailserver:mlm_import_converter.py.txt - created
https://wiki.fr33.info/doku.php/?image=linux%3Aemailserver%3Amlm_import_converter.py.txt&ns=linux%3Aemailserver&do=media
text/html2013-09-11T23:48:03+00:00tkilla (tkilla@undisclosed.example.com)linux:network:hostapinit.txt - created
https://wiki.fr33.info/doku.php/?image=linux%3Anetwork%3Ahostapinit.txt&ns=linux%3Anetwork&do=media
text/html2012-09-08T16:39:55+00:00tkilla (tkilla@undisclosed.example.com)communitycloud:services:sshtunnel.sh - created
https://wiki.fr33.info/doku.php/?image=communitycloud%3Aservices%3Asshtunnel.sh&ns=communitycloud%3Aservices&do=media
text/html2011-12-03T07:23:30+00:00tkilla (tkilla@undisclosed.example.com)alt-f4.gif - created
https://wiki.fr33.info/doku.php/?image=alt-f4.gif&ns=&do=media
<img src="https://wiki.fr33.info/lib/exe/fetch.php/alt-f4.gif?w=499&h=328&t=1322893410&tok=41ca7a" alt="alt-f4.gif" />