# Préparation du nouveau système

Je vous passe la création d'une VM sous Debian 10.

### Modification du source.list

<span class="NormalTextRun  BCX0 SCXW221240791">/</span><span class="NormalTextRun SpellingErrorV2  BCX0 SCXW221240791">etc</span><span class="NormalTextRun  BCX0 SCXW221240791">/</span><span class="NormalTextRun SpellingErrorV2  BCX0 SCXW221240791">apt</span><span class="NormalTextRun  BCX0 SCXW221240791">/</span><span class="NormalTextRun SpellingErrorV2  BCX0 SCXW221240791">source.list</span>

```shell
# deb cdrom:[Debian GNU/Linux 10.4.0 _Buster_ - Official amd64 NETINST 20200509-10:25]/ buster main 

deb http://deb.debian.org/debian/ buster main contrib non-free 
deb-src http://deb.debian.org/debian/ buster main contrib non-free 

deb http://security.debian.org/debian-security buster/updates main contrib non-free 
deb-src http://security.debian.org/debian-security buster/updates main contrib non-free 

# buster-updates, previously known as 'volatile' 
deb http://deb.debian.org/debian/ buster-updates main contrib non-free 
deb-src http://deb.debian.org/debian/ buster-updates main contrib non-free 

# Backports repository 
deb http://deb.debian.org/debian buster-backports main contrib non-free 
#deb http://deb.debian.org/debian buster-backports-sloppy main contrib non-free 
```

### Installation des paquets de base

```shell
apt install -y \ 
apt-transport-https \ 
bash-completion \ 
curl \ 
dnsutils \ 
git \ 
htop \ 
locate \ 
net-tools \ 
openssl \ 
open-vm-tools \ 
python3-pip \ 
ssl-cert \ 
sudo \ 
telnet \ 
traceroute \ 
tuned \ 
v4l2loopback-utils \ 
wget \ 
unzip  
```

### <span class="TextRun SCXW213086612 BCX0" data-contrast="none" lang="FR-FR" xml:lang="FR-FR"><span class="NormalTextRun SpellingErrorV2 SCXW213086612 BCX0" data-ccp-parastyle="heading 1">MariaDB</span></span>

#### <span class="TextRun SCXW213086612 BCX0" data-contrast="none" lang="FR-FR" xml:lang="FR-FR"><span class="NormalTextRun SpellingErrorV2 SCXW213086612 BCX0" data-ccp-parastyle="heading 1">Dépôt officiel</span></span>

```
apt install software-properties-common dirmngr 
apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc' 
add-apt-repository 'deb [arch=amd64] http://ftp.igh.cnrs.fr/pub/mariadb/repo/10.4/debian buster main' 
```

#### <span class="TextRun SCXW213086612 BCX0" data-contrast="none" lang="FR-FR" xml:lang="FR-FR"><span class="NormalTextRun SpellingErrorV2 SCXW213086612 BCX0" data-ccp-parastyle="heading 1"><span class="TextRun SCXW111606051 BCX0" data-contrast="none" lang="FR-FR" xml:lang="FR-FR"><span class="NormalTextRun SCXW111606051 BCX0" data-ccp-parastyle="heading 2">Installation</span></span><span class="TextRun SCXW111606051 BCX0" data-contrast="none" lang="FR-FR" xml:lang="FR-FR"><span class="NormalTextRun SCXW111606051 BCX0" data-ccp-parastyle="heading 2"> de </span><span class="NormalTextRun SpellingErrorV2 SCXW111606051 BCX0" data-ccp-parastyle="heading 2">MariaDB</span></span></span></span>

```shell
apt install -y mariadb-client mariadb-server 
```

#### <span class="TextRun SCXW213790359 BCX0" data-contrast="none" lang="FR-FR" xml:lang="FR-FR"><span class="NormalTextRun SCXW213790359 BCX0" data-ccp-parastyle="heading 2">Sécurisation </span><span class="NormalTextRun SpellingErrorV2 SCXW213790359 BCX0" data-ccp-parastyle="heading 2">MariaDB</span></span><span class="EOP SCXW213790359 BCX0" data-ccp-props="{"201341983":0,"335559738":40,"335559739":0,"335559740":259}"> </span>

```shell
mariadb-secure-installation 
	Enter current password for root (enter for none): 
		Switch to unix_socket authentication [Y/n] y 
		Change the 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 
```

<p class="callout warning">Pour l'importation de la base de donnée, cela sera via le compte root. Avec un autre compte même avec les mêmes priviligère que root, ça ne fonctionne pas.</p>

### <span class="TextRun SCXW249075068 BCX0" data-contrast="none" lang="FR-FR" xml:lang="FR-FR"><span class="NormalTextRun SCXW249075068 BCX0" data-ccp-parastyle="heading 1">Installation d’Apache</span></span><span class="TextRun SCXW249075068 BCX0" data-contrast="none" lang="FR-FR" xml:lang="FR-FR"><span class="NormalTextRun SCXW249075068 BCX0" data-ccp-parastyle="heading 1"> et PHP</span></span>

```shell
apt -y install \ 
apache2 \ 
libapache2-mod-php \ 
php \ 
php-apcu \ 
php-cas \ 
php-cli \ 
php-curl \ 
php-gd \ 
php-gmp \ 
php-imap \ 
php-intl \ 
php-json \ 
php-ldap \ 
php-mysql \ 
php-mbstring \ 
php-xml \ 
php-xmlrpc \ 
php-zip 
```