One of my favorite things about Digital Ocean is that they don’t restrict what you can run! To do this, you would just need to install all the component pieces from their sources, not from the package repositories (apt-get).
For the MEAN stack, you would need to download MongoDB and NodeJS from their respective websites (Angular and Express can be installed via NPM once you have Node).
For the LEMP stack, you would need to install nginx, MySQL, and PHP 7 from their corresponding websites.
Each website should have instructions on how to do so from the command line. Once everything is installed and you have your applications running, you’ll need to configure the server to actually serve the applications. The easiest way to do this, since you have nginx as part of the LEMP stack, is to set up a reverse proxy for the NodeJS app, and change your FastCGI settings for the PHP application. Digital Ocean has plenty of tutorials on each of these things.
If you can, use Ubuntu 16.04 instead of 14.04. Its package repositories will have some of the updated software you need, so you won’t have to manually install as much.