2009年4月8日水曜日

ネットワークの設定

FreeBSD7.1

・IPアドレスの設定
----------------------------------
インストール後の設定の続き


■IPアドレスの設定
SSHでリモートログインするためにも、今後のアプリケーションのインストール
のためにも、サーバーとしてサービスを提供するためにもネットワークの設定が
必要です。
ここでは、Lanの設定を行います。

ネットワークの環境を次のものとして設定していきます。
各自のネットワークの状態に合わせて適宜変えて設定して下さい。

ルーター:192.168.0.1
DNSサーバー:192.168.0.1
サーバー名:tara
IPアドレス:192.168.0.80


#sysinstall





[Configure]-[Networking]の順に選びます


[Space]を押します。



[Ethernet card]と表示さているものを選択します。
ここでは、
[re0 RealTek 8139C+/8169/8169S/8110S PCI Ethernet card]
を選択しています。
[Enter]


Do you want to try IPv6 configuration of the interface?
[ No ]を選びます


Do you want to try DHCP configuration of the interface?
[ No ]を選びます



適宜入力します。



[OK]

[X Exit]を選択し[Enter]

[X Exit]を選択し[Enter]

[X Exit Install]を選択し[Enter]


#reboot[Enter]




SSH2の設定 リモートログインへ続く

.

インストール後の設定

FreeBSD7.1

・最初のログイン
・ユーザーの追加
----------------------------------

FreeBSD7.1のインストールの続き


■最初のログイン
サーバーに電源を入れるとログイン画面が表示されます。


FreeBSD/amd64 (tara) (ttyv0)

login:


と表示されます。
loginに"root"
Passwordにインストール時に設定したパスワードを入力します。


FreeBSD/amd64 (tara) (ttyv0)

login:root[Enter]
Password:*****[Enter]

Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California. All rights reserved.

FreeBSD 7.1-RELEASE (GENERIC) #0: Thu Jan 1 08:58:24 UTC 2009

Welcome to FreeBSD!

Before seeking technical support, please use the following resources:

o Security advisories and updated errata information for all releases are
at http://www.FreeBSD.org/releases/ - always consult the ERRATA section
for your release first as it's updated frequently.

o The Handbook and FAQ documents are at http://www.FreeBSD.org/ and,
along with the mailing lists, can be searched by going to
http://www.FreeBSD.org/search/. If the doc distribution has
been installed, they're also available formatted in /usr/share/doc.

If you still have a question or problem, please take the output of
`uname -a', along with any relevant error messages, and email it
as a question to the questions@FreeBSD.org mailing list. If you are
unfamiliar with FreeBSD's directory layout, please refer to the hier(7)
manual page. If you are not familiar with manual pages, type `man man'.

You may also use sysinstall(8) to re-enter the installation and
configuration utility. Edit /etc/motd to change this login announcement.

#■


このように表示され入力状態になります。

ログアウトするには
#exit

サーバーをシャットダウンするには
shutdown -p now
を使います。


#shutdown -p now
Shutdown NOW!
shutdown: [pid 2347]
#
*** FINAL System shutdown message from boon@kappa.local ***
System going down IMMEDIATELY



System shutdown time has arrived

と表示が出て電源が切れます。

■ユーザーの追加

次にユーザーを追加します。
サーバーの画面上で操作すると画面が小さく、操作がしにくく、
また操作した内容がすぐに消えてしまいとても苦痛に感じるはずです。
通常サーバーは、サーバー自体で操作するのではなく、遠隔操作して使用します。
そこでSSHというもので、Windowsなどの他のPCから接続し、コマンドを打ちながら
操作します。これだと画面に表示された内容をスクロールバックして再表示
でき、画面上でコピーペーストできるようになるので、格段と扱いやすくなります。


SSHを使用するためには、rootアカウントとは別にユーザーアカウントというものを
作り、それを使用してログインするようにします。


#adduser[Enter]
Username:daimazin[ユーザー名を入力する]
Full name:dai mazin[フルネームを入力する]
Uid (Leave empty for default):[Enter]
Login group [daimazin]:[Enter]
Login group is daimazin. Invite daimazin into other groups? []:wheel[重要wheel Enter]
Login class [default]:[Enter]
Shell (sh csh tcsh nologin) [sh]: tcsh[tcsh Enter]
Home directory [/home/daimazin]:[Enter]
Home directory permissions (Leave empty for default):[Enter]
Use password-based authentication? [yes]:[Enter]
Use an empty password? (yes/no) [no]:[Enter]
Use a random password? (yes/no) [no]:[Enter]
Enter password:*******[パスワードを設定します Enter]
Enter password again:*******[同じパスワードを入力します Enter]
Lock out the account after creation? [no]:
Username : daimazin
Password : *****
Full Name : dai mazin
Uid : 1002
Class :
Groups : daimazin
Home : /home/daimazin
Home Mode :
Shell : /bin/tcsh
Locked : no
OK? (yes/no): yes[yes Enter]
adduser: INFO: Successfully added (daimazin) to the user database.
Add another user? (yes/no): no[no Enter]
Goodbye!



これでdaimazinというアカウントが作成できました。
途中、グループにwheelというのを指定しましたが、これは、管理者グループで
このグループに参加させておくことで、インストールや設定などを行えるようになります。

ネットワークの設定へ続く

.

FreeBSD7.1のインストール

FreeBSD7.1インストール
サーバー構築
AMD AthronX2/4850e
GIGABYTE MA78GPM-DS2H
------------------------------------------
FreeBSD7.1のダウンロードの続き

BIOSの設定で起動デバイス順序でCD/DVDドライブを最優先に変更しておきます。


FreeBSD7.1のダウンロードで作成したメディアをサーバーに入れDVD-Rから起動します。


サーバーを起動します。

FreeBSDの起動画面が表示されます。
インストーラーが開始されます。






以下キーボードのカーソルキー(矢印キー)で操作します。
上下左右のキーで選択し、キーボードの[Enter]が決定です。
しばらくすると次の画面が表示されます。


■Country Selection
[110 Japan]を選択します。





[OK]を選びキーボードの[Enter]を押します。

■System Console Keymap
[Japanese 106 Japanese 106 keymap]
となっていることを確認し、
[OK]を押す




■FreeBSD/amd64 7.1-RELEASE - sysisntall Main Menu
[Custom]
を選択する



■Choose Custom Installation Optoins

パーティーションの作成
[3 Partition Allocate disk space for FreeBSD]



■message
Worning: A geometry of 76613/16/255....
[OK]



■FDISK Partition Editor


パーティーションが残っていれば[D]でパーティーションを削除する。



キーボードから[C]を押す


[OK]
165
[OK]

[Q]




■Install Boot Manager for drive ad0?
[BootMgr Install the FreeBSD Boot Manager]
を選び[OK]



■Choose Custom Installation Optoins
[4 Label Label allocated disk partitions]
を選び[OK]



■FreeBSD Disklabel Editor


キーボードから[A]を押す
ディスクラベルが自動的に設定される。
[Q]で終了する


■Choose Custom Installation Optoins
[5 Distributions Select distribution(s) to extract]
を選び[OK]


■Choose Distributions
[6 Kern-Developer Full Binaries and doc,Kernel sources only]
を選びキーボードの[SPACE]キーを押す



■User Confirmation Request
[Yes]を選ぶ



■Choose Distributions
[X Exit Exit this menu (returning to previous)]
を選びキーボードの[Enter]キーを押す



■Choose Custom Installation Optoins
[6 Media Choose the installation media type]
を選び[OK]


■Choose Installation Media
[CD/DVD]
を選び[OK]


■Choose Custom Installation Optoins
[7 Commit Perform any pending Partion/Label/Extract actions]
[OK]


■User Confirmation Request
[Yes]





これで、ディスクのパーティーショニング、フォーマット、インストールが始まります。





ここまでくれば基本的なインストールは終了です。
次に管理者アカウントのパスワードを設定します。

■User Confirmation Requested
他に一般的な設定をするのか?
と聞いてきているので、[Yes]を選択します。




■管理者パスワードの設定 Rootアカウントのパスワード設定
FreeBSD Configuration Menu
[Root Password]を選択します。



パスワードを入力します。
New Password:
に続けて入力し[Enter]を押します。



パスワードを再入力します。
Retype New Password:
に続けて入力し[Enter]を押します。



■Time Zone タイムゾーンの設定
何も指定しないと夏時間になると1時間ずれたりします。



[Time Zone]を選択します。




Is this machine's CMOS clock set to UTC? If it is set to local time,or you don't know, please choose NO here!

マザーボード上の時計がUTCをあらわすのか選択します。
通常ローカルタイムである日本時間を設定しておくので、
[No]を選択します。



[5 Asia]を選択します。



[18 Japan]を選択します。



Does the abbreviation `JST' look reasonable?
日本時刻の表記にJSTを使うのか?

[Yes]
を選びます。

■再起動

ここまでの作業で最低限の設定は終了しました。
ここからは再起動してからの操作になります。
この設定画面から終了するには、画面上部に表示されている[Exit]を選択し終了させていきます。
次のような手順で終了させます。



FreeBSD Configuration Menu
[X Exit]を選択します。




[X Exit Install]を選択し[Enter]を押す。



User Confirmation Requested
Are you sure you wish to Exit?

と表示されたら
CD/DVDを取り出します。

[Yes]を押します。



サーバーが再起動を始めます。



FreeBSDの起動画面が表示されたら完成です。

起動後はいよいよFreeBSDの設定を行って行きます。

インストール後の設定へ続く

.