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 http://packages.dotdeb.org jessie all" > /etc/apt/sources.list.d/dotdeb.list
wget -O- https://www.dotdeb.org/dotdeb.gpg | 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

wget https://files.phpmyadmin.net/phpMyAdmin/4.7.6/phpMyAdmin-4.7.6-all-languages.zip
unzip phpMyAdmin-4.7.6-all-languages.zip
mv phpMyAdmin-4.7.6-all-languages phpmyadmin
mv phpmyadmin /var/www
rm phpMyAdmin-4.7.6-all-languages.zip

scp /var/www/phpmyadmin/config.sample.inc.php /var/www/phpmyadmin/config.inc.php
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/config.inc.php

nano/etc/apache2/site-available/phpmyadmin.config
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