Easily setup LEMP on Linode
I just complete setup LEMP (Linux, nginx (engine-x), MySQL, PHP) on my Linode box, which is totally different with the traditional LAMP ( Linux , Apache , MySQL, PHP) setup, if you never heard about nginx , i would recommend you this post from pingdom (a famous website monitoring service’s blog) to understand the buzz around on nginx.
How to easily setup LEMP on Linode? I just make use of Linode’s StackScripts feature
- Select the Deploying using StackScripts links when you deploy your new Linode, select LEMP StackScripts and filling some of the fields, it will auto deploy your VPS.
- Once the VPS deployment done, the StackScripts will start running , it should take about 20~30 min , just wait for your VPS displaying nginx welcome message means the setup is done.
- You will find that the nginx init script seem like broken, you can’t really issue restart or stop command, just follow this article to create a new nginx init script .
- One important thing to take note is the path for Daemon, it shall be DAEMON=/usr/local/nginx/sbin/nginx
- The final step is changing of socket by following this article.
- Don’t forget to change the date time in your /usr/local/lib/php/php.ini to avoid date time error in your php log.
Some reference , there are different way to setup PHP with nginx
- php build in FastCGI server
- spawn-fcgi – setup article on Linode’s Library
- php fpm – setup article on Interface Lab
Base on my research it seem like PHP-FPM is winning in term of performance and it will be integrate into PHP core, that’s why it should be the first choice if you try to setup a LEMP box , but since you need to manually compile PHP, it will be quite troublesome to do upgrade.
If you find it this post is helpful and planning to get a Linode box , please use my referral code , this will help me fund my box, thanks.