Debian 8 installer un serveur LAMP (apache2, mariadb, php7, phpmyadmin)

-installer apache2

apt-get install apache2 apache2-bin apche2-data apache2-utils ssl-cert

-installer mariadb

apt-get install mariadb-server mariadb-client

Exécutez le script mysql_secure_installation pour sécuriser la base de données:

-Enter current password fo root
-Change the root password? [Y/n] n
-Remove anonymous users ? [Y/n] Y
-Disallow root login remotley ? [Y/n] Y
-Remove test database and access to it ? [Y/n] Y
-Reload privilege tables now ? [Y/n] Y

-installer php7

Ajout du dépot Dotdeb

echo "deb jessie all" > /etc/apt/sources.list.d/dotdeb.list
wget -O- | apt-key add –
apt-get update
apt install php7.0 libapache2-mod-php7.0 php7.0-mysql php7.0-curl php7.0-json php7.0-gd php7.0-mcrypt php7.0-msgpack php7.0-memcached php7.0-intl php7.0-sqlite3 php7.0-gmp php7.0-geoip php7.0-mbstring php7.0-xml php7.0-zip

-installer phpmyadmin

mv phpMyAdmin-4.7.6-all-languages phpmyadmin
mv phpmyadmin /var/www

scp /var/www/phpmyadmin/ /var/www/phpmyadmin/
k=$(openssl rand -base64 32 | sed 's,\/,\\/,g')
o="\$cfg\['blowfish_secret'\] = '';"
n="\$cfg\['blowfish_secret'\] = '$k';"
perl -p -i -e "s/$o/$n/g" /var/www/phpmyadmin/

Alias /phpmyadmin /var/www/phpmyadmin

Options FollowSymLinks
DirectoryIndex index.php

-Activer le vhost et redémarrer apache2

a2ensite /var/www/sites-available-phpmyadmin.conf
/etc/init.d/apache2 restart