Installare WordPress dalla shell

Installare WordPress dalla shell

In questo articolo vedremo come installare WordPress sul nostro sito utilizzando la shell.

Spostiamoci nella root del nostro sito:


cd /sito/public_html

Scarichiamo WordPress:


wget http://wordpress.org/latest.tar.gz

Decomprimiamo il file:


tar -xzvf latest.tar.gz 

Eseguiamo il login in MySQL:


mysql -u root -p

Creiamo un database per WordPress:


CREATE DATABASE tuodatabase;
Query OK, 1 row affected (0.00 sec)

Creiamo un nuovo utente per il database:


CREATE USER utente@localhost;
Query OK, 0 rows affected (0.00 sec)

Assegniamo una password al nuovo utente:


SET PASSWORD FOR utente@localhost= PASSWORD("password");
Query OK, 0 rows affected (0.00 sec)

Assegniamo i privilegi necessari al nuovo utente (attenzione: non รจ necessario assegnargli tutti):


GRANT ALL PRIVILEGES ON tuodatabase.* TO utente@localhost IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

Eseguiamo un refresh:


FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

Usciamo dalla shell MySQL:


exit

Copiamo il file wp-config-sample.php come wp-config.php:


cp wp-config-sample.php wp-config.php

Editiamo il file (Ctrl + O per scrivere sul file, Invio per salvare, Ctrl + X per uscire dall'editor):


nano wp-config.php

Dopo aver inserito tutti i dati possiamo lanciare la procedura di installazione via Web.

Torna su