質問編集履歴

1

質問追記

2017/10/05 11:29

投稿

roronoazoro
roronoazoro

スコア113

test CHANGED
File without changes
test CHANGED
@@ -29,3 +29,131 @@
29
29
  /opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin/vscode
30
30
 
31
31
  ```
32
+
33
+
34
+
35
+ 10月5日追記
36
+
37
+ 今回の目的としてwordpressの学習で、仮想環境を少しかじったのでどうせならばcentos7でやってみようと思い、そこでより効率的にエディタ等の設定をというのが今回の目的です。
38
+
39
+ 下記にvagrnatfileを記載しました。
40
+
41
+ マウント位置は`/var/www/wordpress`にしました。
42
+
43
+ `.vimrc`の設定を共通ディレクトリを見いだし、そこへexportするかリンクで反映させる二つのやり方があるという解釈で大丈夫でしょうか?
44
+
45
+
46
+
47
+ 合ってるとしましたら、今回の場合のように、wordpressディレクトリでマウントしたい、でもviもホストのものを使いたいといった場合はどうすればいいでしょうか?
48
+
49
+ 検討違いでしたらすみません。
50
+
51
+
52
+
53
+ ```bash
54
+
55
+ #--Vagrantfile
56
+
57
+
58
+
59
+ 1 # -*- mode: ruby -*-↲
60
+
61
+ 2 # vi: set ft=ruby :↲
62
+
63
+ 3 ↲
64
+
65
+ 4 # All Vagrant configuration is done below. The "2" in Vagrant.configure↲
66
+
67
+ 5 # configures the configuration version (we support older styles for↲
68
+
69
+ 6 # backwards compatibility). Please don't change it unless you know what↲
70
+
71
+ 7 # you're doing.↲
72
+
73
+ 8 Vagrant.configure("2") do |config|↲
74
+
75
+ 9 # The most common configuration options are documented and commented below.↲
76
+
77
+ 10 # For a complete reference, please see the online documentation at↲
78
+
79
+ 11 # https://docs.vagrantup.com.↲
80
+
81
+ 12 ↲
82
+
83
+ 13 # Every Vagrant development environment requires a box. You can search for↲
84
+
85
+ 14 # boxes at https://vagrantcloud.com/search.↲
86
+
87
+ 15 config.vm.box = "bento/centos-7.3"↲
88
+
89
+ 16 ↲
90
+
91
+ 17 # Disable automatic box update checking. If you disable this, then↲
92
+
93
+ 18 # boxes will only be checked for updates when the user runs↲
94
+
95
+ 19 # `vagrant box outdated`. This is not recommended.↲
96
+
97
+ 20 # config.vm.box_check_update = false↲
98
+
99
+ 21 ↲
100
+
101
+ 22 # Create a forwarded port mapping which allows access to a specific port↲
102
+
103
+ 23 # within the machine from a port on the host machine. In the example below,↲
104
+
105
+ 24 # accessing "localhost:8080" will access port 80 on the guest machine.↲
106
+
107
+ 25 # NOTE: This will enable public access to the opened port↲
108
+
109
+ 26 # config.vm.network "forwarded_port", guest: 80, host: 8080↲
110
+
111
+ 27 ↲
112
+
113
+ 28 # Create a forwarded port mapping which allows access to a specific port↲
114
+
115
+ 29 # within the machine from a port on the host machine and only allow access↲
116
+
117
+ 30 # via 127.0.0.1 to disable public access↲
118
+
119
+ 31 # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"↲
120
+
121
+ 32 ↲
122
+
123
+ 33 # Create a private network, which allows host-only access to the machine↲
124
+
125
+ 34 # using a specific IP.↲
126
+
127
+ 35 # config.vm.network "private_network", ip: "192.168.33.10"↲
128
+
129
+ 36 ↲
130
+
131
+ 37 # Create a public network, which generally matched to bridged network.↲
132
+
133
+ 38 # Bridged networks make the machine appear as another physical device on↲
134
+
135
+ 39 # your network.↲
136
+
137
+ 40 # config.vm.network "public_network"↲
138
+
139
+ 41 ↲
140
+
141
+ 42 # Share an additional folder to the guest VM. The first argument is↲
142
+
143
+ 43 # the path on the host to the actual folder. The second argument is↲
144
+
145
+ 44 # the path on the guest to mount the folder. And the optional third↲
146
+
147
+ 45 # argument is a set of non-required options.↲
148
+
149
+ 46 config.vm.synced_folder ".", "/var/www/wordpress",↲
150
+
151
+ 47 ▸ ▸ :nginx => "nginx",↲
152
+
153
+ Vagrantfile 1,1 Top
154
+
155
+ "Vagrantfile" 73L, 3107C
156
+
157
+
158
+
159
+ ```