Màj 06-04-2024

This commit is contained in:
2024-04-06 09:54:09 +02:00
parent cd8cebe7cb
commit 259b9c6a24
76 changed files with 5126 additions and 229 deletions

View File

@@ -0,0 +1,178 @@
# brew deprecated commands
- switch
#### Activer une autre version:
```bash
$ brew switch <formula>
```
```bash
bruno@SilverBook:/usr/local/Cellar/terminal-notifier/1.8.0$ brew switch terminal-notifier 1.7.1
Cleaning /usr/local/Cellar/terminal-notifier/1.7.1
Cleaning /usr/local/Cellar/terminal-notifier/1.8.0
1 links created for /usr/local/Cellar/terminal-notifier/1.7.1
```
#### Installer une ancienne version d'une formule:
Exemple avec [annie](https://github.com/iawia002/annie), un téléchargeur de vidéo. La version courante est la dernière (0.9.6)
```bash
~ master*
annie -v
annie: version 0.9.6, A fast, simple and clean video downloader.
```
```bash
~ master*
cd "$(brew --repo homebrew/core)"
```
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core master
git log Formula/annie.rb
commit 377c142a619f2b2563c4c01b06f2560707fa3228
Author: BrewTestBot <homebrew-test-bot@lists.sfconservancy.org>
Date: Fri Nov 8 10:23:24 2019 +0000
annie: update 0.9.6 bottle.
commit e3201eb44c3eade6f113f616b67315ae13f5a70b
Author: iawia002 <xuxinzhao@caicloud.io>
Date: Fri Nov 8 18:15:49 2019 +0800
annie 0.9.6
Closes #46491.
Signed-off-by: Rui Chen <rchen@meetup.com>
commit ef762f724ce45afb0007f7d3b96a8f10ceeb3b58
Author: BrewTestBot <homebrew-test-bot@lists.sfconservancy.org>
Date: Fri Oct 11 21:56:45 2019 +0000
annie: update 0.9.5 bottle.
commit 249669ab6a53335d85d8973c8e82f182903434ca
Author: BrewTestBot <homebrew-test-bot@lists.sfconservancy.org>
Date: Tue Aug 13 14:30:19 2019 +0000
annie: update 0.9.5 bottle.
commit 5fa1c6903f84cc22c2cbed751de6125cab4fe214
Author: iawia002 <xuxinzhao@caicloud.io>
Date: Tue Aug 13 22:22:21 2019 +0800
annie 0.9.5
Closes #43069.
Signed-off-by: Thierry Moisan <thierry.moisan@gmail.com>
```
Création d'une nouvelle branche pour l'ancienne version:
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core master 19s
git checkout -b annie-0.9.5 ef762f724ce45afb0007f7d3b96a8f10ceeb3b58
Basculement sur la nouvelle branche 'annie-0.9.5'
```
Unlink la version courante:
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core annie-0.9.5
brew unlink annie
Unlinking /usr/local/Cellar/annie/0.9.6... 1 symlinks removed
```
Installation de la version 0.9.5:
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core annie-0.9.5
HOMEBREW_NO_AUTO_UPDATE=1 brew install annie
==> Downloading https://homebrew.bintray.com/bottles/annie-0.9.5.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/06/06ff55a2834ad01a262b66f181a8c99800157ec0f465f80e0cc3518be7ebd1da?__gda__=exp=1575195423~hmac=edc063962f1a5b12a715444b0f1eff
######################################################################## 100.0%
==> Pouring annie-0.9.5.catalina.bottle.tar.gz
🍺 /usr/local/Cellar/annie/0.9.5: 5 files, 8.6MB
```
L'ancienne version 0.9.5 est bien active:
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core annie-0.9.5
annie -v
annie: version 0.9.5, A fast, simple and clean video downloader.
```
Retour sur la branche 'master'
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core annie-0.9.5
git checkout master
Basculement sur la branche 'master'
Votre branche est à jour avec 'origin/master'.
```
Suppression de l'ancienne branche 0.9.5
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core master
git branch -d annie-0.9.5
Branche annie-0.9.5 supprimée (précédemment ef762f72).
```
Liste des versions installés:
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core master
brew list annie --versions
annie 0.9.6 0.9.5
```
Info sur la formule 'annie'
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core master
brew info annie
annie: stable 0.9.6 (bottled)
Fast, simple and clean video downloader
https://github.com/iawia002/annie
/usr/local/Cellar/annie/0.9.5 (5 files, 8.6MB) *
Poured from bottle on 2019-12-01 at 11:05:06
/usr/local/Cellar/annie/0.9.6 (5 files, 8.6MB)
Poured from bottle on 2019-12-01 at 10:57:11
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/annie.rb
```
Changement de version:
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core master
brew switch annie 0.9.6
Cleaning /usr/local/Cellar/annie/0.9.6
Cleaning /usr/local/Cellar/annie/0.9.5
1 links created for /usr/local/Cellar/annie/0.9.6
```

View File

@@ -296,172 +296,36 @@ briss: Crop PDF files
diff-pdf: Visually compare two PDF files
```
#### Activer une autre version:
```bash
$ brew switch <formula>
```
```bash
bruno@SilverBook:/usr/local/Cellar/terminal-notifier/1.8.0$ brew switch terminal-notifier 1.7.1
Cleaning /usr/local/Cellar/terminal-notifier/1.7.1
Cleaning /usr/local/Cellar/terminal-notifier/1.8.0
1 links created for /usr/local/Cellar/terminal-notifier/1.7.1
```
#### Installer une ancienne version d'une formule:
Exemple avec [annie](https://github.com/iawia002/annie), un téléchargeur de vidéo. La version courante est la dernière (0.9.6)
Exemple avec pipdeptree, outil por vérifier les dépendances python: passer de v 2.17.0 à v 2.16.2
```bash
~ master*
annie -v
- Aller sur https://github.com/Homebrew/homebrew-core/tree/master/Formula et rechercher la formule de [pipdeptree](https://github.com/Homebrew/homebrew-core/blob/master/Formula/p/pipdeptree.rb).
annie: version 0.9.6, A fast, simple and clean video downloader.
```
- Cliquer sur [History](https://github.com/Homebrew/homebrew-core/commits/master/Formula/p/pipdeptree.rb) (à droite)
- Cliquer sur **pipdeptree: update 2.16.2 bottle.**
- A droite du bloc de code, cliquer sur les **3 points (...)**, puis sur **View file**.
```bash
~ master*
cd "$(brew --repo homebrew/core)"
```
- En haut du bloc de code, cliquer sur **Raw**.
- Copier / coller le contenu dans un fichier **pipdeptree.rb** ou `curl https://raw.githubusercontent.com/Homebrew/homebrew-core/df08a167320582bc009f8da3342f3af748651dbf/Formula/p/pipdeptree.rb > pipdeptree.rb`
- Supprimer le package existant: `brew remove pipdeptree`
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core master
git log Formula/annie.rb
commit 377c142a619f2b2563c4c01b06f2560707fa3228
Author: BrewTestBot <homebrew-test-bot@lists.sfconservancy.org>
Date: Fri Nov 8 10:23:24 2019 +0000
- Installer pipdeptree en spécifiant la formule nouvellemnt créee: `brew install pipdeptree.rb`
annie: update 0.9.6 bottle.
commit e3201eb44c3eade6f113f616b67315ae13f5a70b
Author: iawia002 <xuxinzhao@caicloud.io>
Date: Fri Nov 8 18:15:49 2019 +0800
annie 0.9.6
Closes #46491.
Signed-off-by: Rui Chen <rchen@meetup.com>
commit ef762f724ce45afb0007f7d3b96a8f10ceeb3b58
Author: BrewTestBot <homebrew-test-bot@lists.sfconservancy.org>
Date: Fri Oct 11 21:56:45 2019 +0000
annie: update 0.9.5 bottle.
commit 249669ab6a53335d85d8973c8e82f182903434ca
Author: BrewTestBot <homebrew-test-bot@lists.sfconservancy.org>
Date: Tue Aug 13 14:30:19 2019 +0000
annie: update 0.9.5 bottle.
commit 5fa1c6903f84cc22c2cbed751de6125cab4fe214
Author: iawia002 <xuxinzhao@caicloud.io>
Date: Tue Aug 13 22:22:21 2019 +0800
annie 0.9.5
Closes #43069.
Signed-off-by: Thierry Moisan <thierry.moisan@gmail.com>
```
Création d'une nouvelle branche pour l'ancienne version:
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core master 19s
git checkout -b annie-0.9.5 ef762f724ce45afb0007f7d3b96a8f10ceeb3b58
Basculement sur la nouvelle branche 'annie-0.9.5'
```
Unlink la version courante:
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core annie-0.9.5
brew unlink annie
Unlinking /usr/local/Cellar/annie/0.9.6... 1 symlinks removed
```
Installation de la version 0.9.5:
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core annie-0.9.5
HOMEBREW_NO_AUTO_UPDATE=1 brew install annie
==> Downloading https://homebrew.bintray.com/bottles/annie-0.9.5.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/06/06ff55a2834ad01a262b66f181a8c99800157ec0f465f80e0cc3518be7ebd1da?__gda__=exp=1575195423~hmac=edc063962f1a5b12a715444b0f1eff
######################################################################## 100.0%
==> Pouring annie-0.9.5.catalina.bottle.tar.gz
🍺 /usr/local/Cellar/annie/0.9.5: 5 files, 8.6MB
```
L'ancienne version 0.9.5 est bien active:
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core annie-0.9.5
annie -v
annie: version 0.9.5, A fast, simple and clean video downloader.
```
Retour sur la branche 'master'
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core annie-0.9.5
git checkout master
Basculement sur la branche 'master'
Votre branche est à jour avec 'origin/master'.
```
Suppression de l'ancienne branche 0.9.5
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core master
git branch -d annie-0.9.5
Branche annie-0.9.5 supprimée (précédemment ef762f72).
```
Liste des versions installés:
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core master
brew list annie --versions
annie 0.9.6 0.9.5
```
Info sur la formule 'annie'
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core master
brew info annie
annie: stable 0.9.6 (bottled)
Fast, simple and clean video downloader
https://github.com/iawia002/annie
/usr/local/Cellar/annie/0.9.5 (5 files, 8.6MB) *
Poured from bottle on 2019-12-01 at 11:05:06
/usr/local/Cellar/annie/0.9.6 (5 files, 8.6MB)
Poured from bottle on 2019-12-01 at 10:57:11
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/annie.rb
```
Changement de version:
```bash
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core master
brew switch annie 0.9.6
Cleaning /usr/local/Cellar/annie/0.9.6
Cleaning /usr/local/Cellar/annie/0.9.5
1 links created for /usr/local/Cellar/annie/0.9.6
```
- La version 2.16.2 est installée:
```bash
$ pipdeptree -v
2.16.2
```
#### Configurer (arguments) une formule:

141
docs/macos/network.md Normal file
View File

@@ -0,0 +1,141 @@
# Network
```bash
$ arp -a
? (192.0.0.2) at 50:ed:3c:1f:98:6 on en0 ifscope permanent [ethernet]
? (239.255.255.250) at 1:0:5e:7f:ff:fa on en0 ifscope permanent [ethernet]
```
```bash
$ networksetup -listallnetworkservices
An asterisk (*) denotes that a network service is disabled.
Belkin USB-C LAN
USB 10/100/1000 LAN
Wi-Fi
iPhone USB
Thunderbolt Bridge 2
Thunderbolt Bridge
DS923
```
```bash
$ networksetup -listnetworkserviceorder
An asterisk (*) denotes that a network service is disabled.
(1) Belkin USB-C LAN
(Hardware Port: Belkin USB-C LAN, Device: en5)
(2) USB 10/100/1000 LAN
(Hardware Port: USB 10/100/1000 LAN, Device: en9)
(3) Wi-Fi
(Hardware Port: Wi-Fi, Device: en0)
(4) iPhone USB
(Hardware Port: iPhone USB, Device: en8)
(5) Thunderbolt Bridge 2
(Hardware Port: Thunderbolt Bridge, Device: bridge0)
(6) Thunderbolt Bridge
(Hardware Port: Thunderbolt Bridge, Device: bridge0)
(7) DS923
(Hardware Port: com.wireguard.macos, Device: )
```
```bash
$ networksetup -getinfo Wi-Fi
DHCP Configuration
IP address: 192.0.0.2
Subnet mask: (null)
Router: 192.0.0.1
Client ID:
IPv6: Automatic
IPv6 IP address: none
IPv6 Router: none
Wi-Fi ID: 50:ed:3c:1f:98:06
```
```bash
$ networksetup -listallhardwareports | grep -C1 $(route get default | grep interface | awk '{print $2}')
Hardware Port: Wi-Fi
Device: en0
Ethernet Address: 50:ed:3c:1f:98:06
```
```bash
$ networksetup -listnetworkserviceorder | grep -C1 $(netstat -nr | grep ^default | grep -o "\s\S\+$")
```
```bash
$ networksetup -listnetworkserviceorder | grep -C1 en0
(3) Wi-Fi
(Hardware Port: Wi-Fi, Device: en0)
```
one way to know which one you are taking to reach the outside is the following line command
```bash
$ route get default | grep interface
interface: en0
```
```bash
$ route -n get 0.0.0.0 2>/dev/null | awk '/interface: / {print $2}'
en0
```
```bash
$ netstat -i
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
lo0 16384 <Link#1> 25370 0 25370 0 0
lo0 16384 127 localhost 25370 - 25370 - -
lo0 16384 localhost ::1 25370 - 25370 - -
lo0 16384 airbook.loc fe80:1::1 25370 - 25370 - -
gif0* 1280 <Link#2> 0 0 0 0 0
stf0* 1280 <Link#3> 0 0 0 0 0
anpi0 1500 <Link#4> de:47:cc:60:98:b6 0 0 0 0 0
anpi1 1500 <Link#5> de:47:cc:60:98:b7 0 0 0 0 0
en3 1500 <Link#6> de:47:cc:60:98:96 0 0 0 0 0
en4 1500 <Link#7> de:47:cc:60:98:97 0 0 0 0 0
en1 1500 <Link#8> 36:6d:60:8b:6d:80 0 0 0 0 0
en2 1500 <Link#9> 36:6d:60:8b:6d:84 0 0 0 0 0
bridge0 1500 <Link#11> 36:6d:60:8b:6d:80 0 0 0 0 0
ap1 1500 <Link#12> 72:ed:3c:1f:98:06 0 0 1108 0 0
ap1 1500 airbook.loc fe80:c::70ed:3cff 0 - 1108 - -
en0 1500 <Link#13> 50:ed:3c:1f:98:06 121 0 49488 0 0
en0 1500 airbook.loc fe80:d::c7a:c760: 121 - 49488 - -
en0 1500 2a01cb09806 2a01:cb09:806e:28 121 - 49488 - -
en0 1500 2a01cb09806 2a01:cb09:806e:28 121 - 49488 - -
en0 1500 192.0.0.2/32 192.0.0.2 121 - 49488 - -
awdl0 1500 <Link#14> f6:0c:44:f4:ad:f2 0 0 2260 0 0
awdl0 1500 fe80::f40c: fe80:e::f40c:44ff 0 - 2260 - -
llw0 1500 <Link#15> f6:0c:44:f4:ad:f2 0 0 0 0 0
llw0 1500 fe80::f40c: fe80:f::f40c:44ff 0 - 0 - -
utun0 1500 <Link#16> 0 0 0 0 0
utun0 1500 airbook.loc fe80:10::4ec3:d09 0 - 0 - -
utun1 1380 <Link#17> 0 0 0 0 0
utun1 1380 airbook.loc fe80:11::98ed:570 0 - 0 - -
utun2 2000 <Link#18> 0 0 0 0 0
utun2 2000 airbook.loc fe80:12::416:ebf1 0 - 0 - -
utun3 1000 <Link#19> 0 0 0 0 0
utun3 1000 airbook.loc fe80:13::ce81:b1c 0 - 0 - -
```

View File

@@ -0,0 +1,115 @@
# Launchd
#### Exécuter un script bash toutes les 5 minutes:
Copier le script en dehors du dossier Documents
(sinon erreur 126: `/bin/bash: /Users/bruno/Documents/update-motd.sh: Operation not permitted`)
Créer une .plist:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.bruno21.update-motd</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
<string>${HOME}/.local/bin/update-motd.sh</string>
</array>
<key>StartCalendarInterval</key>
<array>
<dict>
<key>Minute</key>
<integer>0</integer>
</dict>
<dict>
<key>Minute</key>
<integer>5</integer>
</dict>
<dict>
<key>Minute</key>
<integer>10</integer>
</dict>
<dict>
<key>Minute</key>
<integer>15</integer>
</dict>
<dict>
<key>Minute</key>
<integer>20</integer>
</dict>
<dict>
<key>Minute</key>
<integer>25</integer>
</dict>
<dict>
<key>Minute</key>
<integer>30</integer>
</dict>
<dict>
<key>Minute</key>
<integer>35</integer>
</dict>
<dict>
<key>Minute</key>
<integer>40</integer>
</dict>
<dict>
<key>Minute</key>
<integer>45</integer>
</dict>
<dict>
<key>Minute</key>
<integer>50</integer>
</dict>
<dict>
<key>Minute</key>
<integer>55</integer>
</dict>
</array>
<key>StandardOutPath</key>
<string>/tmp/com.bruno21.update-motd.out</string>
<key>StandardErrorPath</key>
<string>/tmp/com.bruno21.update-motd.err</string>
</dict>
</plist>
```
La copier dans `$HOME/Library/LaunchAgent`
```bash
cp com.update-motd.plist /Users/bruno/Library/LaunchAgents/
```
puis la charger:
```bash
launchctl load -w /Users/bruno/Library/LaunchAgents/com.bruno21.update-motd.plist
```
Voir si elle est activée:
```bash
launchctl list | grep .update-motd
- 0 com.bruno21.update-motd
```
Pour la retirer:
```bash
launchctl load -w /Users/bruno/Library/LaunchAgents/com.bruno21.update-motd.plist
```
https://apple.stackexchange.com/questions/392789/launchctl-plist-has-a-stderr-that-talks-about-how-getcwd-operation-not-permitted?newreg=7f5230c960a74d99b1105a9f66d9cfa2
https://rakhesh.com/mac/macos-launchctl-commands/

View File

@@ -231,19 +231,22 @@ $ nano /opt/homebrew/etc/httpd/extra/httpd-vhosts.conf
</VirtualHost>
```
#### Redirection de port:
wiki.js tourne sur localhost:3000
Pour le rendre disponible sur wiki.silverbook.local:
Editer le fichier *httpd.conf* et activer les modules `mod_proxy` et `mod_proxy_http`:
##### Editer le fichier *httpd.conf* et activer les modules `mod_proxy` et `mod_proxy_http`:
```http
LoadModule proxy_module lib/httpd/modules/mod_proxy.so
LoadModule proxy_http_module lib/httpd/modules/mod_proxy_http.so
```
Editer le fichier *hosts*:
##### Editer le fichier *hosts*:
```bash
$ sudo nano /etc/hosts
@@ -251,7 +254,7 @@ $ sudo nano /etc/hosts
127.0.0.1 wiki.airbook.local
```
Editer le fichier *httpd-vhosts.conf*:
##### Editer le fichier *httpd-vhosts.conf*:
```http
<VirtualHost *:80>
@@ -260,14 +263,13 @@ Editer le fichier *httpd-vhosts.conf*:
ProxyPassReverse / http://localhost:3000/
ProxyPreserveHost On
</VirtualHost>
```
### SSL:
Activer SSL dans *httpd.conf* (décocher les lignes):
##### Activer SSL dans *httpd.conf* (décocher les lignes):
```http
LoadModule socache_shmcb_module lib/httpd/modules/mod_socache_shmcb.so
@@ -291,7 +293,11 @@ Include /usr/local/etc/httpd/extra/httpd-ssl.conf
Ouvrir le fichier *httpd-ssl.conf*:
##### Ouvrir le fichier *httpd-ssl.conf*:
```bash
$ bbedit /opt/homebrew/etc/httpd/extra/httpd-ssl.conf
```
```bash
# Mac intel
@@ -301,13 +307,12 @@ $ nano /usr/local/etc/httpd/extra/httpd-ssl.conf
$ nano /opt/homebrew/etc/httpd/extra/httpd-ssl.conf
```
Remplacer les lignes:
##### Remplacer les lignes:
| Original | Modifié |
| -------------------------------------- | ----------------------------------- |
| `Listen 8443` | `Listen 443` |
et le bloc:
```http
@@ -330,13 +335,13 @@ par
DocumentRoot "/Users/bruno/Sites"
ServerName airbook.local:443
ServerAdmin bruno@clicclac.info
ErrorLog "/opt/homebrew/var/log/httpd/error_log"
TransferLog "/opt/homebrew/var/log/httpd/access_log"
ErrorLog "/opt/homebrew/var/log/httpd/airbook.local-error_log"
TransferLog "/opt/homebrew/var/log/httpd/airbook.local-access_log"
```
Ouvrir le fichier *httpd-vhosts.conf*:
##### Ouvrir le fichier *httpd-vhosts.conf*:
Rajouter ce bloc pour chaque Virtual Host.
@@ -347,6 +352,8 @@ Rajouter ce bloc pour chaque Virtual Host.
SSLEngine on
SSLCertificateFile "/usr/local/etc/httpd/server.crt"
SSLCertificateKeyFile "/usr/local/etc/httpd/server.key"
ErrorLog "/opt/homebrew/var/log/httpd/airbook.local-error_log"
CustomLog "/opt/homebrew/var/log/httpd/airbook.local-access_log" common
</VirtualHost>
```
@@ -381,7 +388,7 @@ Installer 2 programmes:
$ brew install mkcert nss
```
Installer le serveur de certificat:
##### Installer le serveur de certificat:
```bash
$ mkcert -install
@@ -405,41 +412,48 @@ Enter Password or Pin for "NSS Certificate DB":
# https://github.com/FiloSottile/mkcert/issues/50
```
Créer les dossiers pour les certificats:
##### Créer les dossiers pour les certificats:
```bash
$ cd /opt/homebrew/etc/httpd
$ mkdir certs && cd certs
```
Générer les certificats:
##### Générer les certificats (wildcard):
```bash
$ mkcert airbook.local
$ mkcert airbook.local "*.airbook.local" localhost 127.0.0.1 ::1
$ mkcert airbook.local "*.airbook.local" 192.168.2.39 localhost 127.0.0.1 ::1
Created a new certificate valid for the following names 📜
- "airbook.local"
- "*.airbook.local"
- "localhost"
- "127.0.0.1"
- "::1"
The certificate is at "./airbook.local.pem" and the key at "./airbook.local-key.pem"
Reminder: X.509 wildcards only go one level deep, so this won't match a.b.airbook.local
It will expire on 18 February 2026 🗓
The certificate is at "./airbook.local+4.pem" and the key at "./airbook.local+4-key.pem"
It will expire on 18 April 2026 🗓
```
Un certificat et une clé sont créer pour chaque domaine:
```http
/opt/homebrew/etc/httpd/certs/airbook.local.pem
/opt/homebrew/etc/httpd/certs/airbook.local-key.pem
/opt/homebrew/etc/httpd/certs/airbook.local+4.pem
/opt/homebrew/etc/httpd/certs/airbook.local+4-key.pem
```
Editer le fichier *httpd-ssl.conf* et remplacer les 2 lignes:
##### Editer le fichier *httpd-ssl.conf* et remplacer les 2 lignes:
```http
SSLCertificateFile "/opt/homebrew/etc/httpd/certs/airbook.local.pem"
SSLCertificateKeyFile "/opt/homebrew/etc/httpd/certs/airbook.local-key.pem"
SSLCertificateFile "/opt/homebrew/etc/httpd/certs/airbook.local+4.pem"
SSLCertificateKeyFile "/opt/homebrew/etc/httpd/certs/airbook.local+4-key.pem"
```
Tester la configuration:
##### Tester la configuration:
```bash
$ httpd -t
@@ -448,7 +462,7 @@ Syntax OK
$ apachectl configtest
```
Redémarrer Apache:
##### Redémarrer Apache:
```bash
$ brew services restart httpd
@@ -460,15 +474,31 @@ $ brew services restart httpd
Editer le fichier *httpd-vhosts.conf*:
Rajouter le bloc suivant
Rajouter le/les bloc(s) suivant
```http
<VirtualHost *:443>
ServerAdmin bruno@clicclac.info
DocumentRoot "/Users/bruno/Sites"
ServerName airbook.local
SSLEngine on
SSLCertificateFile "/opt/homebrew/etc/httpd/certs/airbook.local.pem"
SSLCertificateKeyFile "/opt/homebrew/etc/httpd/certs/airbook.local-key.pem"
SSLCertificateFile "/opt/homebrew/etc/httpd/certs/airbook.local+4.pem"
SSLCertificateKeyFile "/opt/homebrew/etc/httpd/certs/airbook.local-key+4.pem"
ErrorLog "/opt/homebrew/var/log/httpd/airbook.local-error_log"
CustomLog "/opt/homebrew/var/log/httpd/airbook.local-access_log" common
</VirtualHost>
```
```http
<VirtualHost *:443>
ServerAdmin bruno@clicclac.info
DocumentRoot "/Users/bruno/Sites/mbv"
ServerName maboiteverte.airbook.local
SSLEngine on
SSLCertificateFile "/opt/homebrew/etc/httpd/certs/airbook.local+4.pem"
SSLCertificateKeyFile "/opt/homebrew/etc/httpd/certs/airbook.local+4-key.pem"
ErrorLog "/opt/homebrew/var/log/httpd/mbv.airbook.local-error_log"
CustomLog "/opt/homebrew/var/log/httpd/mbv.airbook.local-access_log" common
</VirtualHost>
```
@@ -501,9 +531,9 @@ Il faut rajouter les lignes suivantes au PHP.ini
```ini
[openssl]
openssl.cafile="/usr/local/etc/httpd/server.crt"
openssl.cafile="/opt/homebrew/etc/httpd/certs/airbook.local.pem"
# D'après SSLCertificateFile "/usr/local/etc/httpd/server.crt" du httpd-ssl.conf
# D'après SSLCertificateFile "/opt/homebrew/etc/httpd/certs/airbook.local.pem" du httpd-ssl.conf
```
@@ -522,17 +552,19 @@ ErrorDocument 404 /custom_404.html
ErrorDocument 500 /custom_50x.html
```
[:fa-link: https://httpd.apache.org/docs/2.4/fr/custom-error.html](https://httpd.apache.org/docs/2.4/fr/custom-error.html)
### Messages d'erreur personnalisés multilingues:
Ouvrir le fichier *httpd-ssl.conf* et dé-commenter les lignes suivantes:
Ouvrir le fichier *httpd.conf* et dé-commenter les lignes suivantes:
```http
LoadModule include_module lib/httpd/modules/mod_include.so
LoadModule negotiation_module lib/httpd/modules/mod_negotiation.so
Include /usr/local/etc/httpd/extra/httpd-multilang-errordoc.conf
Include /opt/homebrew/etc/httpd/extra/httpd-multilang-errordoc.conf
```
@@ -543,13 +575,13 @@ Include /usr/local/etc/httpd/extra/httpd-multilang-errordoc.conf
$ brew install homebrew/php/phpmyadmin
```
Le fichier de configuration se trouve là:`/usr/local/etc/phpmyadmin.config.inc.php`
Le fichier de configuration se trouve là:`/opt/homebrew/etc/phpmyadmin.config.inc.php`
Ajouter le bloc qui suit dans le **httpd.conf**
```http
Alias /phpmyadmin /usr/local/share/phpmyadmin
<Directory /usr/local/share/phpmyadmin/>
Alias /phpmyadmin /opt/homebrew/share/phpmyadmin
<Directory /opt/homebrew/share/phpmyadmin/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
<IfModule mod_authz_core.c>
@@ -564,9 +596,7 @@ Ajouter le bloc qui suit dans le **httpd.conf**
### Message derreur personnalisé:
[:fa-link: https://httpd.apache.org/docs/2.4/fr/custom-error.html](https://httpd.apache.org/docs/2.4/fr/custom-error.html)
@@ -746,6 +776,16 @@ ScriptAlias /cgi-bin/ "/opt/homebrew/var/www/cgi-bin/"
#### Désinstallation
```bash
$ brew uninstall httpd
$ rm -rf /opt/homebrew/etc/httpd
```
### Liens:
[:fa-link: https://getgrav.org/blog/macos-bigsur-apache-multiple-php-versions](https://getgrav.org/blog/macos-bigsur-apache-multiple-php-versions)

View File

@@ -130,3 +130,140 @@ $ sphp 7.4
#### Xdebug
##### Installation:
```bash
$ sphp 8.2
$ pecl uninstall -r xdebug
$ pecl install xdebug
```
```bash
$ sphp 8.3
$ pecl uninstall -r xdebug
$ pecl install xdebug-3.3.0alpha3
```
##### Configuration:
```bash
$ bbedit /opt/homebrew/etc/php/8.2/conf.d/ext-xdebug.ini
$ bbedit /opt/homebrew/etc/php/8.3/conf.d/ext-xdebug.ini
```
```http
[xdebug]
zend_extension="xdebug.so"
xdebug.mode=debug
```
#### Xdebug Switcher:
##### Installation:
```bash
$ curl -L https://gist.githubusercontent.com/rhukster/073a2c1270ccb2c6868e7aced92001cf/raw/c1629293bcf628cd6ded20c201c4ef0a2fa79144/xdebug > /opt/homebrew/bin/xdebug
$ chmod +x /opt/homebrew/bin/xdebug
```
```bash
$ xdebug
Usage: xdebug <on | off> [--no-server-restart]
You are running PHP v8.2 with Xdebug enabled
PHP 8.2.14 (cli) (built: Dec 20 2023 06:28:06) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.14, Copyright (c) Zend Technologies
with Zend OPcache v8.2.14, Copyright (c), by Zend Technologies
with Xdebug v3.3.1, Copyright (c) 2002-2023, by Derick Rethans
```
#### APCu
##### Installation:
```bash
$ pecl install apcu
# fatal error: 'pcre2.h' file not found
$ ln -s /opt/homebrew/Cellar/pcre2/10.42/include/pcre2.h /opt/homebrew/Cellar/php/
ln -s /opt/homebrew/Cellar/pcre2/10.42/include/pcre2.h /opt/homebrew/Cellar/php/8.3.1/include/php/ext/pcre/pcre2.h
ln -s /opt/homebrew/Cellar/pcre2/10.42/include/pcre2.h /opt/homebrew/Cellar/php@8.2/8.2.14/include/php/ext/pcre/pcre2.h
```
```bash
$ sphp 8.2
$ pecl install apcu
```
```bash
$ sphp 8.3
$ pecl uninstall -r apcu
$ pecl install apcu
```
##### Configuration:
```bash
$ bbedit /opt/homebrew/etc/php/8.2/conf.d/ext-apcu.ini
$ bbedit /opt/homebrew/etc/php/8.3/conf.d/ext-apcu.ini
```
```http
[apcu]
extension="apcu.so"
apc.enabled=1
apc.shm_size=64M
apc.ttl=7200
apc.enable_cli=1
```
#### YAML
Installation:
```bash
$ brew install libyaml
```
```bash
$ sphp 8.2
$ pecl install yaml
# Au prompt "Please provide the prefix of libyaml installation [autodetect]", entrer:
# /opt/homebrew/Cellar/libyaml/0.2.5
```
```bash
$ sphp 8.3
$ pecl uninstall -r yaml
$ pecl install yaml
# Au prompt "Please provide the prefix of libyaml installation [autodetect]", entrer:
# /opt/homebrew/Cellar/libyaml/0.2.5
```
##### Configuration:
```bash
$ bbedit /opt/homebrew/etc/php/8.2/conf.d/ext-yaml.ini
$ bbedit /opt/homebrew/etc/php/8.3/conf.d/ext-yaml.ini
```
```http
[yaml]
extension="yaml.so"
```

View File

@@ -19,7 +19,7 @@ $ brew services restart redis
### Le fichier de config:
```bash
/opt/homebrew/etc/redis.conf
$ nano /opt/homebrew/etc/redis.conf
```
### Tester redis:
@@ -51,7 +51,7 @@ $ redis-server
30766:M 25 Jul 2022 11:46:58.613 # WARNING: The TCP backlog setting of 511 cannot be enforced because kern.ipc.somaxconn is set to the lower value of 128.
30766:M 25 Jul 2022 11:46:58.613 # Server initialized
30766:M 25 Jul 2022 11:46:58.613 * Ready to accept connections
30766:M 25 Jul 2022 11:46:58.613 * Ready to accept connections tcp
```