Free Nginx AMI (LEMP) – CentOS, Nginx, MySQL & PHP-FPM
Note: This Free Nginx AMI has been merged into Nginx’s official AMI.
This Amazon EC2 AMI includes the latest Amazon Linux (Centos), Nginx 1.0.15, MySQL 5.1 & PHP 5.4 (PHP-FPM) custom installed and tuned for stability and speed.
Screenshot of top stats. This free Nginx AMI is optimized and runs fast even on t1.micro.
To access my free Nginx AMI, go to…
aws.amazon.com/amis/nginx-lemp-web-server
Changelog:
v1.0.1 – 05/25/2013: Locked down root password with “sudo passwd -l root” as per Amazon’s advice.
Hey Hayden,
Messing around with learning AWS using their free tier. Came across your AMI, installed and have gotten access via SFTP and SSH. All groovy. Even got into MySQL and did some hardening there (once I subscribed to your list here and got the extra information that was revealed!)
My question to you is I am unable to make changes to the nginx.conf file in order to set up a domain that I’m now pointing to the Elastic IP I’ve connected to the instance I’m running at AWS.
Is there a setting somewhere I forgot to check or uncheck that will allow me to make changes to the nginx files?
Thanks, in advance, for your time on this one.
James.
Hi James,
Thanks for your question. This will help me to create an FAQ in future.
Did you already edit /usr/local/nginx/conf/nginx.conf using vi or nano ?
…where you replace domain.com with your domain and also make sure you have the web files in /mnt/www/web01
Out of the box even if you load the IP or AWS domain of the instance in a browser it will load index.php which includes php info.
Hi Hayden,
Thank you so much for the AMI. I would like to install Magento on the instance. Everything is fine except that it needs pdo_mysql loaded. So I installed php-mysql by yum, but nothing changes for “php -m”. Wondering how can I load pdo_mysql. Thanks a lot!!
Si
For better performance PHP isn’t installed using yum package. It was compiled into the system. To install pdo MySQL you’ll need to recompile PHP with pdo. The same goes for Nginx. Use the “Contact” form from the top nav if you require further help.
What username should I use to access the AMI the first time? Root is just throwing a Permission Denied (publickey), even though I’m using the keypair which was used to spin up the instance. (for example: ssh -v -i /path/to/pemfile root@instanceip)
Disregard. Mixup with my pem files. Sorry for the spam.
Thanks for sharing the AMI Hayden. This has been very helpful for me and sure others too would benefit from it. I noticed that the template has word press demo built into it and when I accessed the homepage, it was really slow and the site was not even coming up completely either – broken images, no style sheets applied etc.. Do I need to do any tweaking to make it run faster and/or config something? Here is the link -> http://23.23.237.66/
I’ll fix that in the next update, by removing wordpress completely. When I first launched the AMI I created a test EC2 instance and it seems the default wordpress install left in the directory is still trying to pull from that inactive IP. So you can just delete wordpress completely then reinstall. Or you can use PHPmyAdmin to edit the wp_options table and simply replace the two url options that are pointing to the old EC2.
I took that EC2 offline because it costs about $20 per month just to run a demo.
Thanks for the quick reply and understand. I will reinstall it and see if that performance is any better.
Note that its not a “performance” issue. Your EC2 is trying to load an IP that no longer exist = timeouts. Also, even if the original EC2 still existed, it would not work correctly because that IP was the IP of the EC2 I build then cloned to create the AMI image, but the IP should be “your” EC2’s IP instead.
So going forward I will remove the WordPress install from the original Nginx image I created and then push the AMI update.
I am trying to login to MySQL with no luck. What is the password for MySQL?
Use this to set your own password:
http://www.thegeekstuff.com/2009/07/how-to-reset-forgot-mysql-root-password-on-unix-linux-windows/
Or better, MySQL is installed using repos so just reinstall MySQL.