
CentOS 7x にyumでApacheをインストールする方法です。
CentOSのバージョン確認
# cat /etc/redhat-release CentOS Linux release 7.0.1406 (Core)
yumでApacheをインストール
# yum -y install httpd 読み込んだプラグイン:fastestmirror base | 3.6 kB 00:00:00 extras | 2.9 kB 00:00:00 updates | 2.9 kB 00:00:00 vz-base | 951 B 00:00:00 vz-updates | 951 B 00:00:00 (1/4): base/7/x86_64/group_gz | 165 kB 00:00:00 (2/4): extras/7/x86_64/primary_db | 159 kB 00:00:00 (3/4): base/7/x86_64/primary_db | 6.0 MB 00:00:01 (4/4): updates/7/x86_64/primary_db | 6.7 MB 00:00:04 (1/2): vz-base/primary | 723 B 00:00:00 (2/2): vz-updates/primary | 1.0 kB 00:00:00 Determining fastest mirrors * base: mirrors.cat.net * extras: mirrors.cat.net * updates: mirrors.cat.net vz-base 1/1 vz-updates 4/4 依存性の解決をしています --> トランザクションの確認を実行しています。 ---> パッケージ httpd.x86_64 0:2.4.6-90.el7.centos を インストール --> 依存性の処理をしています: httpd-tools = 2.4.6-90.el7.centos のパッケージ: httpd-2.4.6-90.el7.centos.x86_64 --> 依存性の処理をしています: system-logos >= 7.92.1-1 のパッケージ: httpd-2.4.6-90.el7.centos.x86_64 --> 依存性の処理をしています: /etc/mime.types のパッケージ: httpd-2.4.6-90.el7.centos.x86_64 --> 依存性の処理をしています: libaprutil-1.so.0()(64bit) のパッケージ: httpd-2.4.6-90.el7.centos.x86_64 --> 依存性の処理をしています: libapr-1.so.0()(64bit) のパッケージ: httpd-2.4.6-90.el7.centos.x86_64 --> トランザクションの確認を実行しています。 ---> パッケージ apr.x86_64 0:1.4.8-5.el7 を インストール ---> パッケージ apr-util.x86_64 0:1.5.2-6.el7 を インストール ---> パッケージ centos-logos.noarch 0:70.0.6-3.el7.centos を インストール ---> パッケージ httpd-tools.x86_64 0:2.4.6-90.el7.centos を インストール ---> パッケージ mailcap.noarch 0:2.1.41-2.el7 を インストール --> 依存性解決を終了しました。 依存性を解決しました =================================================================================================== Package アーキテクチャー バージョン リポジトリー 容量 =================================================================================================== インストール中: httpd x86_64 2.4.6-90.el7.centos base 2.7 M 依存性関連でのインストールをします: apr x86_64 1.4.8-5.el7 base 103 k apr-util x86_64 1.5.2-6.el7 base 92 k centos-logos noarch 70.0.6-3.el7.centos base 21 M httpd-tools x86_64 2.4.6-90.el7.centos base 91 k mailcap noarch 2.1.41-2.el7 base 31 k トランザクションの要約 =================================================================================================== インストール 1 パッケージ (+5 個の依存関係のパッケージ) 総ダウンロード容量: 24 M インストール容量: 31 M Downloading packages: (1/6): apr-1.4.8-5.el7.x86_64.rpm | 103 kB 00:00:00 (2/6): apr-util-1.5.2-6.el7.x86_64.rpm | 92 kB 00:00:00 (3/6): httpd-tools-2.4.6-90.el7.centos.x86_64.rpm | 91 kB 00:00:00 (4/6): mailcap-2.1.41-2.el7.noarch.rpm | 31 kB 00:00:00 (5/6): httpd-2.4.6-90.el7.centos.x86_64.rpm | 2.7 MB 00:00:00 (6/6): centos-logos-70.0.6-3.el7.centos.noarch.rpm | 21 MB 00:00:11 --------------------------------------------------------------------------------------------------- 合計 2.2 MB/s | 24 MB 00:00:11 Running transaction check Running transaction test Transaction test succeeded Running transaction インストール中 : apr-1.4.8-5.el7.x86_64 1/6 インストール中 : apr-util-1.5.2-6.el7.x86_64 2/6 インストール中 : httpd-tools-2.4.6-90.el7.centos.x86_64 3/6 インストール中 : centos-logos-70.0.6-3.el7.centos.noarch 4/6 インストール中 : mailcap-2.1.41-2.el7.noarch 5/6 インストール中 : httpd-2.4.6-90.el7.centos.x86_64 6/6 検証中 : mailcap-2.1.41-2.el7.noarch 1/6 検証中 : httpd-tools-2.4.6-90.el7.centos.x86_64 2/6 検証中 : apr-util-1.5.2-6.el7.x86_64 3/6 検証中 : httpd-2.4.6-90.el7.centos.x86_64 4/6 検証中 : apr-1.4.8-5.el7.x86_64 5/6 検証中 : centos-logos-70.0.6-3.el7.centos.noarch 6/6 インストール: httpd.x86_64 0:2.4.6-90.el7.centos 依存性関連をインストールしました: apr.x86_64 0:1.4.8-5.el7 apr-util.x86_64 0:1.5.2-6.el7 centos-logos.noarch 0:70.0.6-3.el7.centos httpd-tools.x86_64 0:2.4.6-90.el7.centos mailcap.noarch 0:2.1.41-2.el7 完了しました!
Apacheのバージョン確認
# httpd -v Server version: Apache/2.4.6 (CentOS)