18-04-2020

This commit is contained in:
2020-04-18 07:23:09 +02:00
parent 32bfa1a628
commit 7e64b5c348
12 changed files with 436 additions and 101 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
/central_docs /central_docs
.DS_Store .DS_Store
*.plist

View File

@@ -39,6 +39,16 @@ root@DiskStation:~ # tar -xvf archive.tar
#### tgz
Extraire les fichiers de l'archive: **tar zxvf**
```bash
root@DiskStation:~ # tar zxvf archive.tgz
```
#### gzip #### gzip
Compresser avec gzip: Compresser avec gzip:

View File

@@ -8,6 +8,15 @@ Connected to ftp.cluster011.ovh.net.
Changing to: /home/funnymac/www Changing to: /home/funnymac/www
``` ```
```bash
bruno@localhost:~$ sftp funnymac@ftp.cluster011.ovh.net
funnymac@ftp.cluster011.ovh.net's password:
Connected to ftp.cluster011.ovh.net.
sftp> dir
```
#### Changer de dossier: #### Changer de dossier:
```bash ```bash

View File

@@ -2,7 +2,7 @@
#### Commande plesk:
```bash ```bash
~# plesk ~# plesk
@@ -30,7 +30,7 @@ plesk installer --select-release-current --install-component php7.2
Réparer Plesk: #### Réparer Plesk:
```bash ```bash
$ plesk installer --select-release-current --reinstall-patch --upgrade-installed-components $ plesk installer --select-release-current --reinstall-patch --upgrade-installed-components
@@ -40,7 +40,7 @@ $ plesk repair installation
Tester la zone DNS: #### Tester la zone DNS:
```bash ```bash
# plesk bin dns --info maboiteverte.fr # plesk bin dns --info maboiteverte.fr
@@ -64,7 +64,7 @@ SUCCESS: Getting information for Domain 'maboiteverte.fr' complete.
Ajouter l'`user` bruno au groupe `sudo`: #### Ajouter l'`user` bruno au groupe `sudo`:
```bash ```bash
# ubuntu: # ubuntu:
@@ -74,22 +74,31 @@ root@localhost:~# usermod -aG sudo bruno
Nextcloud: #### Redémarrer MySQL / MariaDB:
```bash ```bash
bruno@localhost:~/httpdocs/nextcloud$ sudo -u bruno /opt/plesk/php/7.3/bin/php occ maintenance:repair # sous root:
service mysql restart || service mariadb restart || service mysqld restart
``` ```
Liste des extzensions installées: Liste des extensions installées:
plesk bin extension --list ```bash
plesk bin extension --list
```
Réparer Plesk : Réparer Plesk :
```bash
plesk repair installation plesk repair installation
```
Réparer les permissions d'un site: Réparer les permissions d'un site:
```bash
plesk repair fs example.com plesk repair fs example.com
```

69
docs/Plesk/nextcloud.md Normal file
View File

@@ -0,0 +1,69 @@
# Nextcloud:
https://docs.nextcloud.com/server/18/admin_manual/index.html
```bash
~/httpdocs/nextcloud$ sudo -u bruno /opt/plesk/php/7.3/bin/php occ maintenance:mode --on
The current PHP memory limit is below the recommended value of 512MB.
Maintenance mode enabled
```
```bash
~/httpdocs/nextcloud$ sudo -u bruno /opt/plesk/php/7.3/bin/php occ maintenance:repair
```
```bash
~/httpdocs/nextcloud$ sudo -u bruno /opt/plesk/php/7.3/bin/php updater/updater.phar
Nextcloud Updater - version: v16.0.3-3-ga0c2b25 dirty
Current version is 18.0.3.
No update available.
Nothing to do.
```
```bash
~/httpdocs/nextcloud$ sudo -u bruno /opt/plesk/php/7.3/bin/php occ upgrade
The current PHP memory limit is below the recommended value of 512MB.
Nextcloud is already latest version
```
```bash
~/httpdocs/nextcloud$ sudo -u bruno /opt/plesk/php/7.3/bin/php occ maintenance:mode --off
The current PHP memory limit is below the recommended value of 512MB.
Maintenance mode disabled
```
```bash
~/httpdocs/nextcloud$ sudo -u bruno /opt/plesk/php/7.3/bin/php console.php files:scan --all
The current PHP memory limit is below the recommended value of 512MB.
Starting scan for user 1 out of 1 (bruno)
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 5 | 16 | 00:00:00 |
+---------+-------+--------------+
```
#### Joplin:
```bash
bruno@localhost:~/.nextcloud/data/9d67e72f9807/bruno/files$ l
total 10728
drwxr-xr-x 5 bruno psacln 4096 Apr 12 08:39 .
drwxr-xr-x 6 bruno psacln 4096 Apr 12 09:59 ..
drwxr-xr-x 2 bruno psacln 4096 Apr 11 19:15 Documents
drwxr-xr-x 5 bruno psacln 16384 Apr 12 12:55 .Joplin
-rw-r--r-- 1 bruno psacln 3963036 Apr 11 19:15 'Nextcloud intro.mp4'
-rw-r--r-- 1 bruno psacln 6933565 Apr 11 19:15 'Nextcloud Manual.pdf'
-rw-r--r-- 1 bruno psacln 50598 Apr 11 19:15 Nextcloud.png
drwxr-xr-x 2 bruno psacln 4096 Apr 11 19:15 Photos
```

View File

@@ -33,6 +33,16 @@ root@DS916:~#
### Taches panifiée:
Exécuter un script par un utilisateur xxx: ici le script cron.php de Nextcloud doit être lancé par http
```bash
sudo -u http /usr/local/bin/php73 -f /volume1/web/nextcloud/cron.php
```
### Services: ### Services:
#### Afficher la liste des services #### Afficher la liste des services
@@ -307,8 +317,8 @@ root@DS916:/volume1/@appstore/PHP7.0/misc# nano extension_list.json
/bin/php /bin/php
- PHP 5.6 (Package PHP 5) - PHP 5.6 (Package PHP 5)
/usr/local/bin/php56 /usr/local/bin/php56
- PHP 7.0 (Package PHP 7) - PHP 7.3 (Package PHP 7)
/usr/local/bin/php70 /usr/local/bin/php73
Pour Apache, c'est la version choisie dans WebStation qui est active. Pour Apache, c'est la version choisie dans WebStation qui est active.
@@ -454,90 +464,6 @@ You are already using composer version 1.7.1 (stable channel).
### Gitea:
##### Créer le paquet:
[Gitea-spk](https://github.com/flipswitchingmonkey/gitea-spk)
##### Installer le paquet:
```bash
cd ~/git/gitea-spk/
sudo synopkg install gitea-1.10.3-linux-amd64.spk
```
Créer un dossier partagé `gitea`, puis éditer les permissions du dossier:
Permissions -> Utilisateurs du système interne -> gitea lecture /écriture
##### Accéder au site:
http://localhost:3000 . Si Safari ne peut y accéder parce que la connexion n'est pas sécurisée (*HSTS Policy*):
1. `command + ,`
2. **Confidentialité** -> **Gérer les données de sites web**...
3. Chercher *localhost*
4. Clic **Supprimer**
DSM -> Portail des applications -> Proxy inversé
| | Source | Destination |
| ---------- | -------------------- | ----------- |
| Protocole | HTTPS | HTTP |
| Nom d'hôte | clicclac.synology.me | localhost |
| Port | 3001 | 3000 |
Apache:
```bash
<VirtualHost *:80>
ProxyPreserveHost On
ProxyRequests off
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
</VirtualHost>
```
Nginx:
```bash
server {
listen 80;
server_name git.example.com;
location / {
proxy_pass http://localhost:3000;
}
}
```
Le fichier de config: `/usr/local/gitea/gitea/custom/conf/app.ini`
`/etc/gitea/app.ini` sur le vps mbv
##### Créer un repo sur sur le serveur gitea:
Il est placé ici: `/volume1/gitea/gitea/gitea-repositories/bruno/test.git`
Sur le client, on clone le repo:
```bash
$ ~/Documents/Git git clone bruno@dsm916e:/volume1/gitea/gitea/gitea-repositories/bruno/test.git
```
git remote add origin bruno@dsm916e:/volume1/Repositories/wp2012.git
### Erreurs: ### Erreurs:
/bin/nano /bin/nano

84
docs/Synology/gitea.md Normal file
View File

@@ -0,0 +1,84 @@
### Gitea:
##### Créer le paquet:
[Gitea-spk](https://github.com/flipswitchingmonkey/gitea-spk)
##### Installer le paquet:
```bash
cd ~/git/gitea-spk/
sudo synopkg install gitea-1.10.3-linux-amd64.spk
```
Créer un dossier partagé `gitea`, puis éditer les permissions du dossier:
Permissions -> Utilisateurs du système interne -> gitea lecture /écriture
##### Accéder au site:
http://localhost:3000 . Si Safari ne peut y accéder parce que la connexion n'est pas sécurisée (*HSTS Policy*):
1. `command + ,`
2. **Confidentialité** -> **Gérer les données de sites web**...
3. Chercher *localhost*
4. Clic **Supprimer**
DSM -> Portail des applications -> Proxy inversé
| | Source | Destination |
| ---------- | -------------------- | ----------- |
| Protocole | HTTPS | HTTP |
| Nom d'hôte | clicclac.synology.me | localhost |
| Port | 3001 | 3000 |
Apache:
```bash
<VirtualHost *:80>
ProxyPreserveHost On
ProxyRequests off
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
</VirtualHost>
```
Nginx:
```bash
server {
listen 80;
server_name git.example.com;
location / {
proxy_pass http://localhost:3000;
}
}
```
Le fichier de config: `/usr/local/gitea/gitea/custom/conf/app.ini`
`/etc/gitea/app.ini` sur le vps mbv
##### Créer un repo sur sur le serveur gitea:
Il est placé ici: `/volume1/gitea/gitea/gitea-repositories/bruno/test.git`
Sur le client, on clone le repo:
```bash
$ ~/Documents/Git git clone bruno@dsm916e:/volume1/gitea/gitea/gitea-repositories/bruno/test.git
```
git remote add origin bruno@dsm916e:/volume1/Repositories/wp2012.git

222
docs/Synology/nextcloud.md Normal file
View File

@@ -0,0 +1,222 @@
# Nextcloud
https://docs.nextcloud.com/server/18/admin_manual/index.html
#### Mise à jour 18.0.1 -> 18.0.3
```bash
bruno@DS916:/volume1/web/nextcloud $ sudo -u http /usr/local/bin/php73 updater/updater.phar
Nextcloud Updater - version: v16.0.3-3-ga0c2b25 dirty
Current version is 18.0.1.
Update to Nextcloud 18.0.3 available. (channel: "stable")
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-18.0.3.zip
Open changelog ↗
Steps that will be executed:
[ ] Check for expected files
[ ] Check for write permissions
[ ] Create backup
[ ] Downloading
[ ] Verify integrity
[ ] Extracting
[ ] Enable maintenance mode
[ ] Replace entry points
[ ] Delete old files
[ ] Move new files in place
[ ] Done
Start update? [y/N] y
Info: Pressing Ctrl-C will finish the currently running step and then stops the updater.
[] Check for expected files
[] Check for write permissions
[] Create backup
[] Downloading
[] Verify integrity
[] Extracting
[] Enable maintenance mode
[] Replace entry points
[] Delete old files
[] Move new files in place
[] Done
Update of code successful.
Should the "occ upgrade" command be executed? [Y/n] Y
This version of Nextcloud requires at least PHP 7.2<br/>You are currently running 5.6.11. Please update your PHP version.
Keep maintenance mode active? [y/N] ^C # Ctrl-C
This version of Nextcloud requires at least PHP 7.2<br/>You are currently running 5.6.11. Please update your PHP version.
Maintenance mode is disabled
```
A *"Should the "occ upgrade" command be executed? [Y/n]"*, répondre Non.
La version par défaut de PHP est la 5.6.11, ce qui est insuffisant (7.2 requis). On relance la suite avec la bonne version de php:
```bash
bruno@DS916:/volume1/web/nextcloud $ sudo -u http /usr/local/bin/php73 occ maintenance:mode --on
Password:
The current PHP memory limit is below the recommended value of 512MB.
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Maintenance mode already enabled
```
```bash
bruno@DS916:/volume1/web/nextcloud $ sudo -u http /usr/local/bin/php73 occ upgrade
The current PHP memory limit is below the recommended value of 512MB.
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Set log level to debug
Updating database schema
Updated database
Checking for update of app accessibility in appstore
Checked for update of app "accessibility" in appstore
Checking for update of app activity in appstore
Checked for update of app "activity" in appstore
Checking for update of app admin_audit in appstore
Checked for update of app "admin_audit" in appstore
.../...
Checking for update of app viewer in appstore
Checked for update of app "viewer" in appstore
Checking for update of app workflowengine in appstore
Checked for update of app "workflowengine" in appstore
Starting code integrity check...
Finished code integrity check
Update successful
Maintenance mode is kept active
Reset log level
bruno@DS916:/volume1/web/nextcloud $ sudo -u http /usr/local/bin/php73 occ maintenance:mode --off
The current PHP memory limit is below the recommended value of 512MB.
Maintenance mode disabled
```
#### Mode maintenance:
```bash
bruno@DS916:/volume1/web/nextcloud $ sudo -u http /usr/local/bin/php73 occ maintenance:mode --on
Password:
The current PHP memory limit is below the recommended value of 512MB.
Maintenance mode enabled
```
#### Réparation:
```bash
bruno@DS916:/volume1/web/nextcloud $ sudo -u http /usr/local/bin/php73 occ maintenance:repair
Password:
The current PHP memory limit is below the recommended value of 512MB.
Nextcloud is in maintenance mode - no apps have been loaded
- Repair MySQL collation
- All tables already have the correct collation -> nothing to do
- Repair mime types
- Clean tags and favorites
- 0 tags of deleted users have been removed.
- 0 tags for delete files have been removed.
- 0 tag entries for deleted tags have been removed.
- 0 tags with no entries have been removed.
- Repair invalid shares
.../...
```
#### Ajouter les index manquants à la base de donnée:
```bash
bruno@DS916:/volume1/web/nextcloud $ sudo -u http /usr/local/bin/php73 occ db:add-missing-indices
The current PHP memory limit is below the recommended value of 512MB.
Check indices of the share table.
Check indices of the filecache table.
Check indices of the twofactor_providers table.
Check indices of the login_flow_v2 table.
Check indices of the whats_new table.
Check indices of the cards table.
Check indices of the cards_properties table.
Check indices of the calendarobjects_props table.
Adding calendarobject_calid_index index to the calendarobjects_props table, this can take some time...
calendarobjects_props table updated successfully.
Check indices of the schedulingobjects table.
Adding schedulobj_principuri_index index to the schedulingobjects table, this can take some time...
schedulingobjects table updated successfully.
```
#### Quitter le mode maintenance:
```bash
bruno@DS916:/volume1/web/nextcloud $ sudo -u http /usr/local/bin/php73 occ maintenance:mode --off
Password:
The current PHP memory limit is below the recommended value of 512MB.
Maintenance mode disabled
```
Ajouter les 2 lignes suivantes au `/usr/local/etc/apache22/sites-enabled/httpd.conf`
```bash
Redirect 301 /.well-known/carddav /nextcloud/remote.php/dav
Redirect 301 /.well-known/caldav /nextcloud/remote.php/dav
```
puis redémarrer Apache:
```bash
$ sudo stop pkg-apache22
pkg-apache22 stop/waiting
$ sudo start pkg-apache22
pkg-apache22 start/running, process 16823
$ reload pkg-apache22
```
#### Exécuter les taches cron de Nextcloud :
<u>Webcron:</u> [cron-job.org](https://cron-job.org/en/)
<u>Planificateur de taches Synology:</u>
Tache planifiée -> script défini par l'utilisateur:
- Utilisateur: root
- Programmer: Quotidienne
- Exécuter la commande: `sudo -u http /usr/local/bin/php73 -f /volume1/web/nextcloud/cron.php`
<u>Crontab:</u>
```bash
$ sudo -i
# Edit /etc/crontab
$ nano /etc/crontab
#minute hour mday month wday who command
49 0 * * 2 root /usr/local/bin/php73 -f /volume1/web/nextcloud/cron.php
49/TAB/0/TAB/*/TAB/*/TAB/2/TAB/root/TAB/commande
#Restart the cron deamon by typing:
$synoservice -restart crond
```
Tester la tache dans le terminal:
```bash
# ok
sudo -u http /usr/local/bin/php73 -f /volume1/web/nextcloud/cron.php
```

View File

@@ -1,10 +1,13 @@
# Logs # Logs
Voir application Console -> rapport d'historique
/var/log/system.log
/var/log/wifi.log
/var/log/
/usr/local/var/log/httpd/access_log /usr/local/var/log/httpd/access_log
/usr/local/var/log/httpd/error_log /usr/local/var/log/httpd/error_log

View File

@@ -145,11 +145,11 @@ bruno@SilverBook:~$ cd Sites/node_modules/
puis puis
- Liste package installé: `nom ls` - Liste package installé: `npm ls`
- Mises à jour disponibles: `nom outdated` - Mises à jour disponibles: `npm outdated`
- Installer une m-à-j: `nom update` - Installer une m-à-j: `npm update`
- Installer un package: `nom install package` - Installer un package: `npm install package`
- Désinstaller un package: `nom uninstall package` - Désinstaller un package: `npm uninstall package`

View File

@@ -168,6 +168,8 @@ nav:
- bash: Synology/bash.md - bash: Synology/bash.md
- DSM 6: Synology/dsm6.md - DSM 6: Synology/dsm6.md
- eadir: Synology/eadir.md - eadir: Synology/eadir.md
- Gitea: Synology/gitea.md
- Nextcloud: Synology/nextcloud.md
- oPKG: - oPKG:
- iPKG (DSM5): Synology/opkg/iPKG5.md - iPKG (DSM5): Synology/opkg/iPKG5.md
- iPKG (DSM6): Synology/opkg/iPKG6.md - iPKG (DSM6): Synology/opkg/iPKG6.md