Raspberry ( Raspbian : stretch ) / Git Server : Installation en bref

Etape n°1 : Installation de l’OS ( 2018-06-27-raspbian-stretch-lite.img )  sur la carte SD ( Avec ApplePi si vous êtes sous MacOS ) .

-> Voir : https://www.cyber-neurones.org/2018/09/raspberry-mac-os-applepi-baker-creer-une-carte-sd-pour-le-raspberry/ .

$ hostnamectl
   Static hostname: raspberrypi
         Icon name: computer
        Machine ID: e3de61955d6646558bc520db1abbc48c
           Boot ID: 38574747c8294acab1c292cb2c8023c4
  Operating System: Raspbian GNU/Linux 9 (stretch)
            Kernel: Linux 4.14.50-v7+
      Architecture: arm

Etape n°2 : Changement de l’IP.

-> Voir : https://www.cyber-neurones.org/2018/09/raspberry-configuration-reseau-sur-une-raspbian-gnu-linux-9-stretch-avec-une-freebox/ .

Modification de /etc/dhcpcd.conf , mais aussi de /etc/hostname (pour le nom RASP7, et oui le 8ème Raspberry : 192.168.0.76 ) . Le login : pi et le mot de passe raspberry (enfin rqspberry )

Et lancement du service ssh ( afin de supprimer écran/clavier et faire à distance ).

$ sudo systemctl enable ssh.service
$ sudo systemctl start ssh.service
$ sudo apt-get upgrade
$ sudo apt-get update

Changement du mot de passe ( commande passwd ) … et reboot.

Etape n°3 :  Installation de GIT

$ sudo apt-get install wget git-core git
$ sudo apt-get install -y usbutils

Création de l’utilisateur et du groupe git

$ sudo adduser --disabled-password --gecos "" git && echo "git:git"
$ sudo passwd git
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

Création du répertoire pour les sources :

$ sudo mkdir /sources
$ sudo mkdir Projet1.git
$ sudo chown -R git.git /sources
$ sudo -u git git init --bare
Initialized empty Git repository in /sources/Projet1.git/

Le but est ensuite de le déplacer vers un composant USB …

Ensuite on va sur le client :

$ git init
$ git remote add master git@192.168.0.76:/sources/Projet1.git
$ git add *
$ git commit * -m "Orgin"
$ git push origin master
git@192.168.0.76's password: 
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 1.30 KiB | 1.30 MiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To 192.168.0.76:/sources/Projet1.git
 * [new branch]      master -> master

Etape n°4 : Interface graphique et test .

Installation d’une interface graphique :

$ curl https://raw.githubusercontent.com/alberthier/git-webui/master/install/installer.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1855  100  1855    0     0   3506      0 --:--:-- --:--:-- --:--:--  3513
Cloning git-webui repository
Cloning into '.git-webui'...
remote: Enumerating objects: 48, done.
remote: Counting objects: 100% (48/48), done.
remote: Compressing objects: 100% (38/38), done.
remote: Total 48 (delta 4), reused 33 (delta 2), pack-reused 0
Unpacking objects: 100% (48/48), done.
Enabling auto update
Installing 'webui' alias

Je repasse sous le serveur pour faire un test :

$ git clone git@192.168.0.76:/sources/Projet1.git
Cloning into 'Projet1'...
git@192.168.0.76's password: 
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3/3), done.
$ cd Projet1/
pi@raspberrypi:~/Projet1 $ git webui
Serving at http://localhost:8000

J’ai bien une interface Web sur http://192.168.0.76:8000 …

C’est donc simple et facile … il faut pas s’en passer 🙂

Etape n°5 : Installation de MUNIN ( comme toujours )

Le client MUNIN :

$ sudo apt-get install munin munin-node munin-plugins-extra libnet-snmp-perl
$ sudo nano /etc/munin/munin-node.conf
...
allow ^127\.0\.0\.1$
allow ^192\.168\.0\.80$
allow ^::1$
...
$ sudo munin-node-configure --shell  | sh -x

Sur mon serveur MUNIN ( 192.168.0.80 ) :

$ sudo vi /etc/munin/munin.conf 
...
[RASP8-GIT]
    address 192.168.0.76
    use_node_name yes
...
$ sudo su - munin --shell=/bin/bash
$ /usr/share/munin/munin-update --nofork --debug
$ exit
$ sudo service munin-node restart

 

Mac OS : OwnCloud : Vraiment bien

Je viens de tester la version OwnCloud Mac Os, vers mon Raspberry Pi ( https://www.cyber-neurones.org/2018/11/raspberry-owncloud-installation-en-bref/  ) . C’est vraiment très stable … Je pense que je vais dire « Bye-Bye Cozy.Cloud » et les nombreux fichiers conflicts.

Quand je regarde la charge via Munin sur le Raspberry Pi :

Je pense que l’on compte Cozy.Cloud va servir uniquement à rapatrier les données de Digiposte. En plus en terme de sécurité c’est mieux d’avoir son propre Raspberry Pi que d’avoir les données sur le Cloud.

A suivre.

Raspberry ( Raspbian : stretch ) / OwnCloud (10.0.10) : Installation en bref …

Etape n°1 : Installation de l’OS ( 2018-06-27-raspbian-stretch-lite.img )  sur la carte SD ( Avec ApplePi si vous êtes sous MacOS ) .

-> Voir : https://www.cyber-neurones.org/2018/09/raspberry-mac-os-applepi-baker-creer-une-carte-sd-pour-le-raspberry/ .

$ hostnamectl
   Static hostname: raspberrypi
         Icon name: computer
        Machine ID: 0f6c6ab22a3449b586fc81ca195ae839
           Boot ID: d83331ef484a4e6a94bcdf486eb270c1
  Operating System: Raspbian GNU/Linux 9 (stretch)
            Kernel: Linux 4.14.50-v7+
      Architecture: arm

Etape n°2 : Changement de l’IP.

-> Voir : https://www.cyber-neurones.org/2018/09/raspberry-configuration-reseau-sur-une-raspbian-gnu-linux-9-stretch-avec-une-freebox/ .

Modification de /etc/dhcpcd.conf , mais aussi de /etc/hostname (pour le nom RASP7, et oui le 7ème Raspberry : 192.168.0.75 ) . Le login : pi et le mot de passe raspberry (enfin rqspberry )

Et lancement du service ssh ( afin de supprimer écran/clavier et faire à distance ).

$ sudo systemctl enable ssh.service
$ sudo systemctl start ssh.service
$ sudo apt-get update

Changement du mot de passe ( commande passwd ) … et reboot.

Etape n°3 :  Installation de OwnCloud 

Installation du package :

$ sudo apt-get upgrade
$ sudo apt-get install owncloud
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 owncloud : Depends: php-assetic but it is not going to be installed
            Depends: php-doctrine-dbal (< 2.5) but 2.5.4-2 is to be installed
            Depends: php-opencloud but it is not going to be installed
            Depends: php-pimple (< 2) but it is not going to be installed Depends: php5 (>= 5.3.8) but it is not installable
            Depends: php5-cli but it is not installable
            Depends: php5-gd but it is not installable
            Depends: php5-json but it is not installable
            Depends: php5-mysql but it is not installable or
                     php5-pgsql but it is not installable or
                     php5-sqlite but it is not installable
            Recommends: exim4 but it is not going to be installed or
                        mail-transport-agent
            Recommends: php-aws-sdk (< 3) but it is not going to be installed Recommends: php-crypt-blowfish (>= 1.1.0~RC2-2~) but it is not going to be installed
            Recommends: php-dropbox but it is not going to be installed
            Recommends: php-google-api-php-client (< 1) but it is not going to be installed
            Recommends: php5-apcu but it is not installable or
                        php5-xcache but it is not installable
            Recommends: php5-curl but it is not installable
            Recommends: php5-imap but it is not installable
            Recommends: php5-intl but it is not installable
            Recommends: php5-ldap but it is not installable
            Recommends: php5-mcrypt but it is not installable

C’est ce que j’appelle un mauvais départ 😉
Bizarre l’erreur quand je vois un article : https://owncloud.org/news/php-7-is-here-and-owncloud-is-ready/ : PHP 7 Is Here And ownCloud Is Ready .

Je commence donc par :

$ sudo apt-get install php
$ sudo apt-get install smbclient
$ sudo apt-get install exim4

Pour rappel, je suis en version « stretch » :

$ cat /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Je continue donc avec l’installation de MariaDB ( MySQL ) :

$ sudo apt install -y apache2 mariadb-server libapache2-mod-php7.0 php7.0-gd php7.0-json php7.0-mysql php7.0-curl php7.0-intl php7.0-mcrypt php-imagick php7.0-zip php7.0-xml php7.0-mbstring
...
$ sudo apt-get install -y php php-gd php-curl php-zip php-dom php-xml php-simplexml php-mbstring

Ensuite :

$ cd /tmp
$ wget https://download.owncloud.org/community/owncloud-10.0.10.tar.bz2
$ cd /var/www/html
$ sudo tar xjf /tmp/owncloud-10.0.10.tar.bz2
$ sudo chown -R www-data:www-data owncloud
$ sudo chmod -R 755 owncloud
$ sudo rm -f /tmp/owncloud-10.0.10.tar.bz2

Etape n°4 : Configuration de la base de donnée

$ sudo mysql --user=root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 7
Server version: 10.1.23-MariaDB-9+deb9u1 Raspbian 9.0

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> CREATE DATABASE owncloud;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> GRANT ALL ON owncloud.* to 'owncloud'@'localhost' IDENTIFIED BY '_password_';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> quit
Bye
pi@raspb

Etape n°5 : Lancement du site : http://192.168.0.xx/owncloud/index.php

Aie …

Un reboot s’impose.

Après le reboot c’est nettement mieux :

Et c’est fini :

Etape n°6 : J’installe toujours Munin sur mes serveurs :

Le client MUNIN :

$ sudo apt-get install munin munin-node munin-plugins-extra libnet-snmp-perl
$ sudo nano /etc/munin/munin-node.conf
...
allow ^127\.0\.0\.1$
allow ^192\.168\.0\.80$
allow ^::1$
...
$ sudo munin-node-configure --shell  | sh -x

Sur mon serveur MUNI N:

$ sudo vi /etc/munin/munin.conf 
...
[RASP7-OWNCLOUD]
    address 192.168.0.75
    use_node_name yes
...
$ sudo su - munin --shell=/bin/bash
$ /usr/share/munin/munin-update --nofork --debug
$ exit
$ sudo service munin-node restart

A suivre :

Il va falloir remplir le disque maintenant :

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        59G  1.9G   55G   4% /
devtmpfs        460M     0  460M   0% /dev
tmpfs           464M     0  464M   0% /dev/shm
tmpfs           464M  6.3M  458M   2% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           464M     0  464M   0% /sys/fs/cgroup
/dev/mmcblk0p1   43M   22M   21M  52% /boot
tmpfs            93M     0   93M   0% /run/user/1000

Un petit glisser coller de 5 Go avec plus de 8000 fichiers :

Voici les graphiques Munin suite au transfert :

Raspberry : Munin : les graphiques de la Freebox après un mois

Pour faire suite : https://www.cyber-neurones.org/2018/09/raspberry-munin-les-premiers-graphiques-de-la-freebox/ .Raspberry : Munin : les premiers graphiques de la Freebox.

Voici les graphiques après un mois :

En ce moment, je suis en mode : Misère (il suffit de voir :Freebox status). Et comme toujours le support n’est pas joignable …