-
userdata : wordpress + rds공부합시다!/AWS 2022. 6. 30. 17:50728x90
#! /bin/bash
sudo su -
yum install -y httpd
amazon-linux-extras enable php7.2
amazon-linux-extras enable lamp-mariadb10.2-php7.2
yum install -y php php-cli php-pdo php-fpm php-json php-mysqlnd mariadb
wget https://ko.wordpress.org/latest-ko_KR.tar.gz
tar xvfz latest-ko_KR.tar.gz
cp -a wordpress/* /var/www/html/
chown apache.apache /var/www/html/*
cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
sed -i 's/DirectoryIndex index.html/DirectoryIndex index.php/g' /etc/httpd/conf/httpd.conf
sed -i 's/database_name_here/wordpress/g' /var/www/html/wp-config.php
sed -i 's/username_here/root/g' /var/www/html/wp-config.php
sed -i 's/password_here/It12345!/g' /var/www/html/wp-config.php
sed -i 's/localhost/ENDPOING/g' /var/www/html/wp-config.php
cat > /var/www/html/index.html << EOF
<html><body><h1>AWS-WEBSERVER</h1></body></html>
EOF
systemctl enable httpd
systemctl start httpd728x90'공부합시다! > AWS' 카테고리의 다른 글
05_EKS-LoadBalancer 연결 (0) 2023.07.10 06_EKS에 외부 Cluster(K8S) 등록 및 관리: EKS Connector (0) 2023.07.09 04_AWS CLI와 PowerShell을 이용한 EKS 관리 (0) 2022.06.27 03_EKS(Elastic Kubernetes Service) 구성 (0) 2022.06.26 02_ECS(Elastic Container Service) (0) 2022.06.25