Ubuntu 8.04 Hardy Heronの初期設定メモ。 ハードディスクへのインストール後に設定したことなどの自分用メモ。 Ubuntu 7.04 Feisty Fawnからのアップグレードではなく、バックアップを取ったあとパーティションを再作成してクリーンインストールした。
最新バージョンでの初期設定内容はUbuntuにて掲載しています。
サービス・システム設定
ネットワーク設定
- ネットワーク設定を変更
- DHCPからIPアドレス指定に変更
- ゲートウェイ、ホスト名、ドメイン名、DNSサーバを設定
IPアドレス指定でホスト名・ドメイン名で変更した場合、sudo出来なくなる場合がある。 対処法:Ubuntu日本語フォーラム / Hardyにしたら端末でsudoできない
Synapticパッケージマネージャ設定
- 設定
- 全般
- メインウィンドウ内でパッケージ情報を表示する
- 変更のを正常に適用できた場合に終了の確認をする
- 全般
- リポジトリ
- Ubuntuのソフトウェア
- main, universe, restricted, multiverse
- 「CD-ROM/DVDからのインストール」しない
- アップデート
- アップデートをチェック 2日毎
- インストールできるアップデートを通知のみする
- Ubuntuのソフトウェア
設定が終わったら「再読込」でパッケージ情報を更新、アップデート・マネージャで念のため更新チェックする。
サービス設定
- 以下のサービスだけ起動する
- powernowd
- anacron
- alsa-utils
- gdm
- dbus
- hotkey-setup
- avahi-daemon
- klogd
- sysklogd
- acpid
- apmd
- 停止するサービス
- bluetooth
- atd
- apport
- cupsys
- 開始するサービス
- alsa-utils
日付と時刻の設定
- 設定を「インターネット上のサーバと同期させる」に変更
- 「NTPサポートのインストール」する
- NTPサーバを設定
キーボード・マウス・ディスプレイ・サウンド
- キーボードの設定を変更
- マウスの設定を変更
- 画面の解像度の設定を変更
- スクリーンセーバーの設定を変更
- 電源管理の設定を変更
- AC電源使用時
- 「システムをスリープ」しない
- 「画面をスリープ」しない
- 全般
- 「電源ボタンを押したら」→「ダイアログを表示する」
- 「通知エリア」→「バッテリーを使用している時だけアイコンを表示する」
- AC電源使用時
- 効果音の設定
- 各デバイスをテスト
- ミキシングが正常に動作することを確認
セッション
- セッション初期設定
- 「自動起動するプログラム」から下記のもの以外を削除
- Check for new hardware drivers
- Network Manager
- PulseAudio Session Management
- Update Notifier
- ボリュームの管理
- 電源の管理
- 「自動起動するプログラム」から下記のもの以外を削除
検索とインデックス化
一切無効にする。
SCIM入力メソッドの設定
- フロントエンド/全体設定
- 「SCIM開始」をZenkaku_Hankakuのみに変更
- IMエンジン/Anthy
- キーバインドテーマをATOKに変更
再起動
ここまででいったん再起動。 再起動後にps, topで必要なさそうなプロセスが動いてないかチェックする。
ソフトウェアのインストール・環境設定
端末・エディタの設定
~/.bashrcに以下追記
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
PS1='\!> \u@\h [\t \w]\$ '
以下の内容で~/.vimrc作成
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=utf-8,cp932,iso-2022-jp,euc-jp
set backspace=2
set tabstop=2
set shiftwidth=4
set expandtab
highlight tabs ctermbg=green guibg=green
set list
set number
set ruler
set smartindent
デフォルトのエディタをvimにする
$ sudo update-alternatives --config editor
`editor' を提供する 3 個の alternatives があります。
選択肢 alternative
-----------------------------------------------
1 /usr/bin/vim.tiny
2 /bin/ed
*+ 3 /bin/nano
デフォルト[*] のままにするには Enter、さもなければ選択肢の番号のキーを押してください: 1
Using '/usr/bin/vim.tiny' to provide 'editor'.
必要なソフトウェア
apt-getでまとめてインストール。 開発に使うツールなど。
sudo apt-get install \
amarok \
amarok-engines \
autoconf \
automake1.9 \
autotools-dev \
bison \
bittorrent \
build-essential \
cadaver \
dovecot-common \
dovecot-imapd \
easytag \
ffmpeg \
gedit-plugins \
gettext \
gstreamer0.10-ffmpeg \
gstreamer0.10-plugins-bad \
gstreamer0.10-plugins-ugly \
icedax \
lha \
lighttpd \
mysql-common \
mysql-client-5.0 \
ngrep \
nkf \
ntpdate \
openntpd \
openvpn \
postfix \
rsync \
ruby1.8 \
samba \
samba-common \
smbfs \
subversion \
svk \
telnetd \
tree \
thunderbird \
thunderbird-gnome-support \
unrar-free \
wine \
xinetd \
xpdf \
xpdf-japanese
~下の設定ファイル復元
退避しておいた以下の設定ファイル類を復元する。
.anthy/
.config/MonoDevelop/
.easytag/
.kde/
.icons/
.mono/
.mozilla/
.mozilla-thunderbird/
.ssh/
.subversion/
.themes/
/etc配下の設定ファイル編集
/etc/hosts
(ローカルネットワークのマシンを追加)
/etc/hosts.deny
ALL : ALL
/etc/hosts.allow
in.telnetd : 127.0.0.1 192.168.1.0/24
svnserve : 127.0.0.1 192.168.1.0/24
rsync : 127.0.0.1 192.168.1.0/24
/etc/ld.so.conf追記
/usr/local/lib
/etc/fstabにSamba共有ディレクトリのエントリを追加。 Ubuntu 7.04から8.04に移行する場合、7.04の設定のままではエラーメッセージが出る。 次のオプションを書き換える必要がある。
- fmask=xxx,dmask=yyy
- file_mode=0xxx,dir_mode=0yyyに書き換え
- codepage
- 削除
すべてマウント
sudo mount -a
~下の不要なディレクトリを削除する
「デスクトップ」を含めデフォルトで作成されるディレクトリの表記を英語にする。
LANG=C xdg-user-dirs-gtk-update
表示されるダイアログにしたがって変更すればOK。 変更したら、Desktop以外を削除する。 まず削除する前に、削除しても二度と作成させないようにする。
$ sudo vi /etc/xdg/user-dirs.conf
enabled=False # TrueからFalseに変更
Desktop以外を削除する。
rm -r Examples Documents Music Pictures Public Templates Videos
変更したらいったんログアウトしてGnomeを再起動する
マウントしたデバイスのアイコンを非表示にする
gconf-editorで/apps/nautilus/desktop/volumes_visibleのチェックをオフにする
Ctrl+Alt+Delでスクリーンのロックが起動するようにする
gconftool-2 -t str --set /apps/metacity/global_keybindings/run_command_9 "<Control><Alt>Delete"
gconftool-2 -t str --set /apps/metacity/keybinding_commands/command_9 "gnome-screensaver-command -l"
お気に入りのアプリを変更
- 「ウェブ・ブラウザ」をFirefoxに変更
- 「メール・クライアント」をThunderbirdに変更
外観の設定
Windows Vistaから「メイリオ」をコピーしてインストール、等幅フォントはArisaka 等幅をインストール
sudo cp miryo*.ttc /usr/share/fonts/truetype/
sudo cp ARISAKA*.ttf /usr/share/fonts/truetype/
sudo xset fp rehash
あとは適当にテーマ・アイコン等を変更。
- Art.gnome.org
-
GNOME-Look.org
- GDM EarthLights
- Control Moomex-Ultimatum
- Icon Crystal SVG
サーバ設定
ディレクトリ作成
sudo mkdir -p /srv/repos /srv/rsync /srv/www
sudo chmod a+w /srv/r* /srv/w*
/etc/xinetd.d/telnet
service telnet
{
disable = no
flags = REUSE
socket_type = stream
user = telnetd
wait = no
server = /usr/sbin/in.telnetd
server_args = -h
only_from = 192.168.1.0/24 127.0.0.1
log_on_failure += USERID
}
/etc/xinetd.d/svn
service svn
{
disable = no
socket_type = stream
user = root
wait = no
server = /usr/bin/svnserve
server_args = -i -r /srv/repos
only_from = 192.168.1.0/24 127.0.0.1
log_on_failure += USERID
}
/etc/xinetd.d/rsync
service rsync
{
disable = no
socket_type = stream
user = root
wait = no
server = /usr/bin/rsync
server_args = --daemon --config=/etc/rsyncd.conf
only_from = 192.168.1.0/24 127.0.0.1
log_on_failure += USERID
}
/etc/rsyncd.conf
hosts allow = 192.168.1.0/24 127.0.0.1
hosts deny = *
use chroot = yes
max connections = 1
[rsync]
comment = rsync root
path = /srv/rsync
uid = santamarta
gid = santamarta
read only = yes
xinetd再起動
/etc/init.d/xinetd restart
/etc/lighttpd/lighttpd.conf
# server.modulesに追加
"mod_cgi",
"mod_setenv",
# document-rootを変更
server.document-root = "/srv/www/"
# CGI設定追記
$HTTP["remoteip"] == "192.168.1.0/24" {
cgi.assign = (".pl" => "/usr/bin/perl")
cgi.assign += (".rb" => "/usr/bin/ruby")
}
else $HTTP["remoteip"] != "192.168.1.0/24" {
url.access-deny = ("")
}
# index.xhtml追加
index-file.names = ( "index.xhtml", "index.php", "index.html",
"index.htm", "default.htm",
"index.lighttpd.html" )
lighttpd再起動
/etc/init.d/lighttpd restart
Ruby
Ruby 1.8とRuby 1.9をインストールする場合、どちらか使用する方にリンクを張り替える。
sudo unlink /usr/bin/ruby
sudo ln -s /usr/bin/ruby1.9 /usr/bin/ruby
ruby -v