質問編集履歴

2

参考サイトの追加

2018/05/11 09:07

投稿

muscle1100
muscle1100

スコア19

test CHANGED
File without changes
test CHANGED
@@ -171,3 +171,7 @@
171
171
 
172
172
 
173
173
  ```
174
+
175
+ ---
176
+
177
+ 参考サイトはこちらです[VirtualBox Vagrant でローカル開発web環境の共通化](https://qiita.com/yasshcy/items/8079c0cf4a96e461863b)

1

vagrantfileの追加

2018/05/11 09:07

投稿

muscle1100
muscle1100

スコア19

test CHANGED
File without changes
test CHANGED
@@ -19,3 +19,155 @@
19
19
 
20
20
 
21
21
  どうかお願いします.
22
+
23
+
24
+
25
+ ```vagrantfile
26
+
27
+ # -*- mode: ruby -*-
28
+
29
+ # vi: set ft=ruby :
30
+
31
+
32
+
33
+ # All Vagrant configuration is done below. The "2" in Vagrant.configure
34
+
35
+ # configures the configuration version (we support older styles for
36
+
37
+ # backwards compatibility). Please don't change it unless you know what
38
+
39
+ # you're doing.
40
+
41
+ Vagrant.configure("2") do |config|
42
+
43
+ # The most common configuration options are documented and commented below.
44
+
45
+ # For a complete reference, please see the online documentation at
46
+
47
+ # https://docs.vagrantup.com.
48
+
49
+
50
+
51
+ # Every Vagrant development environment requires a box. You can search for
52
+
53
+ # boxes at https://vagrantcloud.com/search.
54
+
55
+ config.vm.box = "CentOS72"
56
+
57
+
58
+
59
+ # Disable automatic box update checking. If you disable this, then
60
+
61
+ # boxes will only be checked for updates when the user runs
62
+
63
+ # `vagrant box outdated`. This is not recommended.
64
+
65
+ # config.vm.box_check_update = false
66
+
67
+
68
+
69
+ # Create a forwarded port mapping which allows access to a specific port
70
+
71
+ # within the machine from a port on the host machine. In the example below,
72
+
73
+ # accessing "localhost:8080" will access port 80 on the guest machine.
74
+
75
+ # NOTE: This will enable public access to the opened port
76
+
77
+ # config.vm.network "forwarded_port", guest: 80, host: 8080
78
+
79
+
80
+
81
+ # Create a forwarded port mapping which allows access to a specific port
82
+
83
+ # within the machine from a port on the host machine and only allow access
84
+
85
+ # via 127.0.0.1 to disable public access
86
+
87
+ # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
88
+
89
+
90
+
91
+ # Create a private network, which allows host-only access to the machine
92
+
93
+ # using a specific IP.
94
+
95
+ config.vm.network "private_network", ip: "192.168.33.10"
96
+
97
+
98
+
99
+ # Create a public network, which generally matched to bridged network.
100
+
101
+ # Bridged networks make the machine appear as another physical device on
102
+
103
+ # your network.
104
+
105
+ # config.vm.network "public_network"
106
+
107
+
108
+
109
+ # Share an additional folder to the guest VM. The first argument is
110
+
111
+ # the path on the host to the actual folder. The second argument is
112
+
113
+ # the path on the guest to mount the folder. And the optional third
114
+
115
+ # argument is a set of non-required options.
116
+
117
+ # config.vm.synced_folder "../data", "/vagrant_data"
118
+
119
+
120
+
121
+ # Provider-specific configuration so you can fine-tune various
122
+
123
+ # backing providers for Vagrant. These expose provider-specific options.
124
+
125
+ # Example for VirtualBox:
126
+
127
+ #
128
+
129
+ # config.vm.provider "virtualbox" do |vb|
130
+
131
+ # # Display the VirtualBox GUI when booting the machine
132
+
133
+ # vb.gui = true
134
+
135
+ #
136
+
137
+ # # Customize the amount of memory on the VM:
138
+
139
+ # vb.memory = "1024"
140
+
141
+ # end
142
+
143
+ #
144
+
145
+ # View the documentation for the provider you are using for more
146
+
147
+ # information on available options.
148
+
149
+
150
+
151
+ # Enable provisioning with a shell script. Additional provisioners such as
152
+
153
+ # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
154
+
155
+ # documentation for more information about their specific syntax and use.
156
+
157
+ # config.vm.provision "shell", inline: <<-SHELL
158
+
159
+ # apt-get update
160
+
161
+ # apt-get install -y apache2
162
+
163
+ # SHELL
164
+
165
+ config.vm.synced_folder ".", "/vagrant", mount_options:['dmode=777','fmode=777']
166
+
167
+ end
168
+
169
+
170
+
171
+
172
+
173
+ ```