-
Notifications
You must be signed in to change notification settings - Fork 4
/
script-vm1.sh
55 lines (28 loc) · 1.37 KB
/
script-vm1.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Autoriser l'accès aux service azure dans Maria DB
# Update et Upgrade
sudo apt -y update
sudo apt -y upgrade
# Installer Apache
sudo apt -y install apache2
# Installer Maria DB Client
sudo apt -y install mariadb-client-10.1
# Installer PHP
sudo apt -y install php php-mysql
# Changer de dossier et installer wordpress
cd /tmp && wget https://wordpress.org/latest.tar.gz
tar -xvf latest.tar.gz
sudo cp -R wordpress /var/www/html/
sudo chown -R www-data:www-data /var/www/html/wordpress/
sudo chmod -R 755 /var/www/html/wordpress/
sudo mkdir /var/www/html/wordpress/wp-content/uploads
sudo chown -R www-data:www-data /var/www/html/wordpress/wp-content/uploads/
# Entrez dans le client
mysql --user=NomDeConnexionDeLAdministrateurDuServeur --password=MotDePasse --host=NomDuServeur -e "create database wordpress;"
# Copier et et modifier le fichier config
sudo cp /var/www/html/wordpress/wp-config-sample.php /var/www/html/wordpress/wp-config.php
sudo sed -i "s/database_name_here/wordpress/" /var/www/html/wordpress/wp-config.php
sudo sed -i "s/username_here/NomDeConnexionDeLAdministrateurDuServeur/" /var/www/html/wordpress/wp-config.php
sudo sed -i "s/password_here/MotDePasse/" /var/www/html/wordpress/wp-config.php
sudo sed -i "s/localhost/NomDuServeur/" /var/www/html/wordpress/wp-config.php
sudo sed -i "s/It works!/VM1/" /var/www/html/index.html
# Enjoy your Wordpress