![]() |
VOOZH | about |
The LEMP software stack is a group of software that can be used to serve dynamic web pages and web applications. This is an acronym that describes a Linux operating system, with an Nginx web server. The backend data is stored in MySQL and the dynamic processing is handled by PHP.
In this guide, we will demonstrate how to install a LEMP stack on an Ubuntu 14.04 server. The Ubuntu operating system takes care of the first requirement. We will describe how to get the rest of the components up and running.
Note: The LEMP Stack can be installed automatically on your Droplet by adding this script to its User Data when launching it. Check out this tutorial to learn more about Droplet User Data.
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
This tutorial series helps sysadmins set up a new web server using the LEMP stack, focusing on Nginx setup with virtual blocks. This will let you serve multiple websites from one Droplet.
Youโll start by setting up your Ubuntu 14.04 server and end with multiple virtual blocks set up for your websites. An Nginx configuration guide is included at the end for reference.
Former Senior Technical Writer at DigitalOcean, specializing in DevOps topics across multiple Linux distributions, including Ubuntu 18.04, 20.04, 22.04, as well as Debian 10 and 11.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Step Four: The location block provided results in error: nginx: [emerg] unknown directive โfast_cgi_split_path_infoโ in /etc/nginx/sites-enabled/default:56
Need to remove the underscore between fast and cgi: fastcgi_split_path_info ^(.+.php)(/.+)$;
Step Two I installed mysql-server-5.6, when I run the mysql_install_db command I get the following error:
user@host:~$ sudo mysql_install_db FATAL ERROR: Could not find my-default.cnf
If you compiled from source, you need to run โmake installโ to copy the software into the correct location ready for operation.
If you are using a binary release, you must either be at the top level of the extracted archive, or pass the --basedir option pointing to that location.
Any idea what Dir I should be running this from or what --basedir option to use?
Brilliant tutorial, thanks Justin!
Really informative and Iโm very happy you explained what every configuration means exactly.
Good work :)
Hiiโฆ how to install wordpress with nginx on ubuntu 14.04? any tutorial here? can i use this tutorial: https://www.digitalocean.com/community/articles/how-to-install-wordpress-with-nginx-on-ubuntu-12-04 ?
@davidprimadi: It should be more or less the same on 14.04 as on 12.04. Let us know how it goes!
itโs work!
Great! Glad to hear it.
In step 5 of the 12.04 LEMP install tutorial, the instructions state to make the following change in the /etc/php5/fpm/pool.d/www.conf:
change: listen = 127.0.0.1:9000 to listen = /var/run/php5-fpm.sock
However in Step 3 this 14.04 tutorial we are not instructed to do so. Any reason why?
In 14.04, php5-fpm defaults to using the socket file instead of communicating over 127.0.0.1:9000. So the reason you donโt need to change it is because it should already read โlisten = /var/run/php5-fpm.sockโ
Great!! Itโs works!! Congrats!!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.