Install Nginx, PHP on Amazon Linux07 Dec 2016
I’m migrating my blog and a few other stuff I have running to Amazon infrastructure. I needed an Amazon EC2 instance with PHP support and able to connect to a MySQL.
yum install nginx
yum install php70 php70-fpm php70-mysqlnd
- Edit /etc/nginx/conf.d/virtual.conf
- Edit the following properties of: /etc/php-fpm-7.0.d/www.conf
- Create a php file on /var/www/
- Access http://SERVER_IP:3000
You will need your security group for your ec2 instance to have port 3000 opened.
If you want to add them to auto start:
sudo chkconfig nginx on sudo chkconfig php-fpm on
If you want to restart this services:
sudo service nginx restart sudo service php-fpm restart