サーバー設定 · 2 min read · Feb 06, 2026
完璧なサーバー - Gentoo 2007.0 - ページ 4
7 ソフトウェアのインストール
オプションとして、コマンドラインでの作業をより快適にするためにいくつかのものをインストールできます。これは「完璧なセットアップ」に実質的な機能的違いをもたらしません。以前にchrootシステムにインストールした場合でも、vimをこの方法でインストールしてください。これにより、正しくインストールされます。
emerge --ask --verbose gentoolkit vimこれで、デフォルトのエディタを変更できます。nanoにしたくない場合は、
vi /etc/rc.confEDITORプロパティを希望の値に変更します。これは次回ログインする際に適用されます。今すぐにタイプすることもできます。
source /etc/rc.conf必要な開発ファイルのほとんどはすでに揃っており、他に必要なものはメインソフトウェアをインストールする際に取り込まれます。Gentooでは、他のディストリビューションで一般的に見られるパッケージとパッケージ-devバージョンの区別はありません。
emerge --ask --verbose expect fetchmail ncftp netkit-telnetd unzip zip8 管理者ユーザーの作成
システムを機能させるために厳密には必要ありませんが、他のディストリビューションの完璧なセットアップと標準化されます。administratorというユーザーを作成し、そのユーザーにsudoを使用できるようにします。
groupadd -g 1000 administrator
useradd --create-home --gid administrator --groups wheel --shell /bin/bash administrator
passwd administratorパスワードを入力し、次にsudoをインストールします。
emerge --ask --verbose sudowheelグループの誰でもsudoを使用できるように設定します。
visudoこの行のコメントを外します。
# %wheel ALL=(ALL) ALL次のようになります。
[...]
# Uncomment to allow people in group wheel to run all commands
%wheel ALL=(ALL) ALL
[...] 保存して終了します。
次に、必要に応じてrootのパスワードを削除できます。
passwd --delete root9 クォータ
9.1 カーネル設定
カーネルにクォータサポートとクォータファイル形式バージョン2が必要です。
標準のGentooカーネルにはクォータサポートがありません。このHowToに従って基本インストールを行った場合は、すでに設定済みで次のセクションに進むことができます。そうでない場合は、今すぐに行う必要があります。これらの手順はgenkernelユーザー向けです。他の方はおそらくすでに何をすべきか知っているでしょう。
genkernel --no-clean --no-mrproper --menuconfig allファイルシステムに移動し、クォータサポートを選択し、モジュールとしてではなくカーネルに組み込むように、クォータ形式v2サポートを選択します。


出るまで終了し、カーネル設定を保存し、その後ビルドが再開されます。
再起動します。
9.2 ユーザースペース設定
emerge --ask --verbose quota/etc/conf.d/quotaを編集し、QUOTACHECK_OPTSにmを追加します。私のは次のようになります。
# /etc/conf.d/quota: config file for /etc/init.d/quota
# Note: if your console is hooked up to a serial terminal,
# you prob want to drop the '-v' from the OPTS vars below.
# Run quotacheck ?
RUN_QUOTACHECK="yes"
# Options for quotacheck
QUOTACHECK_OPTS="-avugm"
# Options for quotaon
QUOTAON_OPTS="-avug"
# Options for quotaoff
QUOTAOFF_OPTS="-avug"/etc/fstabを編集します。私のは次のようになります(マウントポイント/のパーティションにusrquota,grpquotaを追加しました)。
# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed; notail increases performance of ReiserFS (at the expense of storage
# efficiency). It's safe to drop the noatime options if you want and to
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#
#
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/hda1 /boot ext2 noauto,noatime 1 2
/dev/hda3 / ext3 noatime,usrquota,grpquota 0 1
/dev/hda2 none swap sw 0 0
/dev/cdrom /mnt/cdrom audo noauto,ro 0 0
#/dev/fd0 /mnt/floppy auto noauto 0 0
# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
# use almost no memory if not populated with files)
shm /dev/shm tmpfs nodev,nosuid,noexec 0 0 クォータシステムを開始します。
mount -o remount /
/etc/init.d/quota start
rc-update add quota boot10 DNSサーバー
実行します。
echo "net-dns/bind resolvconf" >> /etc/portage/package.use
emerge --ask --verbose bindセキュリティ上の理由から、BINDをchroot環境で実行したいので、次の手順を実行します。
emerge --config bind
echo alias rndc='rndc -k /chroot/dns/etc/bind/rndc.key' >> ~/.bash_profile
source ~/.bash_profile
rm --recursive --force /etc/bind
ln --symbolic /chroot/dns/etc/bind /etc/bindBINDのログを含むようにログデーモンを設定する必要はありません。すでに設定されています。
それでは、起動します。
/etc/init.d/named start
rc-update add named default11 MySQL
GentooのデフォルトのUSEフラグにより、MySQLはすべてのデフォルトでUTF-8文字セットが選択されてインストールされます。ISPConfigをインストールする場合は、次の行を入力する必要があります。さもなければ、ISPConfigのWebインターフェースは機能しません。
echo "dev-db/mysql latin1" >> /etc/portage/package.use個々のデータベースは、UTF-8などの他のエンコーディングを使用することもできます。
実行します。
emerge --ask --verbose mysqlしばらく時間がかかります。その後、完了したら、
emerge --config dev-db/mysql
データベースのために設定したいrootパスワードを入力し、完了させます。

MySQLがlocalhostだけでなくすべてのインターフェースでリッスンするようにするには、/etc/mysql/my.cnfを編集し、bind-address = 127.0.0.1の行をコメントアウトします。
MySQLを開始します。
/etc/init.d/mysql start
rc-update add mysql default新しい投稿を受信箱で受け取る
スパムはありません。いつでも購読を解除できます。