OpenMediaVault, Syncthing, WordPress

OpenMediaVault

Dopo l’installazione della ISO, lanciare omv-firstaid e modificare la network con IP fisso (250), DNS google 8.8.8.8 o openDNS 208.67.222.222 e la web controll su porta 80 dominio local
# resolvectl status
interfaccia enp0s25
/dev/sda: sda1 ext4, (sda3 ntfs), sda5 swap.
/dev/sdb: sdb1 (300GB)
Non cfdisk, solo gparted con root smontata
Montare i dischi del file system con il tool OMV e non con il mount da console
Dopo gli update/upgrade
sudo omv-confdbadm populate

Syncthing

Aggiugere utente con permessi sudo
# adduser -p “utente”
# usermod -aG sudo ssh “utente”
# su – “utente”
# sudo apt-get install syncthing

Modificare l’ip per accedere da remoto alla web gui

Lanciare e arrestare il server, per creare i file di config
# /usr/bin/syncthing
# nano /home/user/.config/syncthing/config.xml
<gui enabled=”true” tls=”false”>
<address>0.0.0.0:8384</address>
</gui>

Syncthing as service

# systemctl enable syncthing@”utente”.service
# systemctl start syncthing@”utente”.service
# systemctl status syncthing@”utente”.service
# journalctl -r -u syncthing@”utente”.service

Disabilita power saving quando chiudi il coperchio
# sudo nano /etc/systemd/logind.conf
[Login]
HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore
# sudo systemctl restart systemd-logind.service

WordPress
Apache

# sudo apt install apache2
# sudo systemctl start/stop/restart/status apache2

MySQL

#sudo apt install default-mysql-server
# sudo mysql_secure_installation
“rispondere Y a tutte le richieste”

# sudo mysql -u root -p
> create database dirtynello;
>grant all privileges on dirtynello.* to “wordpressusername”@”hostname” identified by “password”;
> flush privileges;
> exit;

# cd /tmp/
# wget -c https://wordpress.org/latest.tar.gz
REM :/tmp mount /dev/sdb1 /media/cdrom
REM :/tmp mv /media/cdrom/wordpress-5.6.tar.gz .
# /tmp tar -xvzf wordpress-5.6.tar.gz
# /tmp mv wordpress/ /var/www/html/
# /tmp chown -R www-data:www-data /var/www/html/dirtynello/
# /tmp chmod 755 -R /var/www/html/dirtynello/

creare il virtualhost
# /tmp nano /etc/apache2/sites-available/dirtynello.conf

  • <VirtualHost *:80>
    ServerAdmin admin@dirtynello
    DocumentRoot /var/www/html/dirtynello
    ServerName localhost

    <Directory /var/www/html/dirtynello>
    Options FollowSymlinks
    AllowOverride All
    Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/dirtynello_error.log
    CustomLog ${APACHE_LOG_DIR}/dirtynello_access.log combined
    </VirtualHost>

  •  

Abilitare il virtualhost
# /tmp ln -s /etc/apache2/sites-available/dirtynello.conf /etc/apache2/sites-enabled/dirtynello.conf
# /tmp a2enmod rewrite
# /tmp systemctl restart apache2

Aggiornamento PHP. Se si aggiunge il nuovo repository, in caso di aggiornamento (apt update/upgrade) verrà aggiunto anche php8.0. Non ci sono problemi di compatibilità WP

sudo apt -y install lsb-release apt-transport-https ca-certificates
sudo 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
sudo apt update
sudo apt -y install php7.4
sudo apt install php7.4 php7.4-common php7.4-cli
sudo apt install php7.4-fpm php7.4-bcmath php7.4-curl

Prerequisiti PHP per WordPress

sudo apt install php-json php-mbstring php-mysql php-readline php-soap php-xsl php-opcache php-zip php-curl php-imagick

Varie

proxy per apt

comando realtime
sudo apt-get -o Acquire::http::Proxy=”http://user:passwort@proxy:port” update
file confing
sudo nano /etc/atp/apt.conf.d/96proxy.conf
# necessario
Acquire::http::proxy “http://risorse\username:pwd@proxy.xxxx:8080/”;
#non indispensabili
Acquire::https::proxy “https://risorse\username:pwd@proxy.xxxx:8080/”;
Acquire::ftp::proxy “ftp://risorse\username:pwd@proxy.xxxx:8080/”;

samba client

# sudo apt install cifs-utils
# sudo mkdir /media/dirtyweb_cloud
# sudo mount -t cifs -o username=win_share_user, password=pwd ,domain=win_domain //WIN_SHARE_IP/share_name /mnt/win_share

Su ATP bisogna dare la stringa senza password statement e digitarla poi

creare il file /etc/win-credentials con i seguenti campi
username=user
password=password
domain=domain

# sudo mount -t cifs -o /et/credentials //ip_server/shared /media/dirlocale/
fstab
//WIN_SHARE_IP/share_name   /mnt/win_share   cifs credentials=/etc/win-credentials,file_mode=0755,dir_mode=0755     0        0

NOTICE: Not enabling PHP x.0 FPM by default.
NOTICE: To enable PHP x.0 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf phpx.0-fpm
NOTICE: You are seeing this message because you have apache2 package installed.

Rimozione pacchetti

sudo apt-get remove –purge apache\*
sudo apt-get remove –purge php\*
sudo apt-get remove –purge mysql\*
sudo apt-get autoremove/clean
sudo dpkg -l | grep -i mysql / php / apache
whereis php / mysql /apache