brunch

You can make anything
by writing

C.S.Lewis

by Master Seo May 21. 2023

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


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


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

<2> 개인 정리



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


1

컴퓨팅 > 사용자 스크립트




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




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



감사합니다.

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

작품 선택

키워드 선택 0 / 3 0

댓글여부

afliean
브런치는 최신 브라우저에 최적화 되어있습니다. IE chrome safari