{"id":1165,"date":"2019-12-04T01:42:45","date_gmt":"2019-12-03T16:42:45","guid":{"rendered":"https:\/\/took.jp\/?p=1165"},"modified":"2020-06-15T21:48:22","modified_gmt":"2020-06-15T12:48:22","slug":"post-1165","status":"publish","type":"post","link":"https:\/\/took.jp\/tech-blog\/post-1165\/","title":{"rendered":"Vagrant\u3092\u4f7f\u7528\u3057\u3001CentOS\u958b\u767a\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b\u3010\u521d\u671f\u8a2d\u5b9a\u7b49\u542b\u3080\u3011"},"content":{"rendered":"<ul class=\"table-of-contents\">\n<li style=\"list-style-type: none;\"><\/li>\n<\/ul>\n<p>\u4eca\u56de\u306f\u3001vagrant\u3092\u4f7f\u7528\u3057\u3066\u3001virtualbox\u306bcentos\u3092\u5165\u308c\u3001apache\u3067web\u30b5\u30fc\u30d0\u516c\u958b\u3059\u308b\u307e\u3067\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001vagrant\uff08\u30d9\u30a4\u30b0\u30e9\u30f3\u30c8\uff09\u3068\u306f\u3001<\/p>\n<blockquote><p>Vagrant\uff08\u30d9\u30a4\u30b0\u30e9\u30f3\u30c8\uff09\u306f\u3001FLOSS\u306e\u4eee\u60f3\u6a5f\u68b0\u3092\u69cb\u7bc9\u3059\u308b\u305f\u3081\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3067\u3042\u308b[2]\u3002\u69cb\u6210\u60c5\u5831\u3092\u8a18\u8ff0\u3057\u305f\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb (Vagrantfile) \u3092\u5143\u306b\u3001\u4eee\u60f3\u74b0\u5883\u306e\u69cb\u7bc9\u304b\u3089\u8a2d\u5b9a\u307e\u3067\u3092\u81ea\u52d5\u7684\u306b\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u308b[3]\u3002\uff08\u4ee5\u4e0b\u7565\uff09<\/p>\n<div class=\"blockquote_ref\">\n<div><a href=\"https:\/\/ja.wikipedia.org\/wiki\/Vagrant_(%E3%82%BD%E3%83%95%E3%83%88%E3%82%A6%E3%82%A7%E3%82%A2)\" target=\"_blank\" rel=\"noopener noreferrer\">Wikipedia<\/a><\/div>\n<\/div>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<div id=\"title1\">\n<h2>\u4e8b\u524d\u6e96\u5099<\/h2>\n<\/div>\n<p>\u74b0\u5883\u306f\u3001Windows\u3067\u9032\u3081\u3066\u3044\u304d\u307e\u3059\u304c\u3001<\/p>\n<p>Mac\u3067\u3082\u307b\u3068\u3093\u3069\u540c\u69d8\u306e\u624b\u9806\u3067\u554f\u984c\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u4e8b\u524d\u6e96\u5099\u3068\u3057\u3066\u3001<\/p>\n<p>\u30fbvirtualbox\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/p>\n<p>\u30fbvagrant\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/p>\n<p>\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>\u65e2\u306b\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u6e08\u307f\u306e\u4eba\u306f\u98db\u3070\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304c\u6e08\u3093\u3067\u3044\u306a\u3044\u65b9\u306f\u4ee5\u4e0b\u306e\u30ea\u30f3\u30af\u304b\u3089\u3069\u3046\u305e\u3002<\/p>\n<p>virtualbox\u306f\u3053\u3061\u3089\u3002<\/p>\n<p><a href=\"https:\/\/www.virtualbox.org\/wiki\/Downloads\">https:\/\/www.virtualbox.org\/wiki\/Downloads<\/a><\/p>\n<p>vagrant\u306f\u3053\u3061\u3089\u3002<\/p>\n<p><a href=\"https:\/\/www.vagrantup.com\/\">https:\/\/www.vagrantup.com\/<\/a><\/p>\n<div id=\"title2\">\n<h2>\u4eee\u60f3\u74b0\u5883\u3092\u4f5c\u6210<\/h2>\n<\/div>\n<p>\u307e\u305a\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u958b\u304d\u307e\u3059\u3002<\/p>\n<p>\uff08windows\u30ad\u30fc + R \u3092\u540c\u6642\u62bc\u3057\u3057\u3001cmd\u3068\u5165\u529b\u3059\u308b\u3068\u958b\u3051\u307e\u3059\uff09<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-1166\" src=\"https:\/\/took.jp\/wp-content\/uploads\/2019\/12\/cmd.jpg\" alt=\"\" width=\"456\" height=\"272\" srcset=\"https:\/\/took.jp\/tech-blog\/wp-content\/uploads\/2019\/12\/cmd.jpg 456w, https:\/\/took.jp\/tech-blog\/wp-content\/uploads\/2019\/12\/cmd-300x179.jpg 300w\" sizes=\"(max-width: 456px) 100vw, 456px\" \/><\/p>\n<p>\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u304c\u958b\u3051\u305f\u306e\u3092\u78ba\u8a8d\u3057\u305f\u3089\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; vagrant box add centos\/7<\/code><\/pre>\n<p>\u305d\u306e\u5f8c\u3001\u3069\u306e\u4eee\u60f3\u30de\u30b7\u30f3\u3092\u4f7f\u7528\u3059\u308b\u304b\u805e\u304b\u308c\u307e\u3059\u306e\u3067\u3001<strong>3\u756a\u306evirtualbox<\/strong>\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/p>\n<p>\u3082\u3057\u3001\u3053\u3053\u3067\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u5834\u5408\u3001vagrant\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u3066\u3044\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">==&gt; vagrant: A new version of Vagrant is available: 2.2.6 (installed version: 2.2.4)!\r\n==&gt; vagrant: To upgrade visit: https:\/\/www.vagrantup.com\/downloads.html\r\n\r\n==&gt; box: Loading metadata for box 'centos\/7'\r\n    box: URL: https:\/\/vagrantcloud.com\/centos\/7\r\nThis box can work with multiple providers! The providers that it\r\ncan work with are listed below. Please review the list and choose\r\nthe provider you will be working with.\r\n\r\n1) hyperv\r\n2) libvirt\r\n3) virtualbox\r\n4) vmware_desktop\r\n\r\nEnter your choice: 3\r\n==&gt; box: Adding box 'centos\/7' (v1905.1) for provider: virtualbox\r\nThe box you're attempting to add already exists. Remove it before\r\nadding it again or add it with the `--force` flag.\r\n\r\nName: centos\/7\r\nProvider: virtualbox\r\nVersion: 1905.1<\/code><\/pre>\n<p>\u79c1\u306e\u5834\u5408\u306f\u3001\u65e2\u306bbox\u304c\u5b58\u5728\u3057\u3066\u3044\u305f\u306e\u3067\u3001alredy exists\u3068\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u304c\u3001box\u304c\u5b58\u5728\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001Successfully \u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u5ff5\u306e\u305f\u3081\u3001box\u304c\u8ffd\u52a0\u3055\u308c\u305f\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; vagrant box list\r\ncentos\/7 (v1905.1)<\/code><\/pre>\n<p>\u3053\u308c\u3067\u3001box\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u6b21\u306b\u3001vagrantfile\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u4eee\u60f3\u74b0\u5883\u3092\u4f5c\u6210\u3059\u308b\u969b\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001vagrantfile\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u3001\u79fb\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">mkdir centos7\r\ncd centos7<\/code><\/pre>\n<p>\u307e\u305a\u521d\u671f\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">vagrant init centos\/7<\/code><\/pre>\n<p>\u3053\u3061\u3089\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u3001\u300cvagratnfile\u300d\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">A `Vagrantfile` has been placed in this directory. You are now\r\nready to `vagrant up` your first virtual environment! Please read\r\nthe comments in the Vagrantfile as well as documentation on\r\n`vagrantup.com` for more information on using Vagrant.<\/code><\/pre>\n<p>\u5ff5\u306e\u305f\u3081\u3001vagrantfile\u304c\u4f5c\u6210\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; dir<\/code><\/pre>\n<p>\u4eee\u60f3\u30de\u30b7\u30f3\u3092\u8d77\u52d5\u3059\u308b<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; vagrant up<\/code><\/pre>\n<p>\u3053\u308c\u3067\u3001\u4eee\u60f3\u74b0\u5883\u306e\u8d77\u52d5\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>virtualbox\u304b\u3089\u78ba\u8a8d\u3059\u308b\u3068\u3001\u300c\u5b9f\u884c\u4e2d\u300d\u3068\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306bIP\u30a2\u30c9\u30ec\u30b9\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u4e00\u5ea6\u3001\u4eee\u60f3\u74b0\u5883\u3092\u505c\u6b62\u3055\u305b\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; vagrant halt<\/code><\/pre>\n<p>\u305d\u306e\u5f8c\u3001vagrantfile\u3092\u958b\u304d\u3001\u7de8\u96c6\u3057\u307e\u3059\u3002<\/p>\n<p>\u624b\u9806\u901a\u308a\u306b\u9032\u3081\u3066\u3044\u308c\u3070\u3001vagrantfile\u306f\u3001\u300cC:Users\u30e6\u30fc\u30b6\u540dcentos7\u300d\u306b\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u304b\u3089\u30e1\u30e2\u5e33\u3092\u958b\u304d\u3001\u7de8\u96c6\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u4ee5\u4e0b\u3092\u8ffd\u8a18\u3057\u3001\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">config.vm.network \"private_network\", ip: \"192.168.56.xxx\"<\/code><\/pre>\n<p>192.168.56.xxx\u306e\u90e8\u5206\u306b\u306f\u597d\u304d\u306aIP\u30a2\u30c9\u30ec\u30b9\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u300c192.168.56.100\u300d\u3092\u8a2d\u5b9a\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3082\u3046\u4e00\u5ea6\u3001\u4eee\u60f3\u30de\u30b7\u30f3\u3092\u8d77\u52d5\u3055\u305b\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; vagrant up<\/code><\/pre>\n<p>\u8d77\u52d5\u3067\u304d\u307e\u3057\u305f\u304b\uff1f<\/p>\n<p>\u3082\u3057\u3001\u8d77\u52d5\u3067\u304d\u306a\u304b\u3063\u305f\u5834\u5408\u306f\u3001IP\u30a2\u30c9\u30ec\u30b9\u3092\u5909\u66f4\u3057\u3066\u3001\u3082\u3046\u4e00\u5ea6\u8d77\u52d5\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<div id=\"title3\">\n<h2>teraterm\u304b\u3089ssh\u3092\u884c\u3046<\/h2>\n<\/div>\n<p>IP\u30a2\u30c9\u30ec\u30b9\u306b\u5148\u307b\u3069\u8a2d\u5b9a\u3057\u305fIP\u30a2\u30c9\u30ec\u30b9\u3092\u3002<\/p>\n<p>\u8a2d\u5b9a\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u300c127.0.0.1 2222\u300d\u3067\u826f\u304b\u3063\u305f\u6c17\u304c\u3057\u307e\u3059\u3002<\/p>\n<p>\u30e6\u30fc\u30b6\u540d\u306b\u306f\u300cvagrant\u300d\u3068\u5165\u529b\u3057\u3001<\/p>\n<p>\u30d1\u30b9\u30d5\u30ec\u30fc\u30ba\u306b\u306f\u3001RSA\/DSA\/ECDSA\/ED25519\u9375\u3092\u4f7f\u3046 \u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/p>\n<p>\u79d8\u5bc6\u9375\u306f\u3001vagrantfile\u3068\u540c\u968e\u5c64\u306e\u300c.vagrantmachinesdefaultvirtualboxprivate_key\u300d\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u3001teraterm\u304b\u3089\u306essh\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001\u3053\u308c\u3060\u3068\u9762\u5012\u3067\u3059\u3088\u306d\u3002<\/p>\n<div id=\"title4\">\n<h2>\u30d1\u30b9\u30ef\u30fc\u30c9\u8a8d\u8a3c\u306b\u3088\u308b\u30ed\u30b0\u30a4\u30f3\u3092\u8a2d\u5b9a<\/h2>\n<\/div>\n<p>ssh\u3067\u30ed\u30b0\u30a4\u30f3\u5f8c\u3001\u30e6\u30fc\u30b6\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>teraterm\u3067\u306e\u30ed\u30b0\u30a4\u30f3\u304c\u9762\u5012\u3068\u3044\u3046\u5834\u5408\u306f\u3001\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u304b\u3089<strong>vagrant ssh<\/strong>\u3067\u3082\u30ed\u30b0\u30a4\u30f3\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u30ed\u30b0\u30a4\u30f3\u304c\u3067\u304d\u307e\u3057\u305f\u3089\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30e6\u30fc\u30b6\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; sudo useradd \u30e6\u30fc\u30b6\u540d<\/code><\/pre>\n<p>\u4f5c\u6210\u3057\u305f\u30e6\u30fc\u30b6\u306b\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3059\u308b\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; sudo passwd \u30e6\u30fc\u30b6\u540d<\/code><\/pre>\n<p>\u3053\u308c\u3067\u3001\u30e6\u30fc\u30b6\u306e\u4f5c\u6210\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u8a2d\u5b9a\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u304c\u3001\u3053\u308c\u3060\u3051\u3067\u306f\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u8a8d\u8a3c\u3067\u306e\u30ed\u30b0\u30a4\u30f3\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u30d1\u30b9\u30ef\u30fc\u30c9\u8a8d\u8a3c\u3067\u306e\u30ed\u30b0\u30a4\u30f3\u3092\u8a31\u53ef\u3059\u308b<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; sudo vi \/etc\/ssh\/sshd_config<\/code><\/pre>\n<p>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u5185\u306b\u3042\u308b<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">PasswordAuthentication no<\/code><\/pre>\n<p>\u306e\u884c\u3092<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">PasswordAuthentication yes<\/code><\/pre>\n<p>\u306b\u66f8\u304d\u63db\u3048\u307e\u3059\u3002<\/p>\n<p>\uff08 \/ \u3067\u5148\u982d\u304b\u3089\u306e\u691c\u7d22\u304c\u884c\u3048\u307e\u3059\uff09<\/p>\n<p>sshd\u3092\u518d\u8d77\u52d5\u3057\u3001\u5909\u66f4\u3092\u9069\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; sudo systemctl restart sshd<\/code><\/pre>\n<p>\u3053\u308c\u3067\u3001\u4f5c\u6210\u3057\u305f\u30e6\u30fc\u30b6\u3068\u8a2d\u5b9a\u3057\u305f\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u30ed\u30b0\u30a4\u30f3\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<div id=\"title5\">\n<h2>\u4f5c\u6210\u3057\u305f\u30e6\u30fc\u30b6\u306bsudo\u6a29\u9650\u3092\u4e0e\u3048\u308b<\/h2>\n<\/div>\n<p>\u5148\u7a0b\u4f5c\u6210\u3057\u305f\u30e6\u30fc\u30b6\u3067\u306f\u3001sudo\uff08\u7ba1\u7406\u8005\u3068\u3057\u3066\u5b9f\u884c\uff09\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u6a29\u9650\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; sudo visudo<\/code><\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3057\u3001\u4ee5\u4e0b\u3092\u8ffd\u8a18\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">\u30e6\u30fc\u30b6\u540d ALL=NOPASSWD: ALL<\/code><\/pre>\n<p>\u30e6\u30fc\u30b6\u540d\u306b\u306f\u3001\u5148\u307b\u3069\u4f5c\u6210\u3057\u305f\u30e6\u30fc\u30b6\u540d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u3001sudo\u30b3\u30de\u30f3\u30c9\u3092<strong>\u30d1\u30b9\u30ef\u30fc\u30c9\u306a\u3057\u3067<\/strong>\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<div class=\"frame frame-red\">\n<div class=\"frame-title caution\"><i class=\"fa fa-exclamation-triangle\" aria-hidden=\"true\"><\/i>\u6ce8\u610f<\/div>\n<p>\u30d1\u30b9\u30ef\u30fc\u30c9\u306a\u3057\u3067\u7ba1\u7406\u8005\u6a29\u9650\u3092\u5b9f\u884c\u3067\u304d\u3066\u3057\u307e\u3046\u3088\u3046\u306b\u306a\u308b\u305f\u3081\u3001\u6271\u3044\u306b<\/p>\n<\/div>\n<div id=\"title6\">\n<h2>Apache\u3067Web\u30b5\u30fc\u30d0\u3092\u5efa\u3066\u308b<\/h2>\n<\/div>\n<p>apache\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; sudo yum -y install httpd<\/code><\/pre>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u3067\u304d\u305f\u3089\u3001\u8d77\u52d5\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; sudo systemctl start httpd<\/code><\/pre>\n<p>\u3082\u3057\u3001\u3053\u308c\u3067\u8d77\u52d5\u3067\u304d\u306a\u304b\u3063\u305f\u5834\u5408\u306f\u3001<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; sudo \/etc\/init.d\/httpd start<\/code><\/pre>\n<p>\u8d77\u52d5\u3067\u304d\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3092\u3057\u307e\u3059\u3002<\/p>\n<p>status\u3067\u78ba\u8a8d\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u304c\u3001\u30d7\u30ed\u30bb\u30b9\u306e\u8d77\u52d5\u3067\u78ba\u8a8d\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; ps -ef | grep httpd<\/code><\/pre>\n<p>apache\u306e\u516c\u958b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u516c\u958b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f\u3001\u300c<strong>\/var\/www\/html\/<\/strong>\u300d\u3067\u3059\u3002<\/p>\n<p>\u3053\u3061\u3089\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; sudo vi \/var\/www\/html\/index.html<\/code><\/pre>\n<p>\u4e2d\u8eab\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&lt;h1&gt;Hellow world!&lt;\/h1&gt;<\/code><\/pre>\n<p>\u4fdd\u5b58\u3092\u3057\u305f\u3089\u3001\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30b5\u30fc\u30d0\u306b\u8a2d\u5b9a\u3057\u305fIP\u30a2\u30c9\u30ec\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/p>\n<div id=\"title7\">\n<h2>Apache\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6709\u52b9\u306b\u3059\u308b<\/h2>\n<\/div>\n<p>\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u683c\u7d0d\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; sudo mkidr p \/var\/www\/cache<\/code><\/pre>\n<p>\u5ff5\u306e\u305f\u3081\u3001\u6a29\u9650\u4ed8\u4e0e\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; sudo chmod 777 \/var\/www\/cache<\/code><\/pre>\n<p>\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u305f\u3081\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u8aad\u307f\u8fbc\u307f\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; sudo vi \/etc\/httpd\/conf\/httpd.conf<\/code><\/pre>\n<p>\u4ee5\u4e0b\u3092\u8ffd\u8a18<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">LoadModule cache_module modules\/mod_cache.so\r\nLoadModule cache_disk_module modules\/mod_cache_disk.so\r\n&lt;IfModule mod_cache.c&gt;\r\n\u3000\u3000&lt;IfModule mod_cache_disk.c&gt;\r\n\u3000\u3000\u3000\u3000CacheRoot \/var\/www\/cache\r\n\u3000\u3000\u3000\u3000CacheEnable disk \/\r\n\u3000\u3000\u3000\u3000CacheDirLevels 5\r\n\u3000\u3000\u3000\u3000CacheDirLength 3\r\n\u3000\u3000&lt;\/IfModule&gt;\r\n\u3000\u3000CacheIgnoreCacheControl On\r\n\u3000\u3000CacheIgnoreNoLastMod On\r\n\u3000\u3000CacheDefaultExpire  100000\r\n\u3000\u3000CacheMaxExpire 1728000000\r\n&lt;\/IfModule&gt;<\/code><\/pre>\n<p>apache\u306e\u8a2d\u5b9a\u3092\u6709\u52b9<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; httpd -M<\/code><\/pre>\n<p>apache\u3092\u518d\u8d77\u52d5<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; sudo systemctl restart httpd<\/code><\/pre>\n<p>\u3082\u3057\u304f\u306f\u3001<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; sudo \/etc\/init.d\/httpd restart<\/code><\/pre>\n<p>\u30ad\u30e3\u30c3\u30b7\u30e5\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<p>Web\u30da\u30fc\u30b8\u30a2\u30af\u30bb\u30b9\u5f8c\u3001<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; ls \/var\/www\/cache<\/code><\/pre>\n<p>\u3092\u5b9f\u884c\u3057\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308c\u3070\u3001\u554f\u984c\u306a\u3044\u3067\u3059\u3002<\/p>\n<div id=\"title8\">\n<h2>Apache\u306e\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a\u3092\u3059\u308b<\/h2>\n<\/div>\n<p>\u30b5\u30fc\u30d0\u3092\u518d\u8d77\u52d5\u3059\u308b\u3068\u3001apache\u3082\u505c\u6b62\u3059\u308b\u305f\u3081\u3001\u518d\u8d77\u52d5\u5f8c\u306b\u306f\u3001apache\u3092\u8d77\u52d5\u3057\u306a\u304a\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3060\u3068\u9762\u5012\u306a\u305f\u3081\u3001\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a\u3092\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; sudo chkconfig httpd on<\/code><\/pre>\n<p>\u8a2d\u5b9a\u304c\u3067\u304d\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; chkconfig --list httpd<\/code><\/pre>\n<p>\u5b9f\u884c\u30ec\u30d9\u30eb2,3,4,5\u304con\u306b\u306a\u3063\u3066\u3044\u308c\u3070\u8a2d\u5b9a\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<div id=\"title9\">\n<h2>\u65e5\u672c\u8a9e\u3001\u6642\u9593\u306b\u5bfe\u5fdc\u3055\u305b\u308b<\/h2>\n<\/div>\n<p>\u65e5\u672c\u8a9e\u95a2\u9023\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u307e\u3068\u3081\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; sudo yum -y groupinstall \"Japanese Support\"<\/code><\/pre>\n<p>\u30b7\u30b9\u30c6\u30e0\u30ed\u30b1\u30fc\u30eb\u3092\u8a2d\u5b9a<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; sudo yum -y install ibus-kkc vlgothic-*\r\n&gt; sudo localectl set-locale LANG=ja_JP.UTF-8\r\n&gt; source \/etc\/locale.conf<\/code><\/pre>\n<p>\u30de\u30cb\u30e5\u30a2\u30eb\u3092\u65e5\u672c\u8a9e\u5316\u3059\u308b\u3002<\/p>\n<p>\u30de\u30cb\u30e5\u30a2\u30eb\u3092\u78ba\u8a8d\u3057\u307e\u3059<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; man ls<\/code><\/pre>\n<p>\u82f1\u8a9e\u306e\u72b6\u614b\u306a\u306e\u3067\u3001\u65e5\u672c\u8a9e\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; sudo yum -y install man-pages-ja<\/code><\/pre>\n<p>\u3082\u3046\u4e00\u5ea6\u30de\u30cb\u30e5\u30a2\u30eb\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<p>\u65e5\u672c\u8a9e\u306b\u306a\u3063\u3066\u3044\u308c\u3070\u3001\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; man ls<\/code><\/pre>\n<p>\u30ad\u30fc\u30dc\u30fc\u30c9\u3092\u5909\u66f4<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; localectl status\r\n\u00a0  System Locale: LANG=ja_JP.UTF-8\r\n       VC Keymap: us\r\n      X11 Layout: n\/a\u3000<\/code><\/pre>\n<p><strong>VC Keymap<\/strong>\u306e\u5024\u304c\u521d\u671f\u3060\u3068us\u3068\u304b\u306b\u306a\u3063\u3066\u3044\u308b\u3068\u601d\u3046\u306e\u3067\u3001ja106\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; sudo localectl set-keymap jp106<\/code><\/pre>\n<p>\u3082\u3046\u4e00\u5ea6\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">&gt; localectl status\r\n    System Locale: LANG=ja_JP.UTF-8\r\n       VC Keymap: jp106\r\n      X11 Layout: jp\r\n       X11 Model: jp106<\/code><\/pre>\n<p>\u3061\u306a\u307f\u306bjp106\u3068\u3044\u3046\u306e\u306f\u3001\u4ee5\u4e0b\u306e\u5199\u771f\u306e\u3088\u3046\u306a\u30ad\u30fc\u30dc\u30fc\u30c9\u914d\u7f6e\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-large wp-image-1206\" src=\"https:\/\/took.jp\/wp-content\/uploads\/2019\/12\/11036353380385-min-e1575565436626-1024x298.jpg\" alt=\"\" width=\"920\" height=\"268\" srcset=\"https:\/\/took.jp\/tech-blog\/wp-content\/uploads\/2019\/12\/11036353380385-min-e1575565436626.jpg 1024w, https:\/\/took.jp\/tech-blog\/wp-content\/uploads\/2019\/12\/11036353380385-min-e1575565436626-300x87.jpg 300w, https:\/\/took.jp\/tech-blog\/wp-content\/uploads\/2019\/12\/11036353380385-min-e1575565436626-768x223.jpg 768w\" sizes=\"(max-width: 920px) 100vw, 920px\" \/><\/p>\n<p>\u3053\u308c\u3067\u74b0\u5883\u306e\u8a2d\u5b9a\u306f\u7d42\u4e86\u3067\u3059\u3002<\/p>\n<p>\u304a\u75b2\u308c\u3055\u307e\u3067\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u56de\u306f\u3001vagrant\u3092\u4f7f\u7528\u3057\u3066\u3001virtualbox\u306bcentos\u3092\u5165\u308c\u3001apache\u3067web\u30b5\u30fc\u30d0\u516c\u958b\u3059\u308b\u307e\u3067\u3092\u884c\u3044\u307e\u3059\u3002 \u307e\u305a\u3001vagrant\uff08\u30d9\u30a4\u30b0\u30e9\u30f3\u30c8\uff09\u3068\u306f\u3001 Vagrant\uff08\u30d9\u30a4\u30b0\u30e9\u30f3\u30c8\uff09\u306f\u3001FLOSS\u306e\u4eee\u60f3\u6a5f\u68b0\u3092\u69cb\u7bc9\u3059\u308b\u305f\u3081\u2026<\/p>\n","protected":false},"author":3,"featured_media":1868,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62,79],"tags":[90],"class_list":["post-1165","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-it","category-79","tag-pickup"],"_links":{"self":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/posts\/1165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/comments?post=1165"}],"version-history":[{"count":0,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/posts\/1165\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/media\/1868"}],"wp:attachment":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/media?parent=1165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/categories?post=1165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/tags?post=1165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}