Created
October 31, 2020 06:07
-
-
Save yuyasugano/6a627a82fe5dedbc0f5bf84c9da5a421 to your computer and use it in GitHub Desktop.
User data and cloud-init directives
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
repo_update: true | |
repo_upgrade: all | |
packages: | |
- httpd | |
- mariadb-server | |
runcmd: | |
- [ sh, -c, "amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2" ] | |
- systemctl start httpd | |
- sudo systemctl enable httpd | |
- [ sh, -c, "usermod -a -G apache ec2-user" ] | |
- [ sh, -c, "chown -R ec2-user:apache /var/www" ] | |
- chmod 2775 /var/www | |
- [ find, /var/www, -type, d, -exec, chmod, 2775, {}, \; ] | |
- [ find, /var/www, -type, f, -exec, chmod, 0664, {}, \; ] | |
- [ sh, -c, 'echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php' ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment