Wiki » History » Version 3

Christian Zenker, 2013-11-21 12:45

1 3 Christian Zenker
h1. Warning
2 3 Christian Zenker
3 3 Christian Zenker
*This information is not regularily updated.* See "README.md":https://git.typo3.org/Teams/Server/Vagrant/Typo3Org.git/blob/HEAD:/README.md for up-to-date information.
4 3 Christian Zenker
5 1 Fabien Udriot
h1. Overview
6 1 Fabien Udriot
7 1 Fabien Udriot
This is a repository used for setting up a development version of typo3.org website.
8 1 Fabien Udriot
9 1 Fabien Udriot
For the first installation, consider one good hour to walk through all the steps. The time will depend on the speed of your network along to the the performance of your machine. There will about +500 Mb to download which includes a virtual machine and the typo3.org image.
10 1 Fabien Udriot
11 1 Fabien Udriot
h1. Quick set up guide
12 1 Fabien Udriot
13 1 Fabien Udriot
The first commands will check if the needed software is installed.
14 1 Fabien Udriot
15 1 Fabien Udriot
<pre>
16 1 Fabien Udriot
	# Test if your system contains all the necessary software.
17 1 Fabien Udriot
	vagrant help        -> Refer to "Vagrant" and "Virtualbox" chapter if command missing
18 1 Fabien Udriot
	bundle help         -> Refer to "Gems" chapter if command missing
19 1 Fabien Udriot
	chef-solo --help    -> Refer to "Chef" chapter if command missing
20 1 Fabien Udriot
21 1 Fabien Udriot
	# Add a new image that will be stored into ~/.vagrant.d/boxes/
22 2 Fabien Udriot
	vagrant box add squeeze https://dl.dropbox.com/u/1467717/VirtualBoxes/squeeze.box
23 1 Fabien Udriot
24 1 Fabien Udriot
	# Download Recipe
25 1 Fabien Udriot
	git clone git://github.com/fudriot/chef-t3org.git
26 1 Fabien Udriot
	cd chef-t3org
27 1 Fabien Udriot
28 1 Fabien Udriot
	# Install Gem dependencies
29 1 Fabien Udriot
	bundle install
30 1 Fabien Udriot
31 1 Fabien Udriot
	# Fire up installation
32 1 Fabien Udriot
	# Refer to the troubleshooting below if anything goes wrong.
33 1 Fabien Udriot
	vagrant up
34 1 Fabien Udriot
35 1 Fabien Udriot
	# Enter virtual machine by using vagrant itself.
36 1 Fabien Udriot
	# The default username / password is vagrant / vagrant
37 1 Fabien Udriot
	vagrant ssh
38 1 Fabien Udriot
39 1 Fabien Udriot
	# Test the website
40 1 Fabien Udriot
	curl t3org.dev
41 1 Fabien Udriot
42 1 Fabien Udriot
	# Sugestion to access the virtual machine from outside
43 1 Fabien Udriot
	open Vagrantfile
44 1 Fabien Udriot
	# -> comment out "config.vm.network" line
45 1 Fabien Udriot
	vagrant reload
46 1 Fabien Udriot
47 1 Fabien Udriot
	# Files system is at:
48 1 Fabien Udriot
	cd /var/www/vhost/t3org.dev
49 1 Fabien Udriot
</pre>
50 1 Fabien Udriot
51 1 Fabien Udriot
Refer to the troubleshooting section below if any problem pops up during installation.
52 1 Fabien Udriot
53 1 Fabien Udriot
h1. Installation of the software
54 1 Fabien Udriot
55 1 Fabien Udriot
h2. Chef
56 1 Fabien Udriot
57 1 Fabien Udriot
To get started you need a environment as described here:
58 1 Fabien Udriot
59 1 Fabien Udriot
  http://wiki.opscode.com/display/chef/Workstation+Setup
60 1 Fabien Udriot
61 1 Fabien Udriot
You'll especially need
62 1 Fabien Udriot
63 1 Fabien Udriot
- git
64 1 Fabien Udriot
- gcc compilers and headers (eg. XCode / build-essential)
65 1 Fabien Udriot
66 1 Fabien Udriot
To install Chef on your system, type:
67 1 Fabien Udriot
68 1 Fabien Udriot
<pre>
69 1 Fabien Udriot
	# Run as sudo if permission issue
70 1 Fabien Udriot
	gem update --system
71 1 Fabien Udriot
	gem install chef
72 1 Fabien Udriot
</pre>
73 1 Fabien Udriot
74 1 Fabien Udriot
h2. Vagrant
75 1 Fabien Udriot
76 1 Fabien Udriot
Vagrant can be downloaded and installed from the website http://vagrantup.com/
77 1 Fabien Udriot
78 1 Fabien Udriot
<pre>
79 1 Fabien Udriot
	# Run as sudo if permission issue
80 1 Fabien Udriot
	gem update --system
81 1 Fabien Udriot
	gem install vagrant
82 1 Fabien Udriot
</pre>
83 1 Fabien Udriot
84 1 Fabien Udriot
h2. Virtualbox
85 1 Fabien Udriot
86 1 Fabien Udriot
VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use.
87 1 Fabien Udriot
Follow this download link to install it on your system https://www.virtualbox.org/wiki/Downloads
88 1 Fabien Udriot
89 1 Fabien Udriot
h2. Gems
90 1 Fabien Udriot
91 1 Fabien Udriot
Bundler manages an application's dependencies through its entire life across many machines systematically and repeatably.
92 1 Fabien Udriot
93 1 Fabien Udriot
<pre>
94 1 Fabien Udriot
	# Run as sudo if permission issue
95 1 Fabien Udriot
	gem update --system
96 1 Fabien Udriot
	gem install bundler --no-ri --no-rdoc
97 1 Fabien Udriot
</pre>
98 1 Fabien Udriot
99 1 Fabien Udriot
h1. Configure Vagrant file
100 1 Fabien Udriot
101 1 Fabien Udriot
To adjust configuration open ``Vagrantfile`` file and change settings according to your needs.
102 1 Fabien Udriot
103 1 Fabien Udriot
<pre>
104 1 Fabien Udriot
	# Define IP of the virtual machine to access it from the host
105 1 Fabien Udriot
	config.vm.network :hostonly, "192.168.156.122"
106 1 Fabien Udriot
107 1 Fabien Udriot
	# Activate the GUI or run in headless mode
108 1 Fabien Udriot
	config.vm.boot_mode = :gui
109 1 Fabien Udriot
110 1 Fabien Udriot
	# Turn on verbose Chef logging if necessary
111 1 Fabien Udriot
	chef.log_level      = :debug
112 1 Fabien Udriot
</pre>
113 1 Fabien Udriot
114 1 Fabien Udriot
h2. Troubleshooting
115 1 Fabien Udriot
116 1 Fabien Udriot
h3. Vagrant stuck (Network issue)
117 1 Fabien Udriot
It happens sometimes Vagrant can not finish the setup and remains stuck most likely because of networking issues. An easy workaround is to login into the Box using the GUI window (vagrant / vagrant as username / password) and to reboot the Box with "sudo reboot".
118 1 Fabien Udriot
119 1 Fabien Udriot
- Run vagrant using the following line:
120 1 Fabien Udriot
121 1 Fabien Udriot
	config.vm.boot_mode = :gui
122 1 Fabien Udriot
123 1 Fabien Udriot
- Next, login using "vagrant" / "vagrant"
124 1 Fabien Udriot
125 1 Fabien Udriot
- Now run "sudo -s" and try to fix the problem manually:
126 1 Fabien Udriot
127 1 Fabien Udriot
	sudo /etc/init.d/networking restart
128 1 Fabien Udriot
129 1 Fabien Udriot
If that helps, you might try adding the following line to /etc/rc.local (right before "exit 0"):
130 1 Fabien Udriot
131 1 Fabien Udriot
	sh /etc/init.d/networking restart
132 1 Fabien Udriot
133 1 Fabien Udriot
(Source: https://github.com/mitchellh/vagrant/issues/391)
134 1 Fabien Udriot
135 1 Fabien Udriot
h3. Debian security updates throws a 404
136 1 Fabien Udriot
At your first "vagrant up", vagrant tries to apply all the chef recipes.
137 1 Fabien Udriot
During this process, it could be that there are some security updates for the Debian box.
138 1 Fabien Udriot
If the security updates throw a 404 like
139 1 Fabien Udriot
140 1 Fabien Udriot
<pre>
141 1 Fabien Udriot
	Get:1 http://http.us.debian.org/debian/ squeeze/main patch amd64 2.6-2 [120 kB]
142 1 Fabien Udriot
	Err http://security.debian.org/ squeeze/updates/main linux-headers-2.6.32-5-amd64 amd64 2.6.32-41squeeze2  404  Not Found [IP: 212.211.132.32 80]
143 1 Fabien Udriot
	Failed to fetch http://security.debian.org/pool/updates/main/l/linux-2.6/linux-headers-2.6.32-5-common_2.6.32-41squeeze2_amd64.deb  404  Not Found [IP: 212.211.132.32 80]
144 1 Fabien Udriot
	Failed to fetch http://security.debian.org/pool/updates/main/l/linux-2.6/linux-headers-2.6.32-5-amd64_2.6.32-41squeeze2_amd64.deb  404  Not Found [IP: 212.211.132.32 80]
145 1 Fabien Udriot
</pre>
146 1 Fabien Udriot
147 1 Fabien Udriot
You have to do some manual stuff, to finish the process.
148 1 Fabien Udriot
Just run the following commands:
149 1 Fabien Udriot
150 1 Fabien Udriot
Login in via ssh to your VM (assuming the VM is launched)
151 1 Fabien Udriot
152 1 Fabien Udriot
<pre>
153 1 Fabien Udriot
	vagrant ssh
154 1 Fabien Udriot
</pre>
155 1 Fabien Udriot
156 1 Fabien Udriot
Execute manual update
157 1 Fabien Udriot
158 1 Fabien Udriot
<pre>
159 1 Fabien Udriot
	sudo apt-get update
160 1 Fabien Udriot
</pre>
161 1 Fabien Udriot
162 1 Fabien Udriot
Exit the ssh connection
163 1 Fabien Udriot
164 1 Fabien Udriot
<pre>
165 1 Fabien Udriot
	exit
166 1 Fabien Udriot
</pre>
167 1 Fabien Udriot
168 1 Fabien Udriot
And reload your VM
169 1 Fabien Udriot
170 1 Fabien Udriot
<pre>
171 1 Fabien Udriot
	vagrant reload
172 1 Fabien Udriot
</pre>
173 1 Fabien Udriot
174 1 Fabien Udriot
Now, the updates can be applied and the chef magic will start.