VOOZH about

URL: https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-14-04?comment=12605

โ‡ฑ How To Install Linux, Nginx, MySQL, PHP (LEMP) stack on Ubuntu 14.04 | DigitalOcean


How To Install Linux, Nginx, MySQL, PHP (LEMP) stack on Ubuntu 14.04

Published on April 25, 2014
Not using Ubuntu 14.04?
Choose a different version or distribution.
Ubuntu 14.04
๐Ÿ‘ How To Install Linux, Nginx, MySQL, PHP (LEMP) stack on Ubuntu 14.04

Introduction

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.

Learn more about our products

Tutorial Series: Introduction to Nginx and LEMP on Ubuntu 14.04

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.

About the author

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.

Still looking for an answer?

Was this helpful?

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!

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?

@brandon:

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!!

๐Ÿ‘ Creative Commons
This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
  • Deploy on DigitalOcean

    Click below to sign up for DigitalOcean's virtual machines, Databases, and AIML products.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and AI-native businesses

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOceanโ€™s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow โ€” whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

ยฉ 2026 DigitalOcean, LLC.Sitemap.
Dark mode is coming soon.