Installare Nginx con PHP 7, PHP-FPM e MySQL su Ubuntu 16.04
MariaDB Galera Cluster Master-Master su CentOS 7
In questa guida vedremo come creare un Cluster MariaDB dove tutti i nodi appartenenti al cluster sono Master. La soluzione di un Cluster Master-Master fa si che tutti i nodi siano replicati costantemente e accessibili in lettura e scrittura contemporaneamente. Molto spesso si utilizza per poter poi bilanciare le richieste MySQL ottimizzando così le performance … [Read more…]
Owncloud 9 Apache Mysql su Raspberry Pi 3 e Raspbian
Owncloud 9 Apache Mysql su Raspberry Pi 3 e Raspbian. Io su Raspberry Pi 3, ho un server Webdav e mi trovo bene, qua la guida. ma ho voluto provare Owncloud, poichè è molto più personalizzabile, e ti permette di condividere link, con password e data di scadenza. Io ho utilizzato come disco esterno una pen drive da 128G, formattata in NTFS, ma si può utilizzare anche un hard disk esterno, possibilmente alimentato.
sudo mkdir /media/usb-hdd
identificare la chiavetta con:
sudo tail -f /var/log/messages
oppure:
sudo fdisk -l
conoscere UUID per procedere con il mount automatico:
sudo blkid /dev/sda1
il comando sopra restituirà qualcosa del genere:
/dev/sda1: UUID="10C67902162A661E" TYPE="ntfs" PARTUUID="eaf9ab2e-01"
quindi configurare fstab:
sudo nano /etc/fstab
che dovrebbe essere come sotto:
UUID=10C67902162A661E /media/usb-hdd/ ntfs-3g permissions,defaults,auto
poi:
sudo reboot
Installazione di Owncloud ed i servizi necessari:
wget -nv https://download.owncloud.org/download/repositories/stable/Debian_8.0/Release.key -O Release.key
sudo apt-key add - < Release.key
sudo sh -c "echo 'deb http://download.owncloud.org/download/repositories/stable/Debian_8.0/ /' >> /etc/apt/sources.list.d/owncloud.list"
sudo apt-get update && sudo apt-get install owncloud
verrà chiesto di scegliere una password per mysql.
Configurazione Mysql:
sudo mysql -u root -p
inserire la password di mysql, e poi i 4 comandi sotto, scegliendo Utente e Password per l'utente owncloud:
CREATE DATABASE owncloud; GRANT ALL PRIVILEGES ON owncloud.* TO USER@localhost IDENTIFIED BY 'PASSWORD'; FLUSH PRIVILEGES; exit
riavviare mysql:
sudo service mysql restart
Web Server Apache2 con SSL:
sudo openssl genrsa -out server.key 4096
sudo openssl req -new -key server.key -out server.csr
ci saranno alcune voci da riempire, ma quella più importante è COMMON NAME, che io ho fatto puntare al mio hostname DynDNS per l'accesso da remoto:
Owncloud 9 Apache Mysql su Raspberry Pi 3 e Raspbian
sudo openssl x509 -req -days 1825 -in server.csr -signkey server.key -out server.crt -sha256
sudo chmod 400 server.key
sudo mv server.key /root/server.key
sudo mv server.crt /root/server.crt
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-default.conf_bak
sudo nano /etc/apache2/sites-available/000-default.conf
e modificare DocumentRoot come sotto:
DocumentRoot /var/www/owncloud
poi ancora:
sudo rm -rf /var/www/html/
sudo nano /etc/apache2/sites-available/default-ssl.conf
e modificare le voci DocumentRoot, SSLCertificateFile, SSLCertificateKeyFile, come sotto:
DocumentRoot /var/www/owncloud SSLCertificateFile /root/server.crt SSLCertificateKeyFile /root/server.key
abilitare la crittografia:
sudo a2ensite default-ssl.conf
sudo service apache2 reload
sudo a2enmod ssl
sudo service apache2 restart
alcune modifiche necessarie:
sudo nano /etc/php5/apache2/php.ini
fare una modifica al file php.ini, nella sezione File Uploads, portando upload_max_filesize = 5000.
sudo sed -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
sudo /etc/init.d/apache2 restart
creazione della cartella di storage e relativi permessi:
sudo mkdir -p /media/usb-hdd/owncloud/dati
sudo chown -R www-data:www-data /media/usb-hdd/owncloud/dati
sudo chmod 0770 /media/usb-hdd/owncloud/dati
sudo reboot
come ultimo ritocco, aumentare la capacità di upload, andando a modificare il file .htacces, ed installare fail2ban:
sudo nano /var/www/owncloud/.htaccess
portando: php_value upload_max_filesize, e php_value post_max_size a 5000M
sudo apt-get install fail2ban
Se tutto è andato bene andare all'indirizzo https://ip_del_raspberry/owncloud ed apparirà la pagina iniziale, dove si dovrà scegliere nome utente e password per l'accesso, ed inserire il nome del database ed user e password dell'utente owncloud.
Owncloud 9 Apache Mysql su Raspberry Pi 3 e Raspbian
enjoy
L’articolo Owncloud 9 Apache Mysql su Raspberry Pi 3 e Raspbian sembra essere il primo su Edmond's Weblog.
Accesso a PhpMyAdmin con MySQL 5.7
L’articolo Accesso a PhpMyAdmin con MySQL 5.7 sembra essere il primo su RedBlue's Blog.
Accesso a PhpMyAdmin con MySQL 5.7
L’articolo Accesso a PhpMyAdmin con MySQL 5.7 sembra essere il primo su RedBlue's Blog.
Restore MySql GTID replication
Execute steps in order. We call the two servers GOOD and BROKEN. GOOD is the one with the correct data, and BROKEN has corrupted data. The first procedure resets the replica from GOOD to BROKEN and then restores it from BROKEN (which is aligned) to GOOD. You do not have to run it twice. Read the steps carefully!
BROKEN
The first step is to stop the scriptures! It can be done in several ways:
Stop the program or programs that write in the database or if MySql is off it can be started with the skip-networking parameter set in /etc/my.cnf so it does not accept network connections.
GOOD
- Run Database Dump:
# Mysqldump --single-transaction --triggers --routines -u root -p database_name> /tmp/dump.sql
- Copy the dump executed on the BROKEN node
# scp /tmp/dump.sql user@BROKEN:/tmp/ - Run the slave stop
Mysql> stop slave;
BROKEN
- Reset the master
Mysql> reset master; - Verify that GTID_EXECUTED is empty and remains blank for a while after the reset master, otherwise there is someone who is writing.
Mysql> shows global variables like 'GTID_EXECUTED';
+ --------------- + ------- +
| Variable Name | Value |
+ --------------- + ------- +
| Gtid_executed | |
+ --------------- + ------- + - If GTID_EXECUTED is not empty repeat the procedure from the beginning, be careful to stop all scripts on BROKEN
- Dump Import:
Mysql> uses database_name
Mysql> source /tmp/dump.sql; - Verify that the GLOBAL.GTID_PURGED variable is set to the value inside the dump file
- If we used skip-networking, remove it from the configuration file and reboot mysqld on the ROTTO node
- Restore replication GOOD => BROKEN
Mysql> start the slave;
Mysql> shows the slave status \G
[...]
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
[...]
GOOD
Restore reverse replica, from NOT_ANYMORE_BROKEN to GOOD
mysql> reset slave;
mysql> start slave;
(English) Install MariaDB Galera Cluster on Ubuntu 16.04
Oracle MySQL UDF Payload Execution
This Metasploit module creates and enables a custom UDF (user defined function) on the target host via the SELECT … into DUMPFILE method of binary injection. On default Microsoft Windows installations of MySQL versions 5.5.9 and below, directory write permissions not enforced, and the MySQL service runs as LocalSystem. NOTE: This Metasploit module will leave a payload executable on the target system when the attack is finished, as well as the UDF DLL, and will define or redefine sys_eval() and sys_exec() functions.
Source: Oracle MySQL UDF Payload Execution
The post Oracle MySQL UDF Payload Execution appeared first on MondoUnix.
Come configurare l’accesso remoto a MySQL sotto Linux
Supponi di aver installato il server MySQL sulla tua Linux box. Supponi di aver necessità di far accedere da remoto al server MySQL da parte di una applicazione. Devi configurare un accesso remoto, visto che la configurazione predefinita di MySQL non lo prevede. Nel file /etc/my.cnf devi commentare il parametro skip-network se presente e devi assegnare al parametro bind (aggiungerlo […]
Owncloud 10 su Raspberry Pi 3 e Raspbian Stretch
Owncloud 10 su Raspberry Pi 3 e Raspbian Stretch Guida su come installare owncloud 10 su Raspberry Pi 3 con già installato Raspbian Stretch. Io ho sempre usato uno dei miei Raspberry come server cloud, accessibile soprattutto da remoto. In questa guida non mi soffermerò sui problemi di sicurezza ed i modi per limitare … Leggi tutto “Owncloud 10 su Raspberry Pi 3 e Raspbian Stretch”
The post Owncloud 10 su Raspberry Pi 3 e Raspbian Stretch appeared first on Edmond's Weblog.