---
# System prepended metadata

title: USER DATA
tags: [林展]

---

# USER DATA
## RDS
#!/bin/bash
amazon-linux-extras enable php7.2
yum install httpd php php-mysqlnd php-fpm php-pdo php-cli -y
yum install httpd php php-mysql -y
cd /var/www/html
wget https://wordpress.org/wordpress-5.1.1.tar.gz
tar -xzf wordpress-5.1.1.tar.gz
cp -r wordpress/* /var/www/html/
rm -rf wordpress
rm -rf wordpress-5.1.1.tar.gz
chmod -R 755 wp-content
chown -R apache:apache wp-content
service httpd start
chkconfig httpd on
## APACHE
#!/bin/bash
yum update -y
amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2
yum install -y httpd mariadb-server
systemctl start httpd
systemctl enable httpd
usermod -a -G apache ec2-user
chown -R ec2-user:apache /var/www
chmod 775 /var/www
find /var/www -type d -exec chmod 775 {} \;
find /var/www -type f -exec chmod 664 {} \;
echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php
echo "Service Running" > /var/www/html/index.html
## RDS+EFS 
EFS設定/var/www/html
尾端+
#!/bin/bash
amazon-linux-extras enable php7.2
yum install httpd php php-mysqlnd php-fpm php-pdo php-cli -y
yum install httpd php php-mysql -y
cd /var/www/html
wget https://wordpress.org/wordpress-5.1.1.tar.gz
tar -xzf wordpress-5.1.1.tar.gz
cp -r wordpress/* /var/www/html/
rm -rf wordpress
rm -rf wordpress-5.1.1.tar.gz
chmod -R 755 wp-content
chown -R apache:apache wp-content
service httpd start
chkconfig httpd on
## CREATE TABLE unicorns(unicornid varchar(256),unicornlocation varchar(256));
###### tags: `林展`


