Ubuntu 8.04 Hardy Heronの初期設定メモ。 ハードディスクへのインストール後に設定したことなどの自分用メモ。 Ubuntu 7.04 Feisty Fawnからのアップグレードではなく、バックアップを取ったあとパーティションを再作成してクリーンインストールした。
IPアドレス指定でホスト名・ドメイン名で変更した場合、sudo出来なくなる場合がある。 対処法:Ubuntu日本語フォーラム / Hardyにしたら端末でsudoできない
設定が終わったら「再読込」でパッケージ情報を更新、アップデート・マネージャで念のため更新チェックする。
一切無効にする。
ここまででいったん再起動。 再起動後に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/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の設定のままではエラーメッセージが出る。 次のオプションを書き換える必要がある。
すべてマウント
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のチェックをオフにする
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"
Windows Vistaから「メイリオ」をコピーしてインストール、等幅フォントはArisaka 等幅をインストール
sudo cp miryo*.ttc /usr/share/fonts/truetype/ sudo cp ARISAKA*.ttf /usr/share/fonts/truetype/ sudo xset fp rehash
あとは適当にテーマ・アイコン等を変更。
ディレクトリ作成
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 1.8とRuby 1.9をインストールする場合、どちらか使用する方にリンクを張り替える。
sudo unlink /usr/bin/ruby sudo ln -s /usr/bin/ruby1.9 /usr/bin/ruby ruby -v