Skip to content

Instantly share code, notes, and snippets.

@torounit
Created November 7, 2019 06:37
Show Gist options
  • Save torounit/519f4c094e00e3941def4c7b797edfdc to your computer and use it in GitHub Desktop.
Save torounit/519f4c094e00e3941def4c7b797edfdc to your computer and use it in GitHub Desktop.
amimoto で ec2-user する。
#!/usr/bin/env bash
set -e
echo '{
"nginx" : { "config" : { "user" : "ec2-user" } },
"php" : { "config" : { "user" : "ec2-user" } },
"run_list" : [ "recipe[amimoto]" ]
}' > /opt/local/amimoto.json
/opt/local/provision
chown -R ec2-user:nginx /var/www/vhosts
echo '@reboot /bin/sh /opt/local/provision > /dev/null 2>&1; chown -R ec2-user /var/www/vhosts/' | crontab
sudo service php-fpm restart
curl -L https://gist.githubusercontent.com/torounit/519f4c094e00e3941def4c7b797edfdc/raw/3cfb4d156eac331e0085c05985956e0f2ae7c8fa/run-httpd-as-ec2-user.sh | sudo bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment