Table of Contents
ホスト名設定
- hostnamectl コマンドで設定する。
# hostnamectl set-hostname <ホスト名>
ネットワーク設定
- nmtui/nmcli コマンドで設定する。
- デバイス確認
# nmcli dev
- デバイス詳細確認
# nmcli dev show <デバイス名>
- 接続確認
# nmcli con
- 接続詳細確認
# nmcli con show <接続名>
パッケージ管理システム更新
- インストール
# yum -y update # yum -y install yum-cron
- /etc/yum/yum-cron.conf
#apply_updates = no apply_updates = yes
- サービス起動 & 自動起動サービス登録
# systemctl start yum-cron # systemctl enable yum-cron
リポジトリ追加
EPEL の追加。
libmp4v2(mp4tags)# yum install epel-release
Software Collections
https://wiki.centos.org/SpecialInterestGroup/SCLo
プライオリティ=10 に設定# yum install centos-release-scl centos-release-scl-rh # sed -i -e "s/\]$/\]\npriority=10/g" /etc/yum.repos.d/CentOS-SCLo-scl.repo # sed -i -e "s/\]$/\]\npriority=10/g" /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
Nux Dextop
デスクトップおよびマルチメディア関連のリポジトリ。ffmpeg, rtmpdump, phantomjs。# rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro # rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
グループインストール
- 使用可能なグループ一覧
LANG=en_US.UTF-8 下で行うと英語表記のグループ名が得られる。
非表示のグループも表示させるには hidden オプションを追加する。# yum grouplist [hidden]
- グループ名(抜粋, CentOS 7.7) | 英語 | 日本語 | | --- | --- | | Infrastructure Server | インフラストラクチャサーバー | | Basic Web Server | ベーシック Web サーバー | | File and Print Server | ファイルとプリントサーバー | | Virtualization Host | 仮想化ホスト | | Server with GUI | サーバー (GUI 使用) | | GNOME Desktop | GNOME Desktop | | Desktop | デスクトップ | | Desktop Platform | デスクトップ環境 | | Desktop Platform Development | デスクトップ環境の開発環境 | | Virtualization | 仮想化 | | Development Tools | 開発ツール | | Fonts | フォント | | Input Methods | 入力メソッド |
- インストール
# yum groupinstall "GNOME Desktop" "Server with GUI" "File and Print Server"
その他のインストール
# yum install mailx logwatch setroubleshoot-server
時刻同期設定
- インストール
# yum install chrony
- /etc/chrony.conf
(既存の server 行はコメントアウト) server ntp.nict.jp iburst server ntp.jst.mfeed.ad.jp iburst #allow 192.168/16 allow 192.168/16
- サービス起動 & 自動起動サービス登録
# systemctl start chronyd # systemctl enable chronyd
root 宛てメール転送
- /etc/aliases に root の転送先メールアドレスを追加。
root: Actual.User@example.com
- 転送設定反映。
# newaliases
- 転送テスト
# date | mail -s "root メール転送テスト" root
Apache
# yum install httpd
# systemctl start httpd
# systemctl enable httpd
# systemctl is-enabled httpd
- firewall 設定
# firewall-cmd --get-active-zones (現在のゾーンの確認) # firewall-cmd --permanent --zone=public --add-service=http (active なゾーンに合わせること) # firewall-cmd --reload
起動メッセージ表示
- /etc/default/grub
「rhgb quiet」を削除。#GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap crashkernel=auto rhgb quiet" GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap crashkernel=auto"
- grub.cfg を更新。
# grub2-mkconfig -o /boot/grub2/grub.cfg
CUI/GUI 切り替え
- 現在の設定の確認
# systemctl get-default
- CUI で起動 (runlevel 3 相当)
# systemctl set-default multi-user.target
- GUI で起動 (runlevel 5 相当)
# systemctl set-default graphical.target
日本語入力 (かな漢字変換)
- 「アプリケーション - システムツール - 設定 - 地域と言語 - 入力ソース」で「日本語」「日本語 (かな漢字)」の2つを選択する。
- 「日本語 (かな漢字)」だけにするとキーボードが英語配列になる? (iBus かな漢字 1.5.18)
ファイアウォール設定
ファイアウォール動作状況確認
# systemctl status firewalld
ファイアウォール再起動
# systemctl restart firewalld
デフォルトゾーン確認
# firewall-cmd --list-all
定義されているサービス一覧の表示
# firewall-cmd --get-services
デフォルトゾーンで許可されているサービスの確認
# firewall-cmd --list-service
サービスの追加(samba)
firewalld を再起動/設定反映するまで反映されない。# firewall-cmd --add-service=samba --permanent
デフォルトゾーンで許可されているポートの確認
# firewall-cmd --list-port
ポートの追加
firewalld を再起動/設定反映するまで反映されない。# firewall-cmd --add-port=30001/tcp --permanent
設定反映
# firewall-cmd --reload