プロジェクト

全般

プロフィール

InstallCoLinux » 履歴 » バージョン 6

Yuumi Yoshida, 2007-11-17 23:30

1 1 Yuumi Yoshida
= coLinux で作る 快適Ruby on Rails開発環境 =
2
3
== 対象者 ==
4
5
 * Windows PC 上で快適に Ruby on Railsの開発がしたい人
6
 * Linux(Unix)の基本的なコマンドや設定がわかる人
7
 * CUI(コマンドライン)の好きな人
8
9
10
== 参考資料 ==
11
12
 * WEB+DB PRESS Vol.40  「特集2 coLinux,Emacs,GNU screen,zsh[定番]Linux開発環境」 http://gihyo.jp/magazine/wdpress/archive/2007/vol40
13
14
== インストール ==
15
16
=== 準備しておくソフト ===
17
 * タミナルエミュレータ (例 PuTTY  http://yebisuya.dip.jp/Software/PuTTY/)
18
 * bz2が扱える解凍ソフト(例 Lhaz http://www.chitora.jp/lhaz.html)
19
 * エディタ (例 サクラエディタ http://sakura_editor.at.infoseek.co.jp/)
20
21
=== coLinux インストール ===
22
23 2 Yuumi Yoshida
 1.  ネットを監視するセキュリティソフト(Notne, Macfee...)を OFF にする
24 1 Yuumi Yoshida
25 2 Yuumi Yoshida
  [[Image(secure_off.png, 375)]]
26
27
 2. http://sourceforge.net/project/showfiles.php?group_id=98788 から以下をダウンロード
28
  * coLinux本体:  coLinux-0.7.1.exe 
29
  * Ubuntu Linux イメージ :  Ubuntu-6.06.1.ext3.1gb.bz2
30 1 Yuumi Yoshida
 
31 2 Yuumi Yoshida
 3. coLinux-0.7.1.exe を実行してインストール
32
  * Choose Components 画面では  '''Root Filesystem image Download'''  はチェックを外して下さい。
33
  * インストール場所は適当に設定して下さい。ここでは '''D:¥Program Files¥coLinux¥''' にインストールしたとして書いています。
34
35
 4.  Ubuntu-6.06.1.ext3.1gb.bz2 を適当な解凍ツールを使い、coLinuxをインストールしたディレクトリー(ここでは:¥Program Files¥coLinux¥)に解凍します。
36
37
 5. coLinux 設定ファイルを作成します。
38
   i. D:¥Program Files¥coLinux¥xample.conf をコピーして D:¥Program Files¥coLinux¥ubuntu.conf という名前にします。
39
   i.  ubuntu.conf ファイルを以下のように変更します。(変更した行のみ書きます)
40
{{{
41
cobd0="c:¥coLinux¥root_fs"
42
43
cobd0="D:\Program Files\coLinux\Ubuntu-6.06.1.ext3.1gb"
44
45
ro
46
47
#ro
48
49
#mem=64
50
51 3 Yuumi Yoshida
mem=256  
52 2 Yuumi Yoshida
53
eth0=slirp
54
55
eth0=tuntap
56 1 Yuumi Yoshida
}}}
57 3 Yuumi Yoshida
    '''注意''' mem= は coLinux のメモリー割り当てです。メモリーをたくさん積んでいるPCの場合は大きい方が良いかもしれません、
58
     私が使っているPCはWindowsXP メモリー 1Gbyte のものです。
59 2 Yuumi Yoshida
60
 6. DOSプロンプトを開き、coLinux を起動します
61
{{{
62
> D:
63
> cd ¥Proguram Files¥coLinux
64
> colinux-daemon @ubuntu.conf
65
}}}
66
67
  [[Image(dos.png, 375)]]
68
69
 7.  設定に間違いが無ければ、 DOS 窓に上のようなメッセージが表示され、別ウィンドウに 以下のように coLinux が起動されます。
70
71
   [[Image(coLinux.png, 375)]]
72
73 1 Yuumi Yoshida
   上のように、 '''ubuntu login:''' が表示されれば成功です。
74 3 Yuumi Yoshida
75
76
=== ネットワーク設定 ===
77
78
ネットワーク構成ですが、coLinux にはPCとは別のセングメントを割り当てます。[[BR]]
79
coLinux と PC のネットワークの間は TAP-Win32 というドライバー(ブリッジソフト)が変換するので、coLinux と PC は通信が出来ます。[[BR]]
80
しかし coLiunx からインターネットにアクセスできません、そこでWindowsの「インターネットの共有」機能(NAT)を設定し、coLiunx からインターネットにアクセスできるようにします。
81
82
WindowsXP HOME Edition では、インターネットの共有で設定出来るアドレスは 192.168.0.1 に限られるので、今回は以下のように設定します。
83
 *  coLinux : 192.168.0.2       (192.168.0.2 〜 192.168.0.254 なら変更可能)
84
 * TAP-Win32: 192.168.0.1
85
86
また、PC 、インタネット接続のルーターは以下のアドレスになっているとして書きます。
87
 * PC : 192.168.1.12
88
 * ルーター:  192.168.1.1  
89
90
 1. PC 側設定
91 4 Yuumi Yoshida
   coLinuxが立ち上がった時点で、ネットワーク接続を表示すると以下のように、TAP-Win32 Adapter とうローカルエリア接続があります。[[BR]]ここでは「ローカルエリア接続 3」になっていますが環境によって違う名前が付きます。
92 3 Yuumi Yoshida
93 4 Yuumi Yoshida
  [[Image(net_list.png, 260)]]
94 3 Yuumi Yoshida
95
 2.  TAP-Win32 Adapter のプロパティーを表示し、アドレスを 192.168.0.1 に設定します。
96
97 4 Yuumi Yoshida
  [[Image(net_prop1.png, 260)]]   [[Image(net_prop2.png, 260)]]
98 3 Yuumi Yoshida
99 4 Yuumi Yoshida
 3. インターネットに接続されている接続(ここでは、ワイヤレスネットワーク接続)に「インターネット接続の共有」を設定します。 [[BR]]インターネットの共有はプロパティーの「詳細設定」タブにあります、[[BR]] 「インターネット接続の共有」のチェック と 「ホームネットワーク接続」に TAP-Win32 Adapterを選択します。
100 3 Yuumi Yoshida
101 4 Yuumi Yoshida
  [[Image(net_prop3.png, 260)]]
102 5 Yuumi Yoshida
103
 4. coLinux console に root でログインします。パスワードは root です、インストールが終わったら変更しましょうね。
104
105
 5. ログインできたら、ネットワークの設定を変更します
106
{{{
107
# vi /etc/network/interfaces
108
109
 ※※  iface eth0 inet static 以下を下のように変更します  
110
111
iface eth0 inet static
112
   address 192.168.0.2
113
   broadcast 192.168.0.255
114
   netmask 255.255.255.0
115
   gateway 192.168.0.1
116
}}} 
117
118
 '''注意''' coLinux console は英語キーボードの配列になっているので、記号がキーに書かれているのと違う文字が入ります ^^);
119
120
 6. DNS(name server) の設定も変更します。通常のブローバンドルーターを使っている場合は、DNS はルータのIPアドレスです。
121
{{{
122
# vi /etc/resolv.conf
123
124
 ※※ ブローバンドルーターのIPアドレスを指定
125
nameserver 192.168.1.1
126
}}}
127
128
 7. ネットワークを設定
129
{{{
130
# /etc/init.d/networking restart
131
}}}
132
133
 8. 確認、まずは自分(coLinux)にpingが届くこと
134
{{{
135
# ping -c 3 192.168.0.2
136
PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data.
137
64 bytes from 192.168.0.2: icmp_seq=1 ttl=64 time=0.155 ms
138
64 bytes from 192.168.0.2: icmp_seq=2 ttl=64 time=0.158 ms
139
64 bytes from 192.168.0.2: icmp_seq=3 ttl=64 time=0.161 ms
140
141
--- 192.168.0.2 ping statistics ---
142
3 packets transmitted, 3 received, 0%25 packet loss, time 2015ms
143
rtt min/avg/max/mdev = 0.155/0.158/0.161/0.002 ms
144
}}}
145
146
 9. OKなら TAP-Win32 にpingが届くことを確認
147
{{{
148
# ping -c 3 192.168.0.1
149
 以下省略
150
}}}
151
 10. OKなら PC にpingが届くことを確認
152
{{{
153
# ping -c 3 192.168.1.12
154
 以下省略
155
}}}
156
 11. OKなら  ルーター にpingが届くことを確認
157
{{{
158
# ping -c 3 192.168.1.1
159
 以下省略
160
}}}
161
 12. OKなら ネット上のサイト にpingが届くことを確認
162
{{{
163
# ping -c 3 mixi.jp
164
 以下省略
165
}}}
166
167
168
=== アカウント作成 ===
169
170 6 Yuumi Yoshida
 1. 自分のログイン用アカウントを作りましょう。ログイン名/パスワードは PC と同じにして下さい。
171 5 Yuumi Yoshida
{{{
172
# adduser taro     ← ログイン名 trao を作成
173
Adding user `taro'...
174
Adding new group `taro' (1001).
175
Adding new user `taro' (1001) with group `taro'.
176
Creating home directory `/home/taro'.
177
Copying files from `/etc/skel'
178
Enter new UNIX password:                 ← パスワード
179
Retype new UNIX password:              ← パスワード
180
passwd: password updated successfully
181
Changing the user information for taro
182
Enter the new value, or press ENTER for the default
183
	Full Name []:                                       ← Enter のみでよい
184
	Room Number []: 
185
	Work Phone []: 
186
	Home Phone []: 
187
	Other []: 
188 1 Yuumi Yoshida
Is the information correct? [y/N] y      ← Y を忘れずに
189 6 Yuumi Yoshida
}}}
190
191
 2. sudo が使えるように設定します
192
{{{
193
# vi /etc/sudoers
194
root    ALL=(ALL) ALL
195
taro      ALL=(ALL) ALL     ←  自分のアカウントを rootと同様に追加
196 5 Yuumi Yoshida
}}}