{"id":125,"date":"2019-02-02T19:41:50","date_gmt":"2019-02-02T10:41:50","guid":{"rendered":"http:\/\/cloud-textbook.com\/?p=125"},"modified":"2019-04-09T15:48:36","modified_gmt":"2019-04-09T06:48:36","slug":"aws%e5%9f%ba%e7%a4%8e%e5%85%a5%e9%96%80%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab-apache-%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e7%b7%a8","status":"publish","type":"post","link":"https:\/\/cloud-textbook.com\/125\/","title":{"rendered":"AWS\u57fa\u790e\u5165\u9580\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb &#8211; Apache \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u7de8"},"content":{"rendered":"\n<p>EC2 \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3057\u305f\u306e\u3067\u3001\u6b21\u306b Web \u30b5\u30fc\u30d0 Apache \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#AWS\"><span class=\"toc_number toc_depth_1\">1<\/span> AWS \u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306b\u3064\u3044\u3066<\/a><\/li><li><a href=\"#Apache\"><span class=\"toc_number toc_depth_1\">2<\/span> Apache \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/li><li><a href=\"#Apache-2\"><span class=\"toc_number toc_depth_1\">3<\/span> Apache \u30b5\u30fc\u30d3\u30b9\u6709\u52b9\u5316\u30fb\u8d77\u52d5<\/a><\/li><li><a href=\"#i\"><span class=\"toc_number toc_depth_1\">4<\/span> \u30c7\u30d5\u30a9\u30eb\u30c8\u30da\u30fc\u30b8\u78ba\u8a8d<\/a><\/li><li><a href=\"#i-2\"><span class=\"toc_number toc_depth_1\">5<\/span> \u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30b0\u30eb\u30fc\u30d7\u8a2d\u5b9a\u8ffd\u52a0<\/a><\/li><li><a href=\"#i-3\"><span class=\"toc_number toc_depth_1\">6<\/span> \u518d\u3073\u30c7\u30d5\u30a9\u30eb\u30c8\u30da\u30fc\u30b8\u78ba\u8a8d<\/a><\/li><li><a href=\"#Hello_World\"><span class=\"toc_number toc_depth_1\">7<\/span> Hello World \u78ba\u8a8d<\/a><\/li><\/ul><\/div>\n<h2><span id=\"AWS\">AWS \u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306b\u3064\u3044\u3066<\/span><\/h2>\n\n\n\n<p>\u3053\u306e\u30da\u30fc\u30b8\u306f&nbsp;<a href=\"https:\/\/cloud-textbook.com\/114\/\">AWS \u57fa\u790e\u5165\u9580\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb<\/a>&nbsp;\u306e\u4e00\u90e8\u3067\u3059\u3002 AWS \u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u5168\u4f53\u306f&nbsp;<a href=\"https:\/\/cloud-textbook.com\/114\/\">AWS \u57fa\u790e\u5165\u9580\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb<\/a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h2><span id=\"Apache\">Apache \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/span><\/h2>\n\n\n\n<p>\u4e0b\u8a18\u3067 Apache \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>% sudo su -\n# yum install -y httpd<\/code><\/pre>\n\n\n\n<h2><span id=\"Apache-2\">Apache \u30b5\u30fc\u30d3\u30b9\u6709\u52b9\u5316\u30fb\u8d77\u52d5<\/span><\/h2>\n\n\n\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3060\u3051\u3060\u3068\u4f55\u3082\u52d5\u3044\u3066\u3044\u306a\u3044\u306e\u3067\u3001Apache \u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># systemctl start httpd<\/code><\/pre>\n\n\n\n<p>\/var\/log\/httpd\/error_log \u306b\u30ed\u30b0\u304c\u51fa\u529b\u3055\u308c\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u306e\u3067\u78ba\u8a8d\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>\u306a\u304a\u3001\u3053\u306e\u307e\u307e\u3060\u3068 EC2 \u304c\u518d\u8d77\u52d5\u3057\u305f\u969b\u306b\u306f Apache \u304c\u81ea\u52d5\u3067\u8d77\u52d5\u3057\u307e\u305b\u3093\u3002\u518d\u8d77\u52d5\u6642\u306b Apache \u304c\u81ea\u52d5\u7684\u306b\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u3001 \u4e0b\u8a18\u3067\u30b5\u30fc\u30d3\u30b9\u3092\u6709\u52b9\u5316\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># systemctl enable httpd<\/code><\/pre>\n\n\n\n<h2><span id=\"i\">\u30c7\u30d5\u30a9\u30eb\u30c8\u30da\u30fc\u30b8\u78ba\u8a8d<\/span><\/h2>\n\n\n\n<p>\u3053\u308c\u3067 Apache \u304c\u8d77\u52d5\u3057\u305f\u306f\u305a\u3067\u3059\u304c\u3001\u52d5\u4f5c\u78ba\u8a8d\u3092\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002 \u4e0b\u8a18 URL \u3092\u30d6\u30e9\u30a6\u30b6\u3067\u78ba\u8a8d\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<ul><li>http:\/\/[EC2\u306e\u30d1\u30d6\u30ea\u30c3\u30afIP\u30a2\u30c9\u30ec\u30b9]\/<\/li><\/ul>\n\n\n\n<p>\u30d6\u30e9\u30a6\u30b6\u3067\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3064\u306a\u304c\u3089\u306a\u3044\u306f\u305a\u3067\u3059 (\u4e0b\u8a18\u306f Chrome \u3067\u306e\u4f8b)\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img src=\"https:\/\/cloud-textbook.com\/wp-content\/uploads\/2019\/02\/tuto-aws-ec2-apache-1.png\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p>\u3053\u308c\u306f\u306a\u305c\u304b\u3068\u3044\u3046\u3068\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30b0\u30eb\u30fc\u30d7\u3068\u3044\u3046\u4ed5\u7d44\u307f\u3067\u5236\u9650\u3055\u308c\u3066\u3044\u308b\u304b\u3089\u3067\u3059\u3002<\/p>\n\n\n\n<h2><span id=\"i-2\">\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30b0\u30eb\u30fc\u30d7\u8a2d\u5b9a\u8ffd\u52a0<\/span><\/h2>\n\n\n\n<p>AWS \u30b3\u30f3\u30bd\u30fc\u30eb \uff1e EC2 \uff1e \u5de6\u30e1\u30cb\u30e5\u30fc\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9 \uff1e \u4f5c\u6210\u3057\u305f\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u30af\u30ea\u30c3\u30af\u3001 \u3068\u3059\u308b\u3068\u3001\u753b\u9762\u4e0b\u306b\u4e0b\u8a18\u306e\u3088\u3046\u306a\u8868\u793a\u304c\u3055\u308c\u308b\u3068\u601d\u3044\u307e\u3059\u3002\u305d\u3053\u306e launch-wizard-1 \u3068\u3044\u3046\u306e\u304c\u3001 EC2 \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4f5c\u6210\u6642\u306b\u81ea\u52d5\u7684\u306b\u4f5c\u6210\u3055\u308c\u305f\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30b0\u30eb\u30fc\u30d7\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img src=\"https:\/\/cloud-textbook.com\/wp-content\/uploads\/2019\/02\/tuto-aws-ec2-apache-2.png\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p>launch-wizard-1 \u3092\u30af\u30ea\u30c3\u30af\u3057\u3001\u300c\u30a4\u30f3\u30d0\u30a6\u30f3\u30c9\u300d\u30bf\u30d6\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001 \u4e0b\u8a18\u306e\u3088\u3046\u306b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30b0\u30eb\u30fc\u30d7\u306e\u8a73\u7d30\u304c\u308f\u304b\u308a\u307e\u3059\u3002 \u3053\u3053\u3067\u306f\u300c\u5916\u90e8\u304b\u3089 EC2 \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9 (\uff1d\u30a4\u30f3\u30d0\u30a6\u30f3\u30c9)\u300d\u306e\u30eb\u30fc\u30eb\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001 ssh (\u30dd\u30fc\u30c822) \u306e\u307f\u30010.0.0.0\/0 (\uff1d\u3059\u3079\u3066) \u304b\u3089\u63a5\u7d9a\u53ef\u80fd\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001 http (\u30dd\u30fc\u30c880) \u306b\u3064\u3044\u3066\u306f\u8a18\u8f09\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u8a18\u8f09\u304c\u306a\u3044\u5834\u5408\u306f\u62d2\u5426\u3068\u3044\u3046\u30eb\u30fc\u30eb\u3067\u3059\u306e\u3067\u3001 \u3053\u306e\u305b\u3044\u3067\u30d6\u30e9\u30a6\u30b6\u78ba\u8a8d\u304c\u3067\u304d\u306a\u304b\u3063\u305f\u308f\u3051\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img src=\"https:\/\/cloud-textbook.com\/wp-content\/uploads\/2019\/02\/tuto-aws-ec2-apache-3.png\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p>http \u306b\u3064\u3044\u3066\u3082\u63a5\u7d9a\u53ef\u80fd\u306a\u3088\u3046\u8a2d\u5b9a\u8ffd\u52a0\u3092\u884c\u3044\u307e\u3057\u3087\u3046\u3002 \u300c\u7de8\u96c6\u300d\u30dc\u30bf\u30f3\u3092\u62bc\u4e0b\u3059\u308b\u3068\u30c0\u30a4\u30a2\u30ed\u30b0\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001\u300c\u30eb\u30fc\u30eb\u306e\u8ffd\u52a0\u300d\u3092\u62bc\u3057\u3066\u3001 \u300cHTTP\u300d\u306e\u884c\u3092\u4e0a\u8a18\u306e\u3088\u3046\u306b\u4f5c\u6210\u3057\u307e\u3057\u3087\u3046\u3002\u6700\u5f8c\u306b\u300c\u4fdd\u5b58\u300d\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img src=\"https:\/\/cloud-textbook.com\/wp-content\/uploads\/2019\/02\/tuto-aws-ec2-apache-4.png\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p>\u3053\u308c\u3067\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30b0\u30eb\u30fc\u30d7\u306b\u30eb\u30fc\u30eb\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002\u306a\u304a\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30b0\u30eb\u30fc\u30d7\u306f EC2 \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u5916\u5074\u306b\u5b58\u5728\u3059\u308b\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u3067\u3042\u308a\u3001\u305d\u306e\u8a2d\u5b9a\u3092\u5909\u3048\u305f\u3060\u3051\u3067\u3059\u306e\u3067\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u518d\u8d77\u52d5\u3084 Apache \u306e\u518d\u8d77\u52d5\u306a\u3069\u306f\u4e0d\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<h2><span id=\"i-3\">\u518d\u3073\u30c7\u30d5\u30a9\u30eb\u30c8\u30da\u30fc\u30b8\u78ba\u8a8d<\/span><\/h2>\n\n\n\n<p>\u518d\u5ea6\u4e0b\u8a18 URL \u3092\u30d6\u30e9\u30a6\u30b6\u3067\u958b\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<ul><li>http:\/\/[EC2\u306e\u30d1\u30d6\u30ea\u30c3\u30afIP\u30a2\u30c9\u30ec\u30b9]\/<\/li><\/ul>\n\n\n\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306b\u3046\u307e\u304f\u8868\u793a\u3055\u308c\u305f\u3067\u3057\u3087\u3046\u304b\u3002 <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img src=\"https:\/\/cloud-textbook.com\/wp-content\/uploads\/2019\/02\/tuto-aws-ec2-apache-5.png\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p>\u306a\u304a\u3001\u3053\u306e\u6642\u70b9\u3067\u3053\u306e EC2 \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u30dd\u30fc\u30c8 80 \u306f\u4e16\u754c\u4e2d\u304b\u3089\u95b2\u89a7\u304c\u53ef\u80fd\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 \u3082\u3057\u3042\u306a\u305f\u304c\u8077\u5834\u306a\u3069\u306e\u56fa\u5b9a IP \u30a2\u30c9\u30ec\u30b9\u3092\u6301\u3063\u3066\u3044\u308b\u306a\u3089\u3070\u3001\u5148\u307b\u3069\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30b0\u30eb\u30fc\u30d7\u8ffd\u52a0\u3057\u305f HTTP \u306e\u884c\u306b\u3064\u3044\u3066\u3001 &#8220;0.0.0.0\/0&#8243; \u3067\u306f\u306a\u304f\u3001&#8221;10.1.2.0\/28&#8221; \u306a\u3069\u3068\u3059\u308b\u3053\u3068\u3067\u3001\u305d\u308c\u4ee5\u5916\u304b\u3089\u306e\u63a5\u7d9a\u304c\u3067\u304d\u306a\u3044\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2><span id=\"Hello_World\">Hello World \u78ba\u8a8d<\/span><\/h2>\n\n\n\n<p>\u3055\u3089\u306b\u81ea\u5206\u3067\u4f5c\u3063\u305f HTML \u30d5\u30a1\u30a4\u30eb\u3092\u914d\u7f6e\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>root \u306b\u3066 \/var\/www\/html\/ \u306b\u3001\u304a\u597d\u304d\u306a\u30a8\u30c7\u30a3\u30bf\u3067\u3001\u4e0b\u8a18\u30d5\u30a1\u30a4\u30eb\u3092 helloworld.html \u3068\u3057\u3066\u4fdd\u5b58\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Hello World\n&lt;span style=\"color: red\">\u3053\u3093\u306b\u3061\u306f\u4e16\u754c&lt;\/span><\/code><\/pre>\n\n\n\n<p>\u305d\u3057\u3066\u4e0b\u8a18 URL \u3092\u30d6\u30e9\u30a6\u30b6\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<ul><li>http:\/\/[EC2\u306e\u30d1\u30d6\u30ea\u30c3\u30afIP\u30a2\u30c9\u30ec\u30b9]\/helloworld.html<\/li><\/ul>\n\n\n\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306a\u8868\u793a\u306b\u306a\u308c\u3070 OK \u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img src=\"https:\/\/cloud-textbook.com\/wp-content\/uploads\/2019\/02\/tuto-aws-ec2-apache-6.png\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p>\u6b21\u306b&nbsp;<a href=\"https:\/\/cloud-textbook.com\/127\/\">PHP \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a>&nbsp;\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>EC2 \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3057\u305f\u306e\u3067\u3001\u6b21\u306b Web \u30b5\u30fc\u30d0 Apache \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/cloud-textbook.com\/wp-json\/wp\/v2\/posts\/125"}],"collection":[{"href":"https:\/\/cloud-textbook.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloud-textbook.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloud-textbook.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloud-textbook.com\/wp-json\/wp\/v2\/comments?post=125"}],"version-history":[{"count":5,"href":"https:\/\/cloud-textbook.com\/wp-json\/wp\/v2\/posts\/125\/revisions"}],"predecessor-version":[{"id":3082,"href":"https:\/\/cloud-textbook.com\/wp-json\/wp\/v2\/posts\/125\/revisions\/3082"}],"wp:attachment":[{"href":"https:\/\/cloud-textbook.com\/wp-json\/wp\/v2\/media?parent=125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloud-textbook.com\/wp-json\/wp\/v2\/categories?post=125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloud-textbook.com\/wp-json\/wp\/v2\/tags?post=125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}