Wiki » History » Version 1

Fabien Udriot, 2012-07-05 09:37

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