Nextcloud Server su Raspberry Pi

 

 Nextcloud Server su Raspberry Pi

Nextcloud Server su Raspberry Pi

 

Guida su come installare un server, utilizzando Nextcloud su Raspberry Pi 3/4. A differenza della guida precedente, dove ho utilizzato Nginx come web server, adesso utilizzerò Apache2.  Ci saranno anche 10 consigli per rendere più sicuro il server.

Prerequisiti ed info
  • Raspberry Pi 3/4
  • Raspberry Pi OS Bullseye già installato con accesso ssh.
  • Consiglio di utilizzare rpi-imager per preparare la sd card, e nelle impostazioni abilitare subito ssh, e sopratutto creare un nuovo utente.
  • La guida è stata testata su una installazione pulita di Raspberry Pi OS Lite.
1) Accedere al Raspberry via ssh ed aggiornare
sudo apt update; sudo apt upgrade -y
sudo reboot
2) Installazione php8.0 Mariadb Apache2
sudo apt install apache2 php8.0 php8.0-gd php8.0-sqlite3 php8.0-curl php8.0-zip php8.0-xml php8.0-mbstring php8.0-mysql php8.0-bz2 php8.0-intl php-smbclient php8.0-imap php8.0-gmp libapache2-mod-php8.0 mariadb-server python3-certbot-apache
3) Verifica Apache2
sudo systemctl restart apache2
sudo systemctl status apache2
4) Creazione utente nextcloud e db
sudo mysql -u root -p

ed invio

create database nextcloud_db;
create user nextclouduser@localhost identified by 'YOUR-STRONG-PWD';
grant all privileges on nextcloud_db.* to nextclouduser@localhost identified by 'YOU-STRONG-PWD';
flush privileges;
exit
5) Download Nextcloud
cd /var/www/
sudo wget -v https://download.nextcloud.com/server/releases/latest.zip
sudo unzip latest.zip
sudo rm latest.zip

creazione  della directory di storage, quest’ultima può essere creata anche all’esterno della cartella Nextcloud o su unità esterna.

sudo mkdir -p /var/www/nextcloud/data
sudo chown -R www-data:www-data /var/www/nextcloud/
sudo chmod 750 /var/www/nextcloud/data
6) Configurazione Apache2
sudo nano /etc/apache2/sites-available/nextcloud.conf

ed incollare questa semplice configurazione, che punterà a http://ip-server/nextcloud/

<Directory /var/www/nextcloud/>
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews

<IfModule mod_dav.c>
Dav off
</IfModule>

</Directory>
sudo a2ensite nextcloud.conf
sudo systemctl reload apache2

se si volesse utilizzare invece un proprio dominio:

<VirtualHost *:80>
DocumentRoot /var/www/nextcloud/
ServerName your.domain.com

<Directory /var/www/nextcloud/>
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews

<IfModule mod_dav.c>
Dav off
</IfModule>
</Directory>
</VirtualHost>
sudo a2ensite nextcloud.conf
sudo systemctl reload apache2
7) Nextcloud post installazione

 

Nextcloud Server su Raspberry Piandare all’indirizzo del server: http://my-ip-address/nextcloud/

# hostname -I

creare username e password per l’accesso via web, e poi inserire nextclouduser e nextclouddb. I dati di default saranno in /var/www/nextcloud/data, ma si possono anche spostare successivamente.

8) Tuning Apache2

alcune essenziali modifiche:

sudo nano /etc/php/8.0/apache2/php.ini

trovare queste tre stringhe e modificarle da così:

memory_limit = 128M
post_max_size = 8M
upload_max_filesize = 2M

a così:

memory_limit = 512M
post_max_size = 1024M
upload_max_filesize = 1024M
sudo systemctl restart apache2
9) Certificato SSL

nell’esempio sotto, userò un auto-certificato, ma è consigliato un certificato del tipo Let’s Encrypt, come mostrato nella guida precedente.

sudo mkdir -p /etc/apache2/ssl
sudo openssl req -x509 -nodes -days 365 -newkey rsa:4096 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt
sudo a2enmod ssl
sudo systemctl restart apache2

trovare queste due stringhe:

sudo nano /etc/apache2/sites-available/default-ssl.conf

e modificarle da così:

SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

a così:

SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
sudo a2ensite default-ssl.conf
sudo systemctl reload apache2
10) Sicurezza

10.1) Installazione e configurazione firewall ufw:

sudo apt install ufw
sudo ufw enable

bloccare tutte le connessioni in ingresso:

sudo ufw default allow outgoing
sudo ufw default deny incoming

aprire solo le porte interessate, come quella ssh o https, ad ogni modo mai utilizzare porte standard:

sudo ufw allow 22
sudo ufw allow 443/tcp

verifica:

sudo ufw status verbose
sudo iptables -S

10.2) Installazione e configurazione fail2ban:

sudo apt install fail2ban
sudo systemctl enable fail2ban
sudo systemctl start fail2ban

proteggere tutti i servizi usati, utilizzando /etc/fail2ban/jail.local, fail2ban arriva già con dei filtri predefiniti che possono essere abilitati:

ls /etc/fail2ban/filter.d/

esempio:

[sshd]
enabled = true
port = 22
filter = sshd
logpath = /var/log/auth.log
maxretry = 3
bantime = 120
ignoreip = whitelist-IP

# detect password authentication failures
[apache]
enabled = true
port = http,https
filter = apache-auth
logpath = /var/log/apache*/*error.log
maxretry = 6

# detect potential search for exploits and php vulnerabilities
[apache-noscript]
enabled = true
port = http,https
filter = apache-noscript
logpath = /var/log/apache*/*error.log
maxretry = 6

# detect Apache overflow attempts
[apache-overflows]
enabled = true
port = http,https
filter = apache-overflows
logpath = /var/log/apache*/*error.log
maxretry = 2

# detect failures to find a home directory on a server
[apache-nohome]
enabled = true
port = http,https
filter = apache-nohome
logpath = /var/log/apache*/*error.log
maxretry = 2
sudo systemctl restart fail2ban 
sudo fail2ban-client status

10.3) Trusted Domain

indicare solo gli ip ed i domini che possono accedere:

sudo nano /var/www/nextcloud/config/config.php
'trusted_domains' => 
array (
0 => '192.168.1.122',
1 => 'my-domain.com',

10.4) Forzare la connessione via SSL

sudo nano /etc/apache2/sites-available/000-default.conf

sostituire http con https:

<VirtualHost *:80>
ServerAdmin admin@example

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
</VirtualHost>

10.5) Aggiornamenti di sicurezza automatici giornalieri:

sudo apt install unattended-upgrades
sudo nano /etc/apt/apt.conf.d/02periodic

inserire:

APT::Periodic::Enable "1";
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::Unattended-Upgrade "1";
APT::Periodic::AutocleanInterval "1";
APT::Periodic::Verbose "2";

aggiornare:

sudo unattended-upgrades -d

10.6) Sudo DEVE sempre chiedere la password:

sudo nano /etc/sudoers.d/010_pi-nopasswd

diventa da così:

YOUR-USER ALL=(ALL) NOPASSWD: ALL

a così:

YOUR-USER ALL=(ALL) PASSWD: ALL

10.7) Mysql in sicurezza

sudo mysql_secure_installation
Enter current password for root (enter for none): Press Enter
Set root password? [Y/n] Y 
Remove anonymous users? [Y/n] Y 
Disallow root login remotely? [Y/n] Y 
Remove test database and access to it? [Y/n] Y 
Reload privilege tables now? [Y/n] Y

10.8) SSH in sicurezza

cambiare subito la porta di default e verificare che non sia abilitato il login come root, ma soprattutto usare una chiave ssh:

sudo nano /etc/ssh/sshd_config
#PermitRootLogin prohibit-password
Port 2223
10.9) Backup

backup da eseguire periodicamente su supporti esterni ed in remoto. Si può utilizzare rsync (guida), tar (guida), dd (guida), scp (guida), lsyncd (guida).

10.10) VPN

il sistema più sicuro per accedere da remoto è tramite vpn, se si ha un router che supporta ipSec o Wireguard (fritzbox 7590) il tutto è semplice, in alternativa si può creare un server vpn, utilizzando openvpn o wireguard

Nextcloud Server su Raspberry Pi

enjoy 😉

Configurare Samba server su Debian 11 e SysLinuxOS

 

Samba è un software gratuito che consente di condividere file in rete utilizzando il protocollo SMB (Server Message Block). Samba è supportato su varie piattaforme come i sistemi operativi Windows e Unix. Guida per OS Debian based e SysLinuxOS

Step 1 Installazione
sudo apt install samba smbclient cifs-utils
Step 2 Creazione cartelle condivisione:
sudo mkdir /mnt/{private,public}
Step 3 Configurazione smb.conf
sudo nano /etc/samba/smb.conf

ed aggiunger in fondo:

[public]
comment = Public Folder
path = /mnt/public
writable = yes
guest ok = yes
guest only = yes
force create mode = 775
force directory mode = 775


[private]
comment = Private Folder
path = /mnt/private
writable = yes
guest ok = no
valid users = @smbshare
force create mode = 770
force directory mode = 770
inherit permissions = yes
Step 4 Creazione utente e gruppo:
sudo groupadd smbshare
sudo chgrp -R smbshare /mnt/private/
sudo chgrp -R smbshare /mnt/public
sudo chmod 770 /mnt/private/
sudo chmod 775 /mnt/public
sudo useradd -M -s /sbin/nologin sambauser
sudo usermod -aG smbshare sambauser
sudo smbpasswd -a sambauser
sudo smbpasswd -e sambauser

Verificare funzionamento:

sudo touch /mnt/private/test1.txt /mnt/public/test2.txt
sudo systemctl restart smbd

Accesso locale:

smbclient '\\localhost\public' -U sambauser

output ls:

edmond@syslinuxbox:~$ smbclient '\\localhost\public' -U sambauser
Enter WORKGROUP\sambauser's password:
Try "help" to get a list of possible commands.
smb: \> ls
. D 0 Sat May 28 16:52:47 2022
.. D 0 Sat May 28 16:48:41 2022
test2.txt N 0 Sat May 28 16:52:47 2022

69977312 blocks of size 1024. 40744856 blocks available
smb: \>

Accesso da client Linux:

un metodo veloce è quello di aprire il proprio file manager, nel mio caso Caja, ed inserire il percorso:

smb://sambauser@ip_address/public/

Configurare Samba server su Debian 11 e SysLinuxOS

Configurare Samba server su Debian 11 e SysLinuxOS

enjoy 😉

Installare Docker su Debian 11 e SysLinuxOS

 

Installare Docker su Debian 11

Installare Docker su Debian 11 e SysLinuxOS

Docker è un programma che consente di impacchettare software in contenitori, ed eseguirli su macchine virtuali . Questi contenitori sono completamente indipendenti, il che aumenta la sicurezza del contenitore, ed inoltre sono molto più leggeri rispetto a delle macchine virtuali.

Prerequisiti Debian 11 bullseye e SyslinuxOS

$ sudo apt update
$ sudo apt upgrade
$ sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release

Chiave

$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Repository

$ echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Installazione

$ sudo apt update
$ sudo apt install docker-ce docker-ce-cli containerd.io

Docker versione

$ docker --version
Docker version 20.10.14, build a224086

Verfica servizi

$ sudo systemctl status docker
$ sudo systemctl stop docker
$ sudo systemctl start docker

Abilitazione disabilitazione al boot

$ sudo systemctl enable docker
$ sudo systemctl enable containerd.service
$ sudo systemctl disable docker

Aggiungere user al gruppo docker per evitare i privilegi root

$ sudo usermod -aG docker $USER

Test

$ docker run hello-world

Installare Docker su Debian 11

oppure

$ docker run -it debian bash

Rimozione:

$ sudo apt autoremove docker-ce docker-ce-cli containerd.io
$ sudo rm /etc/apt/sources.list.d/docker.list
$ sudo apt update
Installare Docker su Debian 11 e SysLinuxOS

 

enjoy 😉

 

XAMPP PHP 8 su Debian Bullseye

 

XAMPP PHP 8 su Debian Bullseye

XAMPP PHP 8 su Debian Bullseye

XAMPP è una suite completamente gratuita e facile da installare che contiene Apache, MariaDB, PHP, e Perl. La pagina di download è la seguente, una volta scaricato l’installer, cambiare i permersi ed iniziare l’installazione:

$ chmod 755 xampp-linux-*-installer.run
$ sudo ./xampp-linux-*-installer.run --mode gtk --installer-language it

alla fine si potrà scegliere di lanciare subito xampp, e quindi andare in Manage-Servers per avviare i servizi. La schermata iniziale è raggiungibile all’indirizzo https://localhost/. Per avviare xampp da interfaccia grafica quindi utilizzare:

$ sudo /opt/lampp/manager-linux-x64.run

altrimenti si possono utilizzare i seguenti singoli comandi:

$ sudo /opt/lampp/xampp start
$ sudo /opt/lampp/xampp stop
$ sudo /opt/lampp/xampp restart
$ sudo /opt/lampp/xampp startapache
$ sudo /opt/lampp/xampp startmysql
$ sudo /opt/lampp/xampp startftp
$ sudo /opt/lampp/xampp stopapache
$ sudo /opt/lampp/xampp stopmysql
$ sudo /opt/lampp/xampp stopftp
$ sudo /opt/lampp/xampp enablessl
$ sudo /opt/lampp/xampp disablessl

Per il server ProFTP: nome utente «nobody», password «lampp». E’ necessario mettere in sicurezza xampp, creando le password di accesso per i vari servizi. Il comando è il seguente:

$ sudo /opt/lampp/xampp security
XAMPP PHP 8 su Debian Bullseye

enjoy 😉

 

Server DHCP su Debian 11

 

Server DHCP su Debian 11 Bullseye.

 

Installazione e configurazione di un server dhcp su Debian Bullseye:

$ sudo su
# apt install isc-dhcp-server

settare la scheda di rete da utilzzare, nel mio caso eth0:

# nano /etc/default/isc-dhcp-server
# Defaults for isc-dhcp-server initscript
# sourced by /etc/init.d/isc-dhcp-server
# installed at /etc/default/isc-dhcp-server by the maintainer scripts

#
# This is a POSIX shell fragment
#

# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
#DHCPD_CONF=/etc/dhcp/dhcpd.conf

# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPD_PID=/var/run/dhcpd.pid

# Additional options to start dhcpd with.
#       Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth0"

poi modificare il file dhcpd.conf inserendo i parametri della nostra rete, nel mio caso 192.168.100.0/24:

# nano /etc/dhcp/dhcpd.conf
# Sample configuration file for ISC dhcpd for Debian
#
#

# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;

# option definitions common to all supported networks...
option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 600;
max-lease-time 7200;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;

# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.

#subnet 10.152.187.0 netmask 255.255.255.0 {
#}

# This is a very basic subnet declaration.
subnet 192.168.100.0 netmask 255.255.255.0 {
range 192.168.100.150 192.168.100.160;
option routers 192.168.100.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.100.254;
option domain-name-servers 192.168.100.1, 192.168.100.2;
option ntp-servers 192.168.100.1;
option netbios-name-servers 192.168.100.1;
option netbios-node-type 8;
}
#subnet 10.254.239.0 netmask 255.255.255.224 {
#  range 10.254.239.10 10.254.239.20;
#  option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
#}

# This declaration allows BOOTP clients to get dynamic addresses,
# which we don't really recommend.

#subnet 10.254.239.32 netmask 255.255.255.224 {
#  range dynamic-bootp 10.254.239.40 10.254.239.60;
#  option broadcast-address 10.254.239.31;
#  option routers rtr-239-32-1.example.org;
#}

# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
#  range 10.5.5.26 10.5.5.30;
#  option domain-name-servers ns1.internal.example.org;
#  option domain-name "internal.example.org";
#  option routers 10.5.5.1;
#  option broadcast-address 10.5.5.31;
#  default-lease-time 600;
#  max-lease-time 7200;
#}

# Hosts which require special configuration options can be listed in
# host statements.   If no address is specified, the address will be
# allocated dynamically (if possible), but the host-specific information
# will still come from the host declaration.

#host passacaglia {
#  hardware ethernet 0:0:c0:5d:bd:95;
#  filename "vmunix.passacaglia";
#  server-name "toccata.fugue.com";
#}

# Fixed IP addresses can also be specified for hosts.   These addresses
# should not also be listed as being available for dynamic assignment.
# Hosts for which fixed IP addresses have been specified can boot using
# BOOTP or DHCP.   Hosts for which no fixed address is specified can only
# be booted with DHCP, unless there is an address range on the subnet
# to which a BOOTP client is connected which has the dynamic-bootp flag
# set.
#host fantasia {
#  hardware ethernet 08:00:07:26:c0:a5;
#  fixed-address fantasia.fugue.com;
#}

# You can declare a class of clients and then do address allocation
# based on that.   The example below shows a case where all clients
# in a certain class get addresses on the 10.17.224/24 subnet, and all
# other clients get addresses on the 10.0.29/24 subnet.

#class "foo" {
#  match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
#}

#shared-network 224-29 {
#  subnet 10.17.224.0 netmask 255.255.255.0 {
#    option routers rtr-224.example.org;
#  }
#  subnet 10.0.29.0 netmask 255.255.255.0 {
#    option routers rtr-29.example.org;
#  }
#  pool {
#    allow members of "foo";
#    range 10.17.224.10 10.17.224.250;
#  }
#  pool {
#    deny members of "foo";
#    range 10.0.29.10 10.0.29.230;
#  }
#}

dopo le modifiche riavviare il servizio:

# systemctl restart isc-dhcp-server.service
Server DHCP su Debian 11 Bullseye

enjoy ?

VMware Workstation 16 Player Debian 11

VMware Workstation 16 Player Debian 11

 

Guida su come installare VMware Workstation 16 Player su Debian 11.

  • Primo step:

Download diretto dal sito ufficiale

  • Secondo:

installazione pacchetti essenziali

sudo apt install build-essential linux-headers-$(uname -r)

Terzo:

installazione

cd Downloads
chmod +x VMware-Player-Full-*.bundle
sudo ./VMware-Player-Full-*.bundle
sudo apt install open-vm-tools-desktop

Quarto:

git clone https://github.com/mkubecek/vmware-host-modules.git
cd vmware-host-modules
git checkout workstation-16.2.3
make
sudo make install

Disinstallazione:

sudo vmware-installer --uninstall-product vmware-player

 

enjoy 😉

 

Asterisk 18 FreePBX 16 su Raspberry Pi 4 e Raspberry Pi OS Bullseye

 

Asterisk 18 FreePBX 16 su Raspberry Pi 4 e Raspberry Pi OS BullseyeAsterisk 18 FreePbx 16 su Raspberry Pi 4 e Raspberry Pi OS Bullseye

 

In questa guida aggiornata, scriverò di una installazione su single board Raspberri py 4 con Raspberry Pi OS Bullseye 11, di Asterisk 18 e Freepbx 16. FreePBX 16 funziona bene, e la novità principale è il supporto a php7.4. Esiste anche una versione già pronta, raspbx, ma io preferisco installare tutto da me, poichè il sistema risulta molto più fluido. I passaggi successivi saranno eseguiti come utente root, su una nuova installazione di Raspberry Pi OS Bullseye lite. L’installazione prenderà circa 90 minuti, e prevede che il sistema sia già stato installato e che si abbia un accesso ssh.

1) Aggiornare il sistema

$ sudo su
# apt update
# apt upgrade -y
# reboot
2) Scaricare le dipendenze ed i servizi necessari
# apt install -y wget bison flex php php-pear php-cgi php-common php-curl php-mbstring php-gd php-mysql php-php-gettext php-bcmath php-zip php-xml php-imap php-json php-snmp php-fpm libapache2-mod-php git curl libnewt-dev libssl-dev libncurses5-dev subversion libsqlite3-dev build-essential libedit-dev libjansson-dev libxml2-dev uuid-dev dh-make libssl-dev sox mariadb-client-10.5 mariadb-server-10.5

3) Installare nodejs

# curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
# apt install -y nodejs

4) Reboot server

# reboot

5) Scaricare Asterisk 18 e FreePBX 16

$ sudo su
# cd /usr/src
# wget https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-18-current.tar.gz
# wget https://mirror.freepbx.org/modules/packages/freepbx/freepbx-16.0-latest.tgz

6) Installare Asterisk 18

# tar xvfz asterisk-18-current.tar.gz
# rm -rf asterisk-18-current.tar.gz
# cd asterisk-18.*
# contrib/scripts/get_mp3_source.sh
# ./contrib/scripts/install_prereq install
# ./configure --with-jansson-bundled
# make menuselect

 

inserire il prefisso internazionale, nel nostro caso 39:

Asterisk 14 Freepbx 14 su Debian Stretch 9.1abilitare format_mp3:

abilitare “macro” in make menuselect > Application > app_macro:

Asterisk 18 FreePBX 16 su Raspberry Pi 4 e Raspberry Pi OS Bullseye

quindi:

# make -j8
# make install
# make samples
# make config

7) Creazione utente Asterisk e permessi

# groupadd asterisk
# useradd -r -d /var/lib/asterisk -g asterisk asterisk
# usermod -aG audio,dialout asterisk
# chown -R asterisk.asterisk /etc/asterisk
# chown -R asterisk.asterisk /var/{lib,log,spool}/asterisk
# chown -R asterisk.asterisk /usr/lib/asterisk
# sed -i 's/#AST_USER="asterisk"/AST_USER="asterisk"/g' /etc/default/asterisk
# sed -i 's/#AST_GROUP="asterisk"/AST_GROUP="asterisk"/g' /etc/default/asterisk
# systemctl restart asterisk
# /lib/systemd/systemd-sysv-install enable asterisk

verificare che asterisk funzioni correttamente:

# asterisk -rvvv

8) Configurazione Apache2

# cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_orig
# sed -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
# sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/apache2/apache2.conf
# mv /var/www/html /var/www/html.bak
# a2enmod rewrite
# systemctl restart apache2

9) Installare FreePBX 16

# cd /usr/src/
# tar xvfz freepbx-16.0-latest.tgz
# rm -rf freepbx-16.0-latest.tgz
# cd freepbx
# ./install -n
# fwconsole chown
# fwconsole ma refreshsignatures
# fwconsole ma installall
# fwconsole reload
# fwconsole restart

In conclusione, se tutto è andato bene il server Asterisk è raggiungibile all’indirizzo http://ip_raspberry. La prima cosa da fare è quella di scegliere nome utente, password e mail, per accedere al pannello di amministrazione. Andare poi nel menu Admin-Module Admin e scaricare ed aggiornare i moduli rimanenti.

 

enjoy 😉

 

VirtualBox on Debian 11 Bullseye

 

VirtualBox on Debian 11 Bullseye

 

VirtualBox on Debian 11 Bullseye

Attualmente non esistono repository per Debian 11 bullseye per installare VirtualBox, ma solamente quelli per Debian 10. Ma sul sito Oracle esiste una versione “all distributions” che funziona su Debian 11. Si tratta di uno script che installerà VirtualBox 6.1 senza problemi:

Scaricare e salvare lo script, oppure:

$ sudo apt install build-essential linux-headers-amd64
$ wget https://download.virtualbox.org/virtualbox/6.1.22/VirtualBox-6.1.22-144080-Linux_amd64.run
$ chmod +x VirtualBox*
$ sudo ./VirtualBox*

esiste anche VirtualBox Extension Pack 6.1.22.

VirtualBox on Debian 11 Bullseye

enjoy 😉

 

How to compile kernel 5.11 on Debian 11

How to compile kernel 5.11 on Debian 11

How to compile kernel 5.11 on Debian 11

Nei giorni scorsi ho più volte ricompilato il kernel poichè volevo risolvere il problema del lettore “Alcor Micro AU6625”, che su un notebook HP Pavillion 15-dk000nl, non viene riconosciuto, sia su Debian che su tutte le altre distro. Da quello che ho visto e letto, fin dal kernel 5.6, è stato inserito questo driver, ma per quanto mi riguarda non sembra funzionare. Io stesso ho fatto dei cambiamenti, ma senza nessun risultato al momento. Ad ogni modo questa è una altra storia.

Il kernel si può compilare direttamente, come moduli, oppure attraverso la creazione di un pacchetto in formato .deb, installabile.

Prerequisiti:

$ sudo apt-get install build-essential libncurses-dev bison flex libssl-dev libelf-dev dwarves bc rsync wget

Metodo 1

Scaricare il kernel direttamente dalla pagina ufficiale, oppure con wget:

$ mkdir kernel; cd kernel
$ wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.11.18.tar.xz
$ tar -xvf linux*
$ cd linux-5.11.18/

a questo punto utilizzare, “localmodconfig“, per un kernel minimale/leggero, che provvederà a caricare ed utilizzare solo i driver strettamente necessari per il funzionamento del computer, oppure “menuconfig“, per abilitare nuove funzionalità.

$ make localmodconfig
$ make -j $(nproc)
$ make -j $(nproc) modules
$ sudo make modules_install

il processo prenderà un pò di tempo, tutto dipende dalla potenza dei processori, il mio è un 12 core, quindi ha fatto relativamente presto. Per utilizzare al massimo i processori ho utilizzato “make -j $(nproc)“, che sfrutta tutti i processori esistenti. In fine riavviare.

Metodo 2

$ mkdir kernel; cd kernel
$ wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.11.18.tar.xz
$ tar -xvf linux*
$ cd linux-5.11.18/

per non avere l’errore seguente:

make[4]: *** No rule to make target 'debian/certs/test-signing-certs.pem', needed by 'certs/x509_certificate_list'.  Stop.
make[4]: *** Waiting for unfinished jobs...

modificare CONFIG_SYSTEM_TRUSTED_KEYS utilizzando sed:

$ sed -ri '/CONFIG_SYSTEM_TRUSTED_KEYS/s/=.+/=""/g' .config

costruzione linux-image e linux-headers:

$ make localmodconfig
$ time nice make -j`nproc` bindeb-pkg
$ cd ..
$ sudo dpkg -i linux-image-* linux-headers-*

How to compile kernel 5.11 on Debian 11

enjoy 😉

 

Come ascoltare la musica nel telefono tramite le casse del pc Debian Gnu Linux

 

Guida su come ascoltare la musica presente nel telefono, tramite bluetooth, direttamente da un pc/notebook. Con i nuovi dispositivi cellulari, e le ottime proposte di musica, dei vari Itunes, Musica, Spotify, Amazon Music,  ecc ecc, ci si trova ad avere tutta la musica a disposizione sul cellulare e non sul pc, fermo restando che la si potrebbe ascoltare direttamente dal web. Questo trucchetto è molto utile per ascoltare ad un volume più alto la musica, tutto questo sfruttando le casse più potenti del pc. Gli unici requisiti sono: il bluetooth, ed una installazione di un OS Linux, nel mio caso Debian 10, e molto probabilmente tutto funzionerà out of the box. Nel caso non fossero presenti, installare i pacchetti necessari:

sudo apt install bluez
sudo apt install pulseaudio pulseaudio-utils pavucontrol pulseaudio-module-bluetooth

Io utilizzo Mate come desktop environment, come si vede nel video, quindi i passi successivi saranno:

  1. Avviare il bluetooth
  2. Lanciare Bluetooth Manager
  3. Scansione e pairing tramite codice col cellulare
  4. Avviare la musica sul cellulare
Come ascoltare la musica nel telefono tramite le casse del pc Debian Gnu LinuxCome ascoltare la musica nel telefono tramite le casse del pc Debian Gnu Linux

 

enjoy 😉