Ubuntu18.04 LTS¶
はじめに¶
Note
初期ログインユーザは「ubuntu」となります。rootではログインできませんのでご注意ください。
OS基本設定¶
Ubuntu18.04 LTS のインストール内容につきましては下記の通りとなります。
パーティション¶
| パーティション番号 | マウントポイント | パーティション名 | フォーマット | 容量 | 
|---|---|---|---|---|
| 1 | ‐ | /dev/vda1 | bios_grubフラグ(EF02) | 1024KB | 
| 2 | swap | /dev/vda2 | tmpfs(8200) | 4 GB(各プラン共通) | 
| 3 | / | /dev/vda3 | ext4(8300) | vdaの残り(各プラン共通) | 
| – | /data (※1) | /dev/vdb1 | ext4 | 1Gプラン : 30 GB 1.5Gプラン : 80 GB 4Gプラン : 180 GB 8Gプラン : 380 GB | 
ブートローダ¶
OS起動に関する変更¶
コンソール表示に関する変更¶
その他の変更¶
| ブートローダ | GRUB2(OS標準) | 
|---|
| 設定ファイル | /etc/default/grub | 
|---|---|
| 設定内容 | GRUB_DEFAULT=0 GRUB_TIMEOUT_STYLE=hidden GRUB_TIMEOUT=0 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_TERMINAL=serial GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" GRUB_CMDLINE_LINUX_DEFAULT="noresume nomodeset consoleblank=0 elevator=noop console=tty0 console=ttyS0,115200n8" | 
ホスト名設定¶
| 設定ファイル | /etc/hostname | 
|---|---|
| 設定値 | ご契約の<仮想サーバホスト名> | 
| 設定ファイル | /etc/hosts | 
|---|---|
| 設定内容 | 127.0.0.1 localhost 127.0.1.1 <仮想サーバホスト名.ドメイン名> <仮想サーバホスト名> ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters | 
IPアドレスの設定¶
Ubuntu18.04 では Ubuntu16.04 で採用されていた /etc/network/interfaces を編集する手法から、netplan を用いた方法に変更されています。
| 設定ファイル | /etc/netplan/01-netcfg.yaml | 
|---|---|
| 設定内容 | サーバ固有のグローバルIPv4アドレス 1つ を設定(※) network: version: 2 renderer: networkd ethernets: ens3: addresses: [XXX.XXX.XXX.XXX/XX] gateway4: XXX.XXX.XXX.X nameservers: addresses: [210.188.224.10,210.188.224.11] | 
注意
※ ens3 に設定するIPアドレスの変更や追加は行わないでください。
TSOの無効化設定¶
ネットワークパフォーマンスの最適化を行います。
| 設定ファイル | /etc/udev/rules.d/50-eth_tso.rules | 
|---|---|
| 設定内容 | ACTION=="add", SUBSYSTEM=="net", KERNEL=="eth*", RUN+="/sbin/ethtool -K %k tso off"ACTION=="add", SUBSYSTEM=="net", KERNEL=="ens*", RUN+="/sbin/ethtool -K %k tso off" | 
リゾルバの設定¶
| 設定ファイル | /etc/netplan/01-netcfg.yaml | 
|---|---|
| 設定内容 | nameservers: addresses:[ 210.188.224.10, 210.188.224.11 ] または nameservers: addresses: [ 210.224.163.3, 210.224.163.4 ] または nameservers: addresses: [ 133.242.0.3, 133.242.0.4 ] | 
時刻同期の設定¶
| 設定ファイル | /etc/ntp.conf | 
|---|---|
| 設定内容 | driftfile /var/lib/ntp/ntp.drift leapfile /usr/share/zoneinfo/leap-seconds.list statistics loopstats peerstats clockstats filegen loopstats file loopstats type day enable filegen peerstats file peerstats type day enable filegen clockstats file clockstats type day enable server ntp1.sakura.ad.jp iburst restrict -4 default ignore restrict ntp1.sakura.ad.jp kod notrap nomodify nopeer noquery limited restrict 127.0.0.1 restrict source notrap nomodify noquery | 
| 設定ファイル | /etc/default/ntp | 
|---|---|
| 設定内容 | NTPD_OPTS=’-4 -g’ | 
追加インストールパッケージ¶
| Package | ncurses-term openssh-server ntp anacron acpid ethtool | 
|---|
cron設定¶
定期実行における実行時間(※1)をランダムに変更します。
| 設定ファイル | /etc/crontab | 
|---|---|
| 設定内容 | ※1  *  * * *   root    cd / && run-parts --report /etc/cron.hourly ※1  X  * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) ※1  X  * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) ※1  X  1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) | 
アプリケーション設定¶
表記の各アプリケーションの基本バージョンは、ディストリビューションによって今後アップデートされる場合があります。
Ubuntu18.04 LTS FAQ¶
日本語環境を使用する¶
LANG=”ja_JP.UTF-8″ としてください。$ sudo apt update
$ sudo apt -y install language-pack-ja language-pack-ja-base ibus-mozc
$ sudo localectl set-locale LANG=ja_JP.UTF-8 LANGUAGE="ja_JP:ja"
初期状態¶
$ localectl
System Locale: LANG=en_US.UTF-8
               LANGUAGE=en_US:en
 VC Keymap: n/a
X11 Layout: jp
変更後¶
$ localectl
System Locale: LANG=ja_JP.UTF-8
               LANGUAGE=ja_JP:ja
 VC Keymap: n/a
X11 Layout: jp