Entrar como superusuario

sudo su

Maria DB

apt-get -y install mariadb-server mariadb-client
mysql_secure_installation

//Opções de configuração do Maria DB
//Enter current password for root (enter for none): <-- press enter
//Set root password? [Y/n] <-- n
//New password: <-- Enter the new MariaDB root password here
//Re-enter new password: <-- Repeat the password
//Remove anonymous users? [Y/n] <-- y
//Disallow root login remotely? [Y/n] <-- y
//Reload privilege tables now? [Y/n] <-- y

//Teste Maria DB
mysql -u root -p

//exit para sair
exit

Apache 2

apt-get -y install apache2

PHP 5.6

apt-get -y install php5 libapache2-mod-php5

//restart apache2
systemctl restart apache2

Arquivo para visualização de configurações

gedit /var/www/html/info.php

//collar dentro do arquivo
<?php
phpinfo();
?>

chown www-data:www-data /var/www/html/info.php

Suporte MySQL/MariaDB no PHP

apt-cache search php5

apt-get -y install php5-mysqlnd php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

//restart apache2
systemctl restart apache2

phpMyAdmin

apt-get -y install phpmyadmin

//Opções de configuração
//Web server to configure automatically: <-- Select the option: apache2
//Configure database for phpmyadmin with dbconfig-common? <-- Yes
//Password of the database's administrative user: <-- Enter the MariaDB root //password
//MySQL application password for phpmyadmin: <-- Press enter, apt will create a random password automatically.
//Web server to reconfigure automatically: <-- apache2

echo "update user set plugin='' where User='root'; flush privileges;" | mysql --defaults-file=/etc/mysql/debian.cnf mysql

gedit /etc/apache2/apache2.conf

//colar no final do arquivo
# phpMyAdmin Configuration
Include /etc/phpmyadmin/apache.conf

//restart apache2
systemctl restart apache2

Habilitar rewrite

//editar arquivo
/etc/apache2/apache2.conf
//altere todos os AllowOverride None por AllowOverride All

a2enmod rewrite 
//restart apache2
service apache2 restart

Configurar dominios virtuais

gedit /etc/hosts
gedit /etc/apache2/sites-available/000-default.conf

//restart apache2
service apache2 restart

Permição para www

chmod 777 /var/www

//melhor
find /var/www -type d -exec chmod 777 {} \;
find /var/www -type f -exec chmod 777 {} \;

Por fim

//restart apache2
service apache2 restart