The installation of a server LEMP Linux + Nginx + MySQL + PHP might be more useful and efficient than an Apache (server LAMP).

Nginx installation

It will be essential to know the machine’s IP address to install from ifconfig.

From your system on Debian 8, we install nginx via the command :

Your server nginx is now operational and available except if a rule prevent the streams HTTP and in this case, you have to check netfilter (iptables / ufw).

MySQL installation

Then, you need to install MySQL via the following command :

During the installation, you will be asked to choose a password root.

It is advisable to carefully choose your password preferably alphanumerical and including special characters.

To proceed with the installation, the following command has to be executed :

Enter your password root when requested and confirm the four following questions with yes :

PHP installation

Since Nginx does not contain PHP natively, it is important to install the PHP process manager called PHP FPM (FastCGI Process Manager) :

Then, we are going to change the PHP configuration by changing the cgi.fix_pathinfo variable value to 1 or simply un-comment the line :

Finally, we restart the PHP service :

Nginx configuration

Now, we are going to change our default vhost so that Nginx uses the PHP processor :

The red elements need to be added to the default vhost file :

Now, we need to check the Nginx configuration then reload the service and in case of error, we would have to review the previous configured file :


To conclude, we are going to test pour LEMP server with a page phpinfo :

The result is available from the url http://server_domain_or_address_IP/phpinfo.php and it leads to the following result :

From now on, your LEMP server is operational and will allow you performance enhancements, especially in terms of requests number compared to a LAMP server on Apache.

Categories: SystemTutorials

JN Community

Les Ressources, en particulier les tutoriaux, présupposent que l’Utilisateur qui décide de les mettre en œuvre dispose des connaissances, des compétences et de l’expérience nécessaire pour cette mise en œuvre. L’Utilisateur disposant d’une connaissance, compétence et/ou expérience limitée ou insuffisante doit absolument s’abstenir de mettre en œuvre les Ressources par lui-même. Jaguar Network décline toute responsabilité quant aux conséquences dommageables de la mise en œuvre des Ressources, notamment sur les infrastructures informatiques de l’Utilisateur, de ses commettants ou préposés ou de tout tiers. Il est précisé en tant que de besoin que toute intervention de Jaguar Network visant à réparer les dommages causés par la mise en œuvre des Ressources par un Utilisateur ne disposant pas des connaissances, compétences et/ou expériences suffisantes sera facturée et fera l’objet d’un devis préalable et d’un bon de commande aux conditions des contrats Jaguar Network en vigueur.

Related Posts


Shutdown and restart your Linux system

Vote On Linux system, there are a lot of commands to shutdown and reboot your system. This tutorial aims to detail some existing possibilities. Articles similaires


Operating load-balancing with HAproxy

Vote HAproxy is a software allowing Load-Balancing between several web servers by allocating requests in an almost transparent way for the user. Articles similaires


10 tips to write efficient scripts on Linux

Vote The shell script is the most simple type of programming you would write on Linux. Moreover, it is a necessary skill to automate your system administration tasks, to develop new simple features, … In Read more…