LoginSignup
0
1

More than 1 year has passed since last update.

1-2_OracleVM VirtualBox_CentOSホスト名変更、Bind・Apacheインストール

Last updated at Posted at 2022-03-25

1. CentOSホスト名変更

teratermからCentOSにログインし、下記コマンドでホスト名を確認する。

$ hostname
localhost.localdomain

スーパーユーザになり、下記コマンドでホスト名を変更する。

$ su -
# hostnamectl set-hostname testlinux
# hostname
testlinux

プロンプトはlocalhostのままだが、ログインし直すことで修正後のホスト名になる。

2. Bindインストール

今回はyumコマンドを使用。
下記コマンドでbindをインストールし、yでインストールを進めていく。

# yum install bind
読み込んだプラグイン:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: ftp.tsukuba.wide.ad.jp
 * extras: ftp.tsukuba.wide.ad.jp
 * updates: ftp.tsukuba.wide.ad.jp
base                                                     | 3.6 kB     00:00     
extras                                                   | 2.9 kB     00:00     
updates                                                  | 2.9 kB     00:00     
~
依存性の解決をしています
~
--> 依存性解決を終了しました。

依存性を解決しました

=====================================================================================================================================
 Package                          アーキテクチャー         バージョン                                リポジトリー               容量
=====================================================================================================================================
インストール中:
 bind                             x86_64                   32:9.11.4-26.P2.el7_9.9                   updates                   2.3 M
依存性関連での更新をします:
 bind-libs                        x86_64                   32:9.11.4-26.P2.el7_9.9                   updates                   157 k
 bind-libs-lite                   x86_64                   32:9.11.4-26.P2.el7_9.9                   updates                   1.1 M
 bind-license                     noarch                   32:9.11.4-26.P2.el7_9.9                   updates                    91 k
 bind-utils                       x86_64                   32:9.11.4-26.P2.el7_9.9                   updates                   261 k

トランザクションの要約
=====================================================================================================================================
インストール  1 パッケージ
更新                       ( 4 個の依存関係のパッケージ)

合計容量: 3.9 M
総ダウンロード容量: 2.3 M
Is this ok [y/d/N]: y
Downloading packages:
~
上記の処理を行います。よろしいでしょうか? [y/N]y
~
インストール:
  bind.x86_64 32:9.11.4-26.P2.el7_9.9                                                                                                

依存性を更新しました:
  bind-libs.x86_64 32:9.11.4-26.P2.el7_9.9                         bind-libs-lite.x86_64 32:9.11.4-26.P2.el7_9.9                     
  bind-license.noarch 32:9.11.4-26.P2.el7_9.9                      bind-utils.x86_64 32:9.11.4-26.P2.el7_9.9                         

完了しました!

下記のパッケージ管理コマンドでインストールされたを確認する。

[root@localhost ~]# rpm -qa | grep bind
bind-9.11.4-26.P2.el7_9.9.x86_64
rpcbind-0.2.0-49.el7.x86_64
bind-license-9.11.4-26.P2.el7_9.9.noarch
bind-utils-9.11.4-26.P2.el7_9.9.x86_64
bind-export-libs-9.11.4-26.P2.el7.x86_64
bind-libs-lite-9.11.4-26.P2.el7_9.9.x86_64
bind-libs-9.11.4-26.P2.el7_9.9.x86_64
keybinder3-0.3.0-1.el7.x86_64

※上記コマンドでできなかった場合は下記
yum install bind bind-chroot bind-utils

2. Apacheインストール

下記コマンドでApacheをインストールする。

# yum install httpd
読み込んだプラグイン:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: ftp.tsukuba.wide.ad.jp
 * extras: ftp.tsukuba.wide.ad.jp
 * updates: ftp.tsukuba.wide.ad.jp
依存性の解決をしています
--> トランザクションの確認を実行しています。
~
--> 依存性解決を終了しました。

依存性を解決しました

=====================================================================================================================================
 Package                        アーキテクチャー          バージョン                                リポジトリー                容量
=====================================================================================================================================
インストール中:
 httpd                          x86_64                    2.4.6-97.el7.centos.4                     updates                    2.7 M
依存性関連でのインストールをします:
 apr                            x86_64                    1.4.8-7.el7                               base                       104 k
 apr-util                       x86_64                    1.5.2-6.el7                               base                        92 k
 httpd-tools                    x86_64                    2.4.6-97.el7.centos.4                     updates                     94 k
 mailcap                        noarch                    2.1.41-2.el7                              base                        31 k

トランザクションの要約
=====================================================================================================================================
インストール  1 パッケージ (+4 個の依存関係のパッケージ)

総ダウンロード容量: 3.0 M
インストール容量: 10 M
Is this ok [y/d/N]: y
Downloading packages:
~
インストール:
  httpd.x86_64 0:2.4.6-97.el7.centos.4                                                                                               

依存性関連をインストールしました:
  apr.x86_64 0:1.4.8-7.el7  apr-util.x86_64 0:1.5.2-6.el7  httpd-tools.x86_64 0:2.4.6-97.el7.centos.4  mailcap.noarch 0:2.1.41-2.el7 

完了しました!

下記コマンドでインストール完了の確認を行う。

# rpm -qa | grep httpd
httpd-2.4.6-97.el7.centos.4.x86_64
httpd-tools-2.4.6-97.el7.centos.4.x86_64
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1