shellを作成する
vim setup.sh
以下のコードを貼り付ける
#!/bin/bash
sudo yum update -y
# nginx
sudo amazon-linux-extras install nginx1.12 -y
sudo systemctl start nginx
sudo systemctl enable nginx
# php
sudo amazon-linux-extras install php7.3 -y
sudo yum install php-xml php-mbstring -y
# mysql
sudo yum localinstall https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm -y
sudo yum install mysql-community-server -y
sudo systemctl start mysqld.service
sudo systemctl enable mysqld.service
# composer
sudo curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
実行権限を与える
chmod +x setup.sh
shellを実行する
sudo ./setup.sh
nginxの設定変更
sudo vim /etc/php-fpm.d/www.conf
user = nginx # apache > nginxに変更
group = nginx # 同上
copy
sudo yum update -y
sudo amazon-linux-extras install nginx1.12 -y
sudo systemctl start nginx
sudo systemctl enable nginx
sudo amazon-linux-extras install php7.3 -y
sudo yum install php-xml php-mbstring -y
sudo yum localinstall https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm -y
sudo yum install mysql-community-server -y
sudo systemctl start mysqld.service
sudo systemctl enable mysqld.service
sudo curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer