859
Amazon Elastic Compute Cloud Linux 인스턴스용 사용 설명서

Amazon Elastic Compute Cloud ·  · 2017-03-21IAM 사용자 생성 ... IAM 사용자에게 Amazon EC2 사용 보고서에 대한 액세스 권한 부여

Embed Size (px)

Citation preview

  • Amazon Elastic Compute CloudLinux

  • Amazon Elastic Compute CloudLinux

    Amazon Elastic Compute Cloud: Linux Copyright 2017 Amazon Web Services, Inc. and/or its affiliates. All rights reserved.

    Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any mannerthat is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks notowned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored byAmazon.

  • Amazon Elastic Compute CloudLinux

    Table of ContentsAmazon EC2 ? ................................................................................................................ 1

    Amazon EC2 ................................................................................................................... 1 Amazon EC2 ................................................................................................... 2 ............................................................................................................................... 2Amazon EC2 ................................................................................................................ 3Amazon EC2 ...................................................................................................................... 4PCI DSS ............................................................................................................................ 4 AMI ......................................................................................................................... 4

    ............................................................................................................................ 4AMI .................................................................................................................................. 6

    ....................................................................................................................... 7 ....................................................................................................... 7 ................................................................................................................ 8 Endpoint ................................................................................................................ 9 .......................................................................................... 9 .................................................................................................... 10 .............................................................................................. 10 ........................................................................... 11

    ................................................................................................................... 11 .............................................................................................. 12 AMI ................................................................................... 13 .................................................................................... 13 ......................................................................... 14

    ................................................................................................................................................ 16AWS ............................................................................................................................. 16IAM ....................................................................................................................... 16 ............................................................................................................................ 18Virtual Private Cloud(VPC) .................................................................................................. 19 ......................................................................................................................... 19

    .......................................................................................................................................... 21 ........................................................................................................................................ 21 ................................................................................................................................. 221: ................................................................................................................. 222: .............................................................................................................. 233: ................................................................................................................. 24 ................................................................................................................................. 24

    ......................................................................................................................................... 25 ............................................................................................................................................. 27

    : Amazon LinuxLAMP .................................................................................... 27 ......................................................................................................................... 36 ......................................................................................................................... 37

    : WordPress ............................................................................................... 37 ......................................................................................................................... 37WordPress ................................................................................................................ 38 ......................................................................................................................... 44! DNS . ..................................... 45

    : SSL/TLS Amazon Linux Apache .............................................. 46 ......................................................................................................................... 471: SSL/TLS ........................................................................................ 472: CA ................................................................................... 483: ......................................................................................... 52 ......................................................................................................................... 54

    : ............................................................................................ 54 ......................................................................................................................... 55

    iii

  • Amazon Elastic Compute CloudLinux

    ....................................................................................... 55 ........................................................................................................... 57

    : ........................................................................................................ 57 ........................................................................................................ 58 SSM .................................................................................. 58SSM ........................................................................................................... 58EC2 ....................................................................................... 60AWS CLI ....................................................................................... 60

    Amazon ......................................................................................................................... 62AMI ................................................................................................................................. 62 AMI .......................................................................................................................... 62AMI , .............................................................................................................. 63AMI .......................................................................................................................... 63Amazon Linux .......................................................................................................................... 63AMI ................................................................................................................................. 63

    ......................................................................................................................... 64 ..................................................................................................... 64

    .............................................................................................................................. 66Linux AMI ......................................................................................................................... 67

    Amazon EC2 Linux AMI ...................................................................... 68AWS CLI AMI ........................................................................................... 68

    AMI ................................................................................................................................. 69 AMI .................................................................................................................. 69 AMI ............................................................................................................... 71 AWS AMI ............................................................................................. 72 ...................................................................................................................... 73 Linux AMI ......................................................................................................... 74

    AMI ................................................................................................................................. 78AMI ......................................................................................................................... 79 AMI .................................................................................................................. 79 AMI .................................................................................................................. 80 .................................................................................... 80 ................................................................................................................. 80 AMI ...................................................................................... 81AWS Marketplace ............................................................................................... 81

    Amazon EBS Linux AMI .............................................................................................. 82Amazon EBS AMI ....................................................................................... 82 Linux AMI ............................................................................................. 83 Linux AMI ............................................................................................. 84

    Linux AMI .......................................................................................... 85 AMI ...................................................................... 85 ......................................................................................................................... 85AMI .................................................................................................................. 86 AMI ..................................................................... 109Amazon EBS AMI .......................................................................................... 118

    AMI ..................................................................................................... 121 EBS AMI .................................................................. 121

    AMI ................................................................................................................................ 123 .............................................................................................................................. 123 AMI ............................................................................................................ 124 AMI ......................................................................................................... 124 AMI ......................................................................................................... 125AMI ........................................................................................................................ 126 AMI ........................................................................................... 127

    AMI ........................................................................................................................ 127Amazon EBS AMI ............................................................................................. 127 AMI ......................................................................................... 128

    iv

  • Amazon Elastic Compute CloudLinux

    Amazon Linux ......................................................................................................................... 128Amazon Linux AMI ................................................................................................... 129Amazon Linux ................................................................................. 129Amazon Linux AMI ........................................................................................ 129 AWS ................................................................................................. 130cloud-init .................................................................................................................... 131 .............................................................................................................. 132 .................................................................................................................... 133 ...................................................................................... 133 ........................................................................................................... 134 ................................................................................................... 134 ................................................................................................................ 134 ................................................................................................................. 134 .............................................................................................................................. 135

    ..................................................................................................................... 135HVM AMI(GRUB) ............................................................................................................ 135 AMI(PV-GRUB) .................................................................................................. 136

    ........................................................................................................................................ 142 ......................................................................................................................... 143

    ............................................................................................... 143 ................................................................................................................. 144 .................................................................................................................... 144 ............................................................................................... 145 ................................................................................................................. 146T2 ................................................................................................................... 146 ................................................................................................... 149 ................................................................................................... 152 ................................................................................................ 154 ....................................................................................... 158T1 ...................................................................................................... 163 ......................................................................................................... 165

    ................................................................................................................. 169 .................................................................................................. 170 ................................................................................................................. 171 .............................................................................................................. 193 ................................................................................................................. 196 .................................................................................................................... 239 ................................................................................................................. 249

    ................................................................................................................. 254 ................................................................................................................. 254 (Amazon EBS ) ................................................ 254 .............................................................................................................. 254 ................................................................................................................. 255 ................................................................................................................. 255, ............................................................................................. 255 ........................................................................................................................ 256 .............................................................................................................................. 266 ................................................................................................................... 276 ........................................................................................................................... 279 .............................................................................................................................. 280Terminate ....................................................................................................................... 282 .............................................................................................................................. 286

    ......................................................................................................................... 287 ................................................................................................... 287 .............................................................................................................. 288 .................................................................................................................... 295 ......................................................................................................... 297

    v

  • Amazon Elastic Compute CloudLinux

    ....................................................................................................................... 301 ............................................................................................................. 304 DNS ............................................................................................................... 306 ........................................................................................................... 308 ............................................................................... 311

    EC2 ................................................................................... 325Xen UUID ..................................................................................................... 325 ........................................................................................... 326

    Amazon EC2 Systems Manager ........................................................................................................ 327Systems Manager ............................................................................................................ 327 ................................................................................................................................ 328 ............................................................................................................................... 329 ............................................................................................................................ 331

    ................................................................. 332 ................................................................... 333

    SSM ................................................................................................................. 337 EC2 SSM .............................................................. 338EC2 SSM .......................................................................... 339SSM ........................................................................ 344SSM ......................................................................................................... 345

    Systems Manager .............................................................................. 345IAM ................................................................................................... 346 ........................................................................................ 347 VM SSM . ............................................... 348

    ........................................................................................................................ 349 ......................................................................................................... 349Maintenance Windows ..................................................................................................... 360Parameter Store .............................................................................................................. 377Cron ...................................................................................................................... 386

    (Run Command) ....................................................................................................... 388 ........................................................................................................... 390 ....................................................................................................................... 392 ..................................................................................................... 398Run Command ................................................................................................. 408

    ......................................................................................................................... 410 ........................................................................................................... 410Systems Manager Inventory .............................................................................................. 411 ......................................................................................................... 413 ......................................................................................................... 414Inventory Manager ............................................................................................ 414

    ............................................................................................................................... 418 ....................................................................................................................... 418State Manager ......................................................................................................... 418State Manager ......................................................................................................... 419State Manager ................................................................................................. 420

    ................................................................................................................................... 422 .................................................................................................................... 423 ............................................................................................................. 426 .................................................................................................. 435 ......................................................................................................... 448

    ........................................................................................................................................ 458 ............................................................................................................. 459

    ......................................................................................................... 460 ......................................................................................................... 461

    ................................................................................................................. 461 ........................................................................................................... 461

    ......................................................................................................... 462

    vi

  • Amazon Elastic Compute CloudLinux

    ................................................................................................................. 466CloudWatch ............................................................................. 469

    ...................................................................................................... 469 ................................................................................................. 471 .................................................................................................. 475 ................................................................................................................. 480 .................................................................................................................... 481 , , ..................................................... 481

    ............................................................................................. 489 .............................................................................................................. 489 .................................................................................................................... 490 ....................................................................................................................... 490 ........................................................................................................................ 491mon-put-instance-data.pl .................................................................................................. 492mon-get-instance-stats.pl .................................................................................................. 494 ..................................................................................... 496 ....................................................................................................................... 496

    ............................................................................................................................ 497 .................................................................................................................................. 498

    Amazon EC2 ............................................................................... 499Amazon EC2 ...................................................................... 499 (Linux) ................................................................................. 501 (Windows) ............................................................................ 502 ........................................................................................................ 502 ................................................................................................................... 502 Linux ................................................... 503

    ............................................................................................................................... 506EC2-Classic .................................................................................................. 507EC2-VPC ..................................................................................................... 507 ................................................................................................................ 507 ................................................................................................................ 509 ..................................................................................................... 509 ................................................................................................................ 510 ........................................................................................................ 513

    Controlling Access ................................................................................................................... 519 ...................................................................................... 519Amazon EC2 ................................................................................................... 519IAM Amazon EC2 ....................................................................................................... 519IAM ........................................................................................................................ 521IAM ........................................................................................................................ 560 .............................................................................................................. 568

    Amazon VPC .......................................................................................................................... 569VPC .................................................................................................................... 570EC2-Classic EC2-VPC ..................................................................................... 570EC2-Classic EC2-VPC .............................................................. 572VPC ........................................................................... 573Amazon VPC .......................................................................................................... 574 .............................................................................................................. 574ClassicLink ..................................................................................................................... 575EC2-Classic VPC ............................................................................... 584

    IP ............................................................................................................. 593 IPv4 DNS ..................................................................... 593 IPv4 DNS ........................................................................ 594 IP (IPv4) ...................................................................................................... 595Amazon DNS .......................................................................................................... 595IPv6 ....................................................................................................................... 595EC2-Classic EC2-VPC IP .......................................................................... 596

    vii

  • Amazon Elastic Compute CloudLinux

    IP ........................................................................................... 597 IP ................................................................................................................... 601

    IP ........................................................................................................................ 608 IP ................................................................................................. 609EC2-Classic EC2-VPC IP ........................................................... 609 IP ........................................................................................................ 611 DNS ............................................................................ 615 IP ........................................................................................................ 615

    ................................................................................................................ 615 / IP .................................................................. 617 .......................................................................................... 620 .................................................................................. 620ec2-net-utils .............................................................. 621 ................................................................................................ 622

    ............................................................................................................................... 630 ..................................................................................................... 631 ............................................................................................ 632 ................................................................................................................ 633

    MTU ........................................................................................................................ 633 (9001 MTU) ................................................................................................... 634 MTU ............................................................................................................... 634 MTU ............................................................................................ 634Amazon EC2 MTU .................................................................... 635 ....................................................................................................................... 636

    ...................................................................................................................... 636 ...................................................................................................... 636 ......................................................................... 637 : Intel 82599 VF ................................................................................ 637 : ENA .............................................................................................. 646ENA ............................................................................................................... 655

    ........................................................................................................................................ 662Amazon EBS .......................................................................................................................... 663

    Amazon EBS ....................................................................................................... 664EBS ....................................................................................................................... 665EBS .................................................................................................................... 709EBS .................................................................................................................... 716EBS .................................................................................................................... 720EBS ....................................................................................................................... 723EBS CloudWatch .................................................................................................. 739

    ...................................................................................................................... 745 ...................................................................................................... 745 ................................................................................................... 746 ............................................................................................... 748SSD ............................................................................................... 751 ............................................................................................ 753 ......................................................................................................... 756

    Amazon EFS .......................................................................................................................... 756 ....................................................................................................................... 7571: EFS ......................................................................................... 7572: ................................................................................................ 7573: ................................................................................................ 7584: .................................................................................................................... 759

    Amazon S3 ............................................................................................................................ 759Amazon S3 Amazon EC2 ............................................................................................. 760

    ................................................................................................................. 761Linux .............................................................................................................. 761Windows ......................................................................................................... 762

    viii

  • Amazon Elastic Compute CloudLinux

    ........................................................................................................ 762 ......................................................................................................................... 762

    ............................................................................................... 763 .................................................................................................. 763

    ................................................................................................................. 764 ............................................................................................... 764AMI ................................................................................................... 766 ............................................................................................ 768

    .......................................................................................................... 772 .................................................................................................. 772 .................................................................................................. 772 ........................................................................... 773 ............................................................................. 774

    ................................................................................................................................ 775 ............................................................................................................................ 775 ID ............................................................................................................................... 776

    ID ................................................................................................................. 777 ID .......................................................................................... 779

    .......................................................................................................... 780 ....................................................................................................................... 780 ......................................................................................... 781 ...................................................................................... 781CLI API ............................................................................ 782

    ................................................................................................................. 782 ................................................................................................................ 783 ....................................................................................................................... 783 ............................................................................................... 785 .................................................................................................. 785CLI API ...................................................................................... 788

    ............................................................................................................................ 789 ................................................................................................................ 789 ................................................................................................................ 789

    ............................................................................................................................ 789 .............................................................................................................. 790 .................................................................................................. 790IAM Amazon EC2 ........................................ 791 .............................................................................................................. 792EC2 .................................................................................................. 794

    ....................................................................................................................................... 799 ......................................................................................................................... 799

    .................................................................................................. 799 ...................................................................................................................... 800

    : ........................................................................ 800r: ......................................................................... 802: . ( ) , ........................ 803: ................................................................................ 804: ........................................................ 805Safari MindTerm ................................................................ 805Mac OS X RDP .................................................................... 806 ping ................................................................................................ 806

    ......................................................................................................................... 806 ......................................................................................................................... 807

    ...................................................................................................... 807 ......................................................................................... 807 ........................................................................................... 807

    ................................................................................................................. 808 ........................................................................................................................ 808

    ix

  • Amazon Elastic Compute CloudLinux

    ....................................................................................................................... 809 ............................................................................................................. 809Linux .............................................................. 810 : .............................................................................................. 811ERROR: mmu_update failed( ) ....................................................... 811I/O ( ) ............................................................................................ 812IO ERROR: neither local nor remote disk( ) ...................................... 813request_module: runaway loop modprobe( Linux modprobe ) ........ 814"FATAL: kernel too old" "fsck: No such file or directory while trying to open /dev"( AMI) .......................................................................................................................... 814"FATAL: Could not load /lib/modules" "BusyBox"( ) ..................................... 815ERROR Invalid kernel(EC2 ) ............................................................... 816request_module: runaway loop modprobe( Linux modprobe ) ........ 817fsck: No such file or directory while trying to open...( ) ....................... 818 ( ) .................................................................. 819VFS: Unable to mount root fs on unknown-block( ) ............................... 821Error: Unable to determine major/minor number of root device...( / ) ................................................................................................................................ 822XENBUS: Device with no driver... ...................................................................................... 823... days without being checked, check forced( ) ....................................... 824fsck died with exit status...( ) .......................................................................... 824GRUB (grubdom>) .............................................................................................. 825Bringing up interface eth0: Device eth0 has different MAC address than expected, ignoring(eth0 : eth0 MAC ). ( MAC) ............................................................................................................................. 827Unable to load SELinux Policy. Machine is in enforcing mode. Halting now(SELinux . . ). ( SELinux ) ................. 828XENBUS: Timeout connecting to devices(Xenbus ) ................................................. 829

    ......................................................................................................................... 830Error: InsufficientInstanceCapacity ..................................................................................... 830Error: InstanceLimitExceeded ............................................................................................ 830

    ...................................................................................... 830 .............................................................................................................. 830 ......................................................................................................... 831 ........................................................................... 831 ................................................................................. 832

    .................................................................................... 832 ....................................................................................................................................... 834AWS Glossary ................................................................................................................................ 849

    x

  • Amazon Elastic Compute CloudLinux

    Amazon EC2

    Amazon EC2 ?

    Amazon Elastic Compute Cloud(Amazon EC2) Amazon Web Services(AWS) . Amazon EC2 . Amazon EC2 . Amazon EC2 .

    ? .

    Amazon EC2 Amazon EC2 .

    : Amazon (AMI):

    . : CPU, , , (AWS

    ) : Amazon Elastic Block Store(Amazon EBS), Amazon EBS

    Amazon EBS , , IP IP (EIP): IPv4 : Amazon EC2 AWS ,

    , Virtual Private Clouds(VPC)

    Amazon EC2 Amazon EC2 .

    1

    http://aws.amazon.com/what-is-cloud-computing/http://aws.amazon.com/ec2

  • Amazon Elastic Compute CloudLinux

    Amazon EC2

    AWS .

    Amazon EC2 Amazon EC2 , . , Amazon EC2 . Amazon EC2 .

    Amazon EC2 (p. 16) Amazon EC2 Linux (p. 21)

    AMI (p. 4) (p. 7) (p. 143) (p. 782)

    Amazon EC2 (p. 498) (p. 506) IP (p. 608) Amazon EC2 Amazon VPC (p. 569)

    Amazon EBS (p. 663) (p. 745)

    Linux

    (Run Command) (p. 388) : Amazon LinuxLAMP (p. 27) : SSL/TLS Amazon Linux Apache (p. 46) AWS : Linux

    AWS AWS . Amazon EC2 Amazon EC2 forum .

    Amazon EC2 , Amazon EC2 . AWS Amazon EC2 . .

    2

    http://aws.amazon.com/websites/http://docs.aws.amazon.com/gettingstarted/latest/wah-linux/http://aws.amazon.com/contact-us/https://forums.aws.amazon.com/forum.jspa?forumID=30

  • Amazon Elastic Compute CloudLinux

    Amazon EC2

    Auto Scaling AWS CloudFormation AWS Elastic Beanstalk AWS OpsWorks User Guide

    Elastic Load Balancing . Elastic Load Balancing .

    Amazon CloudWatch Amazon EBS . Amazon CloudWatch .

    AWS CloudTrail AWS Management Console, AmazonEC2 API . AWS CloudTrail User Guide .

    Amazon Relational Database Service(Amazon RDS) , AWS , . EC2 , Amazon RDS , , . Amazon Relational Database Service .

    (VM) AWS AMI VMImport/Export . VM Import/Export .

    Amazon EC2 Amazon EC2 Amazon EC2 . AWS AWS Management Console EC2 Amazon EC2 .

    .

    AWS (CLI)

    AWS Windows, Mac, Linux . AWS Command Line Interface . Amazon EC2 EC2(AWS Command Line Interface Reference) .

    Windows PowerShell AWS

    PowerShell AWS , . Windows PowerShell AWS . Amazon EC2 cmdlets Windows PowerShell AWS Reference .

    Amazon EC2 Query API . , HTTP HTTPS GET POST, "Action" . Amazon EC2 API (Amazon EC2 API Reference) .

    HTTP HTTPS , API AWS, , , . HTTP/HTTPS , , , . AWS SDK .

    3

    http://docs.aws.amazon.com/autoscaling/latest/userguide/http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/http://docs.aws.amazon.com/opsworks/latest/userguide/http://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/http://docs.aws.amazon.com/awscloudtrail/latest/userguide/http://docs.aws.amazon.com/AmazonRDS/latest/DeveloperGuide/http://docs.aws.amazon.com/AmazonRDS/latest/DeveloperGuide/http://docs.aws.amazon.com/vm-import/latest/userguide/http://docs.aws.amazon.com/cli/latest/userguide/http://docs.aws.amazon.com/cli/latest/reference/ec2/index.htmlhttp://docs.aws.amazon.com/powershell/latest/userguide/http://docs.aws.amazon.com/powershell/latest/reference/Index.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/APIReference/query-apis.htmlhttp://aws.amazon.com/tools/

  • Amazon Elastic Compute CloudLinux

    Amazon EC2

    Amazon EC2 AWS Amazon EC2 AWS .

    , Amazon EC2 :

    .

    1 3 ( ) .

    . . , Amazon EC2 .

    Amazon EC2 Amazon EC2 .

    AWS .

    AWS . . AWS AWS .

    AWS , AWS .

    AWS , Trusted Advisor AWS Trusted Advisor .

    PCI DSS Amazon EC2 , , Payment Card Industry(PCI) Data Security Standard(DSS) .AWS PCI PCI DSS PCI DSS 1 .

    AMIAmazon (AMI) (: , , ). AMI , AMI , . , AMI .

    . AMI .

    AMI . .

    4

    http://aws.amazon.com/free/http://aws.amazon.com/ec2/pricinghttp://aws.amazon.com/economics/http://aws.amazon.com/account-activityhttp://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/http://aws.amazon.com/contact-us/https://aws.amazon.com/premiumsupport/trustedadvisor/https://aws.amazon.com/compliance/pci-dss-level-1-faqs/https://aws.amazon.com/compliance/pci-dss-level-1-faqs/

  • Amazon Elastic Compute CloudLinux

    . . Amazon EC2 Amazon EC2 .

    , , . , sudo .

    AWS . Amazon EC2 ( FAQ Amazon EC2) .

    . Amazon EC2 (p. 11) .

    , . (p. 764) . , . , . Amazon S3 Amazon EBS . (p. 662) .

    AWS Identity and Access Management(IAM) AWS

    . AWS IAM AWS . Amazon EC2 (p. 519) .

    . 22 SSH . Linux Amazon EC2 (p. 506) .

    . . .

    AMI . . (p. 75) . AMI AMI (p. 69) .

    ,

    stopped . Amazon EBS .

    . " " , . , . Amazon EBS Amazon EBS .

    Amazon EBS . AMI , , , .

    5

    https://aws.amazon.com/ec2/instance-types/http://aws.amazon.com/ec2/faqs/#How_many_instances_can_I_run_in_Amazon_EC2

  • Amazon Elastic Compute CloudLinux

    AMI

    Amazon EBS (, deleteOnTermination false ). .

    . disableApiTermination true . Linux shutdown -h Windows shutdown instanceInitiatedShutdownBehavior stop terminate . Amazon EBS stop , .

    (p. 254) .

    AMIAmazon Web Services(AWS) Amazon (AMI) . AWS AMI . AMI , . , , AMI . , AMI , Request .

    Amazon EBS (AMI Amazon EBS ) (AMI Amazon S3 ) .

    AMI , ebs instance store . AMI . (p. 64) .

    6

  • Amazon Elastic Compute CloudLinux

    Amazon EC2 . . . . Amazon EC2 , . .

    Amazon . . .

    (p. 7) (p. 8) Endpoint (p. 9) (p. 9) (p. 10) (p. 10) (p. 11)

    . , . .

    Amazon EC2 . (p. 775) .

    Amazon EC2 Amazon EC2 . .

    . , AWS .

    AMI . AMI AMI . AMI (p. 123) .

    . . . Amazon EC2 - .

    AWS . , .

    7

    http://aws.amazon.com/ec2/pricing/#DataTransfer

  • Amazon Elastic Compute CloudLinux

    IP . IP (p. 608) .

    . : us-east-1a. AWS . us-east-1a us-east-1a . .

    AWS . AWS ( ). . .

    . (p. 9) .

    . :

    AWS Amazon EC2 . .

    AWS GovCloud (US) AWS GovCloud (US) . AWS GovCloud (US) Region .

    Amazon AWS () () .

    AWS . AWS GovCloud (US) () AWS .

    us-east-1 ( )

    us-east-2 ()

    us-west-1 ( )

    us-west-2 ()

    ca-central-1 ()

    eu-west-1 EU()

    eu-central-1 EU()

    eu-west-2 EU()

    ap-northeast-1 ()

    ap-northeast-2 ()

    ap-southeast-1 ()

    ap-southeast-2 ()

    ap-south-1 ()

    8

    https://aws.amazon.com/govcloud-us/

  • Amazon Elastic Compute CloudLinux

    Endpoint

    sa-east-1 ()

    AWS .

    AWS Amazon EC2 . (p. 9) .

    Endpoint API , . Amazon EC2 Amazon Web Services Regions and Endpoints .

    AWS GovCloud (US) AWS GovCloud (US) User GuideAWS GovCloud (US) Endpoints .

    Amazon EC2 . Amazon EC2 (p. 3) .

    1. https://console.aws.amazon.com/ec2/ Amazon EC2 .2. (region selector) .

    3. [Service Health], [Availability Zone Status] .

    1. [AWS CLI] describe-regions .

    aws ec2 describe-regions

    2. [AWS CLI] describe-availability-zones .

    aws ec2 describe-availability-zones --region region-name

    3. [Windows PowerShell AWS ] Get-EC2Region .

    Get-EC2Region

    4. [Windows PowerShell AWS ] Get-EC2AvailabilityZone .

    Get-EC2AvailabilityZone -Region region-name

    9

    https://aws.amazon.com/about-aws/global-infrastructure/http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_regionhttp://docs.aws.amazon.com/govcloud-us/latest/UserGuide/using-govcloud-endpoints.htmlhttps://console.aws.amazon.com/ec2/http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-regions.htmlhttp://docs.aws.amazon.com/cli/latest/reference/ec2/describe-availability-zones.htmlhttp://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Region.htmlhttp://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2AvailabilityZone.html

  • Amazon Elastic Compute CloudLinux

    Amazon EC2 . AWS ManagementConsole .

    Note

    AWS . .

    1. https://console.aws.amazon.com/ec2/ Amazon EC2 .2. .

    (: https://ec2.us-west-1.amazonaws.com).

    AWS_DEFAULT_REGION (AWS CLI) Set-AWSDefaultRegion (Windows PowerShell AWS )

    --region(AWS CLI) -Region(Windows PowerShell AWS ) . , --region us-west-1.

    Amazon EC2 Amazon Elastic Compute Cloud .

    , . .

    , . AWS . . AWS . , .

    1. https://console.aws.amazon.com/ec2/ Amazon EC2 .2. Launch Instance .3. . [Configure Instance Details]( )

    .

    [EC2-Classic] [No Preference] AWS .

    [EC2-VPC] [No preference (default subnet in anyAvailability Zone)] AWS .

    10

    https://console.aws.amazon.com/ec2/http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_regionhttps://console.aws.amazon.com/ec2/

  • Amazon Elastic Compute CloudLinux

    AWS CLI

    run-instances .

    [EC2-Classic] --placement [EC2-VPC] --subnet-id

    Windows PowerShell AWS

    New-EC2Instance .

    [EC2-Classic] -AvailabilityZone [EC2-VPC] -SubnetId

    . , AWS , AWS .

    AMI , , . .

    1. AMI . . .

    Amazon EBS Linux AMI (p. 82) Linux AMI (p. 85) Amazon EBS Windows AMI Windows AMI

    2. [EC2-VPC] IP , IP . . .

    3. AMI . . (p. 10) .

    4. IP . IP (p. 612) .

    5. , . . (p. 190) .

    6. ( ) . (p. 283) .

    Amazon EC2 . Amazon EC2 Amazon EC2 AMI AMI Amazon S3

    11

    http://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.htmlhttp://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2Instance.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/Creating_EBSbacked_WinAMI.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/Creating_InstanceStoreBacked_WinAMI.html

  • Amazon Elastic Compute CloudLinux

    . Amazon EBS Amazon EBS AMI . AMI Amazon EBS Amazon EBS .

    Amazon EC2 AMI Amazon EBS AMI . Amazon EBS AMI .

    Amazon EC2 Linux (p. 762) .

    (p. 12) AMI (p. 13) (p. 13) (p. 14)

    AMI Amazon EBS AMI . AMI AMI , ebs(Amazon EBS ) instancestore( ) . AMI . (p. 64) .

    , . . .

    , ( [Stop] ) (: ) .

    . AmazonEC2 . .

    Amazon EC2 (p. 745) .

    Amazon EBS

    Amazon EBS Amazon EBS .Amazon EBS AMI Amazon EBS AmazonEBS . Amazon EBS .

    Amazon EBS . Amazon EBS . , , , .

    Amazon EBS .

    ( ).

    12

  • Amazon Elastic Compute CloudLinux

    AMI

    AMI . Amazon EBS Linux AMI (p. 82) .

    .1. .2. AMI .3. AMI .4. Amazon EBS .5. Amazon EBS .

    Amazon EBS (p. 665) .

    AMI AMI .

    Amazon EBS AMI .

    1. Amazon EC2 .2. [AMIs] .3. [Public images] . [Platform]

    [Amazon Linux] [Root Device Type] [EBS images] .

    4. ( ) [Show/Hide Columns] [Close] .

    5. AMI AMI ID .

    AMI .

    1. Amazon EC2 .2. [AMIs] .3. [Public images] . [Platform]

    [Amazon Linux] [Root Device Type] [Instance store] .

    4. ( ) [Show/Hide Columns] , [Close] .

    5. AMI AMI ID .

    AMI .

    . Amazon EC2 (p. 3) .

    describe-images (AWS CLI) Get-EC2Image(Windows PowerShell AWS )

    .

    1. Amazon EC2 .

    13

    http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.htmlhttp://docs.aws.amazon.com/powershell/latest/userguide/pstools-ec2-get-amis.html#pstools-ec2-get-image

  • Amazon Elastic Compute CloudLinux

    2. [Instances] .3. [Description] [Root device type] .

    ebs Amazon EBS . instance store .

    . Amazon EC2 (p. 3) .

    describe-instances (AWS CLI) Get-EC2Instance (Windows PowerShell AWS )

    Amazon EBS AMI . DeleteOnTermination false .

    DeleteOnTermination . .

    ( )

    1. Amazon EC2 .2. Amazon EC2 [Launch Instance] .3. [Choose an Amazon Machine Image (AMI)] AMI [Select] .4. [Choose an Instance Type] [Configure Instance Details] .5. [Add Storage] [Delete On Termination] .6. [Launch] .

    .[Block devices] . [Delete on termination] True. [Delete on termination] False .

    AWS CLI AWS CLI DeleteOnTermination .

    Example

    run-instances DeleteOnTermination false .

    aws ec2 run-instances --block-device-mappings file://mapping.json other parameters...

    mapping.json .

    14

    http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.htmlhttp://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Instance.htmlhttp://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html

  • Amazon Elastic Compute CloudLinux

    [ { "DeviceName": "/dev/sda1", "Ebs": { "DeleteOnTermination": false } }]

    describe-instances BlockDeviceMappings DeleteOnTermination false .

    ... "BlockDeviceMappings": [ { "DeviceName": "/dev/sda1", "Ebs": { "Status": "attached", "DeleteOnTermination": false, "VolumeId": "vol-1234567890abcdef0", "AttachTime": "2013-07-19T02:42:39.000Z" } } ...

    Example

    modify-instance-attribute DeleteOnTermination false .

    aws ec2 modify-instance-attribute --instance-id i-1234567890abcdef0 --block-device-mappings file://mapping.json

    mapping.json .

    [ { "DeviceName": "/dev/sda1", "Ebs" : { "DeleteOnTermination": false } }]

    15

    http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.htmlhttp://docs.aws.amazon.com/cli/latest/reference/ec2/modify-instance-attribute.html

  • Amazon Elastic Compute CloudLinux

    AWS

    Amazon EC2

    Amazon Web Services(AWS) Amazon EC2 . Amazon EC2 [Launch Instance] .

    AWS Amazon EC2 .

    1. AWS (p. 16)2. IAM (p. 16)3. (p. 18)4. Virtual Private Cloud(VPC) (p. 19)5. (p. 19)

    AWS Amazon Web Services(AWS) Amazon EC2 AWS AWS . .

    Amazon EC2 . AWS Amazon EC2 . AWS .

    AWS . AWS .

    AWS .

    1. https://aws.amazon.com/ [Create an AWS Account] .2. .

    PIN .

    AWS .

    IAM Amazon EC2 AWS . . . AWS

    16

    http://aws.amazon.com/free/https://aws.amazon.com/

  • Amazon Elastic Compute CloudLinux

    IAM

    API . AWS AWS , AWS Identity and Access Management(IAM) . IAM IAM , . IAM URL AWS .

    AWS IAM IAM . Working with the AWS Management Console .

    IAM Administrators

    1. https://console.aws.amazon.com/iam/ IAM .2. Users Add user .3. User name Administrator . , ,

    . (+), (=), (,), (.), (@), (_), (-). 64.

    4. AWS Management Console access Custom password . Require password reset .

    5. Next: Permissions .6. Set permissions for user Add user to group .7. Create group .8. Create group . , ,

    . (+), (=), (,), (.), (@), (_), (-). 128.

    9. Filter Job function .10. AdministratorAccess . Create group .11. .

    Refresh .12. Next: Review .

    Create user .

    AWS . AWS AWS .

    IAM AWS URL . your_aws_account_id AWS . , AWS 1234-5678-9012 ID 123456789012.

    https://your_aws_account_id.signin.aws.amazon.com/console/

    IAM ( ) . "your_user_name @ your_aws_account_id" .

    URL AWS ID . IAM [Dashboard] . [Customize] . URL .

    https://your_account_alias.signin.aws.amazon.com/console/

    IAM IAM [IAM users sign-in link] .

    IAM IAM Amazon EC2 (p. 519) .

    17

    http://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/getting-started.htmlhttps://console.aws.amazon.com/iam/http://docs.aws.amazon.com/IAM/latest/UserGuide/access.htmlhttp://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_examples.html

  • Amazon Elastic Compute CloudLinux

    AWS . Linux . SSH

    Amazon EC2 . . (p. 7) .

    1. URL AWS .2. AWS [EC2] Amazon EC2 .3. .

    . . , () () .

    4. [NETWORK & SECURITY] [Key Pairs] .Tip

    . . [Key Pairs] .

    5. Create Key Pair .6. [Create Key Pair] [Key pair name] [Create]

    . (: IAM , -key-pair ). , me-key-pair-uswest2 .

    7. . , .pem. .

    Important

    . , .

    8. Mac Linux SSH Linux .

    $ chmod 400 your_user_name-key-pair-region_name.pem

    Amazon EC2 (p. 498) .

    Mac Linux Linux -i SSH .pem . Windows Linux MindTerm PuTTY . PuTTY .pem .ppk .

    ( ) PuTTY Windows Linux

    1. http://www.chiark.greenend.org.uk/~sgtatham/putty/ PuTTY . .

    18

    http://www.chiark.greenend.org.uk/~sgtatham/putty/

  • Amazon Elastic Compute CloudLinux

    Virtual Private Cloud(VPC)

    2. PuTTYgen . , [] [ ] > [PuTTY] > [PuTTYgen] .

    3. [Type of key to generate] [SSH-2 RSA] .4. [Load] . PuTTYgen .ppk . .pem

    .5. [Open] . [OK]

    .6. [Save private key] . PuTTYgen . Yes

    .7. . PuTTY .ppk

    .

    Virtual Private Cloud(VPC) Amazon VPC AWS . VPC (p. 19) . VPC Amazon EC2 (p. 574) . VPC .

    Important

    EC2-Classic VPC . T2 VPC .

    VPC VPC

    1. https://console.aws.amazon.com/vpc/ Amazon VPC .2. VPC . VPC

    .3. VPC Start VPC Wizard .4. [Step 1: Select a VPC Configuration] [VPC with a Single Public Subnet]

    [Select] .5. [Step 2: VPC with a Single Public Subnet] [VPC name] VPC .

    [Create VPC] . [OK] .

    Amazon VPC What is Amazon VPC?(: Amazon VPC ) .

    . SSH IP . HTTP/HTTPS .

    . (p. 7) .

    IPv4 . Amazon EC2 IPv4 . " IP "

    19

    https://console.aws.amazon.com/vpc/http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/

  • Amazon Elastic Compute CloudLinux

    http://checkip.amazonaws.com/ . IP ISP( ) IP .

    1. https://console.aws.amazon.com/ec2/ Amazon EC2 .

    Tip

    Amazon VPC . Amazon VPC . Amazon VPC Amazon EC2 , Amazon VPC Set Up a Security Group for Your VPC .

    2. . .

    3. Security Groups .4. Create Security Group .5. . (: IAM ,

    _SG_ ). , me_SG_uswest2 .6. [VPC] VPC . VPC (*) .

    Note

    EC2-Classic VPC .7. [Inbound] ( [Add Rule] ) [Create] .

    [Type] [HTTP] [Source] [Anywhere](0.0.0.0/0) .

    [Type] [HTTPS] [Source] [Anywhere](0.0.0.0/0) .

    [Type] [SSH] . IPv4 [Source] [My IP] . [Custom] IPv4 CIDR . IP CIDR /32 (: 203.0.113.25/32). (: 203.0.113.0/24) .

    Caution

    IPv4 (0.0.0.0/0) SSH .

    Linux Amazon EC2 (p. 506) .

    20

    http://checkip.amazonaws.com/https://console.aws.amazon.com/ec2/http://docs.aws.amazon.com/AmazonVPC/latest/GettingStartedGuide/SecurityGroup.html

  • Amazon Elastic Compute CloudLinux

    Amazon EC2 Linux

    Linux , Amazon Elastic Compute Cloud(Amazon EC2) . AWS . Amazon EC2 .

    AWS Amazon EC2 AWS . 12 AWS Amazon EC2 . , ( ) Amazon EC2 .

    (p. 21) (p. 22) 1: (p. 22) 2: (p. 23) 3: (p. 24) (p. 24)

    Amazon EBS ( EBS ). Amazon EC2 . . .

    .

    1. (p. 22)2. (p. 23)

    21

    http://aws.amazon.com/free/

  • Amazon Elastic Compute CloudLinux

    3. (p. 24)

    Windows Windows Amazon EC2 : GettingStarted with Amazon EC2 Windows Instances .

    AWS Command Line Interface AWS CLI Amazon EC2 .

    Amazon EC2 (p. 16) .

    1: AWS Management Console Linux . . Launching an Instance .

    .

    1. https://console.aws.amazon.com/ec2/ Amazon EC2 .2. [Launch Instance] .3. [Choose an Amazon Machine Image (AMI)] [Amazon

    Machine Images (AMIs)] . Amazon Linux AMI HVM . AMI "Free tier eligible" .

    4. [Choose an Instance Type] . t2.micro . .

    Note

    t2.micro T2 VPC . AWS EC2-Classic VPC VPC . [Review and Launch] [Next:Configure Instance Details] .

    5. [Review and Launch] .6. [Review Instance Launch] [Security Groups]

    . , .

    a. [Edit security groups] .b. [Configure Security Group] [Select an existing security group]

    .c. [Review and Launch] .

    7. [Review Instance Launch] [Launch] .8. [Choose an existing key pair]

    .

    . [Create a new key pair] [Download Key Pair] . . . , .

    22

    http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/EC2_GetStarted.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/EC2_GetStarted.htmlhttp://docs.aws.amazon.com/cli/latest/userguide/cli-using-ec2.htmlhttp://docs.aws.amazon.com/cli/latest/userguide/cli-using-ec2.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/launching-instance.htmlhttps://console.aws.amazon.com/ec2/http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-instances.html

  • Amazon Elastic Compute CloudLinux

    2:

    Caution

    [Proceed without a key pair] . .

    , [Launch Instances] .9. . [View Instances]

    .10. [Instances] . .

    pending. [running] DNS . ([Public DNS (IPv4)] [Show/Hide] [Public DNS (IPv4)] .)

    11. . . [Status Checks] .

    2: Linux . . PuTTY SSH . Amazon Linux AMI . Linux . PuTTY Windows Linux (p. 270) SSH Linux (p. 266) .

    Important

    .pem , SSH . (p. 800) .

    Linux

    1. Java . Java Java Java ? .

    2. Amazon EC2 [Instances] .3. [Connect] .4. [A Java SSH client directly from my browser (Java required)] .5. Amazon EC2 DNS Public DNS

    . . [Launch SSHClient] .

    a. [User name] ec2-user .b. [Private key path] (.pem)

    .c. ( ) [Store in browser cache]

    . Amazon EC2 .

    6. [Yes] [Run] MindTerm .

    7. MindTerm , , . .

    8. . [No] .

    23

    http://java.com/en/download/help/index_installing.xmlhttp://java.com/en/download/help/enable_browser.xml

  • Amazon Elastic Compute CloudLinux

    3:

    9. .

    Note

    [No] .

    Verification of server key disabled in this session.

    3: . (p. 24) .

    Important

    .

    AWS shutting down terminated . . .

    1. [Instances] . .2. [Actions] [Instance State] [Terminate] .3. [Yes, Terminate] .

    Amazon EC2 . , .

    .

    Run Command EC2 . : Amazon EC2 (p. 57) (Run Command) (p. 388) .

    CloudWatch . AWSBilling and Cost Management .

    EBS . Amazon EBS (p. 676) Amazon EBS (p. 679) .

    LAMP . : Amazon LinuxLAMP (p. 27) .

    24

    http://aws.amazon.com/free/http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.htmlhttp://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/free-tier-alarms.html

  • Amazon Elastic Compute CloudLinux

    Amazon EC2

    Amazon EC2 .

    , IAM IAM AWS API .AWS , , . IAM IAM .

    . (p. 507) .

    , . Amazon Linux Managing Software on Your Linux Instance . Windows Windows Amazon EC2 Windows .

    EC2-Classic VPC . 2013 12 4 AWS VPC . Amazon EC2 Amazon Virtual PrivateCloud (p. 569) .

    , . (p. 64) .

    Amazon EBS . . Amazon EBS (p. 285) .

    . . .

    AWS . (p. 311) Amazon EC2 (p. 782) .

    Amazon EC2 . . Amazon EC2 (p. 789) .

    25

    http://docs.aws.amazon.com/IAM/latest/UserGuide/IAMBestPractices.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/managing-software.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/windows-ami-version-history.html#update-windows-instancehttp://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/windows-ami-version-history.html#update-windows-instance

  • Amazon Elastic Compute CloudLinux

    Amazon EBS (p. 709) EBS , Amazon (AMI) (p. 62) .

    . IP .

    Amazon EC2 IP (p. 593) . . Amazon EC2 (p. 458) . .

    IP . (p. 615) . Auto Scaling . Auto Scaling .

    Amazon EBS .

    26

    http://docs.aws.amazon.com/autoscaling/latest/userguide/

  • Amazon Elastic Compute CloudLinux

    : Amazon LinuxLAMP

    Linux Amazon EC2

    Linux EC2 .

    : Amazon LinuxLAMP (p. 27) : Amazon Linux WordPress (p. 37) : SSL/TLS Amazon Linux Apache (p. 46) : Amazon EC2 (p. 54) : Amazon EC2 (p. 57)

    : Amazon LinuxLAMP Amazon Linux PHP MySQL Apache . LAMP LAMP . PHP .

    DNS . 1: (p. 22) . SSH( 22), HTTP( 80), HTTPS( 443) . Amazon EC2 (p. 16) .

    Important

    LAMP Ubuntu . Amazon Linux . . Ubuntu LAMP Ubuntu ApacheMySQLPHP .

    27

    https://help.ubuntu.com/community/ApacheMySQLPHP

  • Amazon Elastic Compute CloudLinux

    : Amazon LinuxLAMP

    Amazon Linux LAMP

    1. (p. 23).2. ,

    . , .

    Note

    -y . .

    [ec2-user ~]$ sudo yum update -y

    3. Apache , MySQL, PHP . yum install .

    [ec2-user ~]$ sudo yum install -y httpd24 php70 mysql56-server php70-mysqlnd

    Note

    . LAMP (: WordPress phpMyAdmin) . , PHP . (p. 36) .

    4. Apache .

    [ec2-user ~]$ sudo service httpd startStarting httpd: [ OK ]

    5. [chkconfig] Apache .

    [ec2-user ~]$ sudo chkconfig httpd on

    Tip

    [chkconfig] . httpd .

    [ec2-user ~]$ chkconfig --list httpdhttpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off

    httpd 2, 3, 4, 5 ( ) on .6. . DNS IP

    . Apache . DNSAmazon EC2 ([Public DNS] . [Show/Hide] [Public DNS] ).

    Tip

    Apache , HTTP( 80) . HTTP (p. 511) .

    28

  • Amazon Elastic Compute CloudLinux

    : Amazon LinuxLAMP

    Important

    Amazon Linux , . .

    Note

    /var/www/html . DNS .

    Apache httpd 'Acache document root' . Amazon Linux Apachedocument root /var/www/html, root .

    [ec2-user ~]$ ls -l /var/wwwtotal 16drwxr-xr-x 2 root root 4096 Jul 12 01:00 cgi-bindrwxr-xr-x 3 root root 4096 Aug 7 00:02 errordrwxr-xr-x 2 root root 4096 Jan 6 2012 htmldrwxr-xr-x 3 root root 4096 Aug 7 00:02 icons

    29

  • Amazon Elastic Compute CloudLinux

    : Amazon LinuxLAMP

    ec2-user . . www /var/www . , , .

    1. www .

    [ec2-user ~]$ sudo groupadd www

    2. ( ec2-user) www .

    [ec2-user ~]$ sudo usermod -a -G www ec2-user

    Important

    . [exit] .

    3. , www .

    a. .

    [ec2-user ~]$ exit

    b. , www .

    [ec2-user ~]$ groupsec2-user wheel www

    4. /var/www www .

    [ec2-user ~]$ sudo chown -R root:www /var/www

    5. /var/www ID .

    [ec2-user ~]$ sudo chmod 2775 /var/www[ec2-user ~]$ find /var/www -type d -exec sudo chmod 2775 {} \;

    6. /var/www .

    [ec2-user ~]$ find /var/www -type f -exec sudo chmod 0664 {} \;

    ec2-user www Apache document root , , . , PHP .

    ( )

    HTTP . HTTP URL, , HTML ( ) . SSL/TLS HTTPS(HTTP Secure) .

    30

  • Amazon Elastic Compute CloudLinux

    : Amazon LinuxLAMP

    HTTPS : SSL/TLS Amazon Linux Apache .

    LAMP

    , ec2-user /var/www/html PHP .

    1. Apache PHP .

    [ec2-user ~]$ echo "" > /var/www/html/phpinfo.php

    Tip

    "Permission denied" , , (p. 30) .

    2. URL . URL DNS (/) . :

    http://my.public.dns.amazonaws.com/phpinfo.php

    PHP :

    Note

    /var/www/html/phpinfo.php . ( ).

    [ec2-user ~]$ sudo yum list installed httpd24 php70 mysql56-server php70-mysqlndLoaded plugins: priorities, update-motd, upgrade-helperInstalled Packages

    31

    http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-an-instance.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-an-instance.html

  • Amazon Elastic Compute CloudLinux

    : Amazon LinuxLAMP

    httpd24.x86_64 2.4.25-1.68.amzn1 @amzn-updatesmysql56-server.x86_64 5.6.35-1.23.amzn1 @amzn-updatesphp70.x86_64 7.0.14-1.20.amzn1 @amzn-updatesphp70-mysqlnd.x86_64 7.0.14-1.20.amzn1 @amzn-updates

    , sudo yum install package .

    3. phpinfo.php . .

    [ec2-user ~]$ rm /var/www/html/phpinfo.php

    MySQL

    MySQL , . [mysql_secure_installation] . MySQL .

    1. MySQL .

    [ec2-user ~]$ sudo service mysqld startInitializing MySQL database: ...

    PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !...

    Starting mysqld: [ OK ]

    2. mysql_secure_installation .

    [ec2-user ~]$ sudo mysql_secure_installation

    a. root .

    i. root . root Enter .

    ii. Y , . http://www.pctools.com/guides/password/ . .

    Note

    MySQL . , .

    b. Y .c. Y root .d. Y .e. Y .

    32

    http://www.pctools.com/guides/password/

  • Amazon Elastic Compute CloudLinux

    : Amazon LinuxLAMP

    3. () MySQL . .

    [ec2-user ~]$ sudo service mysqld stopStopping mysqld: [ OK ]

    4. () MySQL .

    [ec2-user ~]$ sudo chkconfig mysqld on

    LAMP . /var/www/html Apache document root DNS .

    ( ) phpMyAdmin

    phpMyAdmin EC2 MySQL . Amazon Linux phpMyAdmin .

    Important

    Apache SSL/TLS phpMyAdmin LAMP . , . EC2 : SSL/TLS Amazon Linux Apache .Note

    PHP Amazon Linux Extra Packages for EnterpriseLinux(EPEL) . EPEL ,phpMyAdmin . phpMyAdmin . Amazon Linux( Linux) .

    1. Fedora EPEL(Extra Packages for Enterprise Linux) .

    [ec2-user ~]$ sudo yum-config-manager --enable epel

    2. phpMyAdmin .

    [ec2-user ~]$ sudo yum install -y phpMyAdmin

    Note

    [y] EPEL GPG .3. phpMyAdmin . , phpMyAdmin

    , Amazon Linux .

    a. whatismyip.com IP .b. /etc/httpd/conf.d/phpMyAdmin.conf IP

    (127.0.0.1) IP . , your_ip_address IP .

    [ec2-user ~]$ sudo sed -i -e 's/127.0.0.1/your_ip_address/g' /etc/httpd/conf.d/phpMyAdmin.conf

    33

    https://www.phpmyadmin.net/http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-an-instance.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-an-instance.htmlhttps://www.phpmyadmin.net/downloads/https://www.whatismyip.com/

  • Amazon Elastic Compute CloudLinux

    : Amazon LinuxLAMP

    4. Apache .

    [ec2-user ~]$ sudo service httpd restartStopping httpd: [ OK ]Starting httpd: [ OK ]

    5. MySQL .

    [ec2-user ~]$ sudo service mysqld restartStopping mysqld: [ OK ]Starting mysqld: [ OK ]

    6. phpMyAdmin URL . URL DNS (/) phpmyadmin . :

    http://my.public.dns.amazonaws.com/phpmyadmin

    phpMyAdmin :

    34

  • Amazon Elastic Compute CloudLinux

    : Amazon LinuxLAMP

    Note

    403 Forbidden , /etc/httpd/conf.d/phpMyAdmin.conf IP . Apache Apache IP .

    [ec2-user ~]$ sudo tail -n 1 /var/log/httpd/access_log | awk '{ print $1 }'

    35

  • Amazon Elastic Compute CloudLinux

    205.251.233.48

    IP Step 3.b (p. 33) (:

    [ec2-user ~]$ sudo sed -i -e 's/previous_ip_address/205.251.233.48/g' /etc/httpd/conf.d/phpMyAdmin.conf

    ).IP Step 4 (p. 34) httpd .

    7. root MySQL phpMyAdmin . phpMyAdmin phpMyAdmin .

    LAMP .

    .

    Apache .

    ? httpd .

    [ec2-user ~]$ chkconfig --list httpdhttpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off

    httpd 2, 3, 4, 5 ( ) on .

    httpd Amazon Linux LAMP (p. 28) .

    ?

    Apache , HTTP( 80) . HTTP (p. 511) .

    PHP .

    Apache , PHP, MySQL . LAMP . PHP , ( ). LAMP .

    httpd24 php56 mysql55-server php56-mysqlnd

    , .

    36

    http://docs.phpmyadmin.net/en/latest/user.html

  • Amazon Elastic Compute CloudLinux

    [ec2-user ~]$ sudo yum remove -y httpd24 php70 mysql56-server php70-mysqlnd perl-DBD-MySQL56

    .

    [ec2-user ~]$ sudo yum install -y httpd24 php56 mysql55-server php56-mysqlnd

    , .

    [ec2-user ~]$ yum remove -y httpd24 php56 mysql55-server php56-mysqlnd perl-DBD-MySQL55

    .

    WordPress .

    WinSCP Linux (p. 273) SCP Linux Linux (p. 268) : Amazon Linux WordPress (p. 37)

    .

    Apache : http://httpd.apache.org/ MySQL : http://www.mysql.com/ PHP : http://php.net/ chmod : https://en.wikipedia.org/wiki/Chmod chown : https://en.wikipedia.org/wiki/Chown

    Amazon Route53 Creating and Migrating Domains and Subdomains to AmazonRoute 53(Amazon Route 53 ) .

    : Amazon Linux WordPress

    Amazon Linux WordPress , , .Important

    Amazon Linux . . Ubuntu . Ubuntu WordPress Ubuntu WordPress .

    : Amazon LinuxLAMP (p. 27) PHP MySQL Amazon Linux .

    37

    http://httpd.apache.org/http://www.mysql.com/http://php.net/https://en.wikipedia.org/wiki/Chmodhttps://en.wikipedia.org/wiki/Chownhttp://docs.aws.amazon.com/Route53/latest/DeveloperGuide/creating-migrating.htmlhttp://docs.aws.amazon.com/Route53/latest/DeveloperGuide/creating-migrating.htmlhttps://help.ubuntu.com/community/WordPress

  • Amazon Elastic Compute CloudLinux

    WordPress

    HTTP HTTPS . :Amazon LinuxLAMP (p. 27) WordPress . (p. 511) .

    IP (EIP) WordPress . DNS . DNS EIP ( ). EIP . IP (p. 608) .

    Amazon Route53 EIP . Amazon Route53 Amazon Route 53 .

    WordPress WordPress Amazon EC2 . , . WordPress , AWS CloudFormation WordPress . (: AWSCloudFormation ) . Windows WordPress , Deploying a WordPress Blog on Your Amazon EC2 Windows Instance(Amzon EC2 Windows W