The following text will describe a configuration procedure of LEMP server on Debian 9 Stretch Linux. The LEMP stack described by the below guide will consist of:
Debian 9 Stretch Linux
Nginx Web server
MariaDB or MySQL relational database
PHP 7 scripting language
Please be aware that our main objective is to configure bare bones LEMP stack on Debian 9 Stretch Linux. From this reason, no security hardening or performance fine-tuning recommendations are included in the article.
Once you have your bare bones, LEMP stack configured, consider a further hardening of your server based on the target deployment environment.
The MySQL flavoured LEMP stack still installs MariaDB. Is there a way to NOT install this garbage?
In both Jessie and Stretch there is also a mariadb-server package which is a MariaDB-specific analog to the mysql-server package. In Jessie this package depends on mariadb-server-10.0 and in Stretch this package depends on mariadb-server-10.1 (the same as the default-mysql-server package).
So, the main repository difference in Debian 9 “Stretch” is that when you install the mysql-server package on Stretch you will get MariaDB 10.1 instead of MySQL, like you would with previous versions of Debian. Note that mysql-server is just an empty transitional meta-package and users are encouraged to install MariaDB using the actual package mariadb-server.
Update: This is a work around to NOT install maria-db: