brunch

7. 가비아 클라우드 - 사용자 스크립트

by Master Seo


사용자 스크립트를 미리 만들어 서버 생성시 1번 적용가능하다.


<1> 사용자 스크립트 생성

<2> 개인 정리



<1> 사용자 스크립트 생성


1

컴퓨팅 > 사용자 스크립트


10 책임지지.png



// 사용자가 작성한 스크립트 책임지지 않습니다는 불필요?




2

샘플



#!/bin/bash

yum -y install httpd

systemctl enable httpd

systemctl start httpd

echo '<html><h1>Hello From Your Web Server!</h1></html>' > /var/www/html/index.html





UserData:

Fn::Base64:

!Sub |

#!/bin/bash

hostname Server-EC2

yum install httpd lynx tmux tcpdump -y

systemctl start httpd && systemctl enable httpd

echo "<h1>Security Group & Network ACL TEST 1</h1>" > /var/www/html/index.html



#!/bin/bash

hostnamectl --static set-hostname VPC1-EC2

yum -y install tcpdump httpd

service httpd start

chkconfig httpd on

echo "<html><h1> APM Server</h1></html>" > /var/www/html/index.html





https://brunch.co.kr/@topasvga/3261



감사합니다.

keyword
매거진의 이전글6. 가비아 클라우드 - 이미지 백업