Akio's Log

ソフトウェア開発、プロジェクトマネジメント、プログラミング、ランニングなどなど

CentOS5.0のApacheインストール

久々のブログ。クライアントがお盆休みなので、今週一杯は仕事の余裕が出来たから、放置気味だったVMWare上のCentOSサーバの構築の続きをやろうかな。


現在は、最低限のパッケージしか導入していないし、最初にやろうとしていた事もほとんど実現できていないので、ぼちぼちとアプリケーションをインストールしてみる。

まずはWebサーバ関連。これはyumでインストール。

yumを「grouplist」オプションで実行

[root@xxxxxx ~]# yum grouplist
Loading "installonlyn" plugin
Loading "fastestmirror" plugin
Setting up Group Process
Setting up repositories
Loading mirror speeds from cached hostfile
Installed Groups:
Editors
System Tools
Dialup Networking Support
Network Servers
Mail Server
Yum Utilities
Available Groups:
Office/Productivity
Engineering and Scientific
MySQL Database
Development Libraries
GNOME Software Development
Text-based Internet
X Software Development
Virtualization
Legacy Network Server
DNS Name Server
GNOME Desktop Environment
Authoring and Publishing
FTP Server
Games and Entertainment
XFCE-4.4
Legacy Software Development
Java
Java Development
Emacs
Legacy Software Support
X Window System
Graphics
Web Server
Ruby
Windows File Server
Printing Support
KDE Software Development
KDE (K Desktop Environment)
Server Configuration Tools
Horde
Sound and Video
PostgreSQL Database
Administration Tools
News Server
Development Tools
FreeNX and NX
Graphical Internet
Done

「Web Server」が該当しそうだ。「groupinfo」オプションで内容の確認をする。

[root@xxxxxx ~]# yum groupinfo "Web Server"
Loading "installonlyn" plugin
Loading "fastestmirror" plugin
Setting up Group Process
Setting up repositories
Loading mirror speeds from cached hostfile

Group: Web Server
Description: These tools allow you to run a Web server on the system.
Mandatory Packages:
httpd
Default Packages:
tux
mod_python
mod_ssl
distcache
webalizer
php-ldap
squid
mod_perl
crypto-utils
httpd-manual
php
Optional Packages:
php-odbc
tomcat5-admin-webapps
php-pear
mod_auth_kerb
httpd-suexec
tomcat5-webapps
mod_nss
mod_auth_pgsql
mod_auth_mysql
mod_authz_ldap
tomcat5
php-mysql
php-pgsql

PHPとかPythonなんかは、今のところ必要なさそうだけども、とりあえずインストールしてしまいましょう。

こちらもyumの「groupinstall」オプションでまとめてインストール。

[root@xxxxxx ~]# yum -y groupinstall "Web Server"
Loading "installonlyn" plugin
Loading "fastestmirror" plugin
Setting up Group Process
Setting up repositories
Loading mirror speeds from cached hostfile
Setting up repositories
Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
Resolving Dependencies

    • > Populating transaction set with selected packages. Please wait.
      • > Package mod_python.i386 0:3.2.8-3.1 set to be updated
      • > Package distcache.i386 0:1.4.5-14.1 set to be updated
      • > Package httpd.i386 0:2.2.3-7.el5.centos set to be updated
      • > Package mod_perl.i386 0:2.0.2-6.3.el5 set to be updated
      • > Package php-ldap.i386 0:5.1.6-12.el5 set to be updated
      • > Package webalizer.i386 0:2.01_10-30.1 set to be updated
      • > Package httpd-manual.i386 0:2.2.3-7.el5.centos set to be updated
      • > Package tux.i386 0:3.2.18-9.fc6 set to be updated
      • > Package php.i386 0:5.1.6-12.el5 set to be updated
      • > Package mod_ssl.i386 1:2.2.3-7.el5.centos set to be updated
      • > Package squid.i386 7:2.6.STABLE6-4.el5 set to be updated
    • > Running transaction check
    • > Processing Dependency: perl(BSD::Resource) for package: mod_perl
    • > Processing Dependency: libgd.so.2 for package: webalizer
    • > Processing Dependency: php-common = 5.1.6-12.el5 for package: php
    • > Processing Dependency: php-cli = 5.1.6-12.el5 for package: php
    • > Processing Dependency: php-common = 5.1.6-12.el5 for package: php-ldap
    • > Restarting Dependency Resolution with new changes.
    • > Populating transaction set with selected packages. Please wait.
      • > Package gd.i386 0:2.0.33-9.3.fc6 set to be updated
      • > Package perl-BSD-Resource.i386 0:1.28-1.fc6.1 set to be updated
      • > Package php-common.i386 0:5.1.6-12.el5 set to be updated
      • > Package php-cli.i386 0:5.1.6-12.el5 set to be updated
    • > Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
distcache i386 1.4.5-14.1 base 119 k
httpd i386 2.2.3-7.el5.centos updates 1.1 M
httpd-manual i386 2.2.3-7.el5.centos updates 831 k
mod_perl i386 2.0.2-6.3.el5 updates 4.0 M
mod_python i386 3.2.8-3.1 base 257 k
mod_ssl i386 1:2.2.3-7.el5.centos updates 84 k
php i386 5.1.6-12.el5 updates 1.2 M
php-ldap i386 5.1.6-12.el5 updates 32 k
squid i386 7:2.6.STABLE6-4.el5 updates 1.2 M
tux i386 3.2.18-9.fc6 base 79 k
webalizer i386 2.01_10-30.1 base 105 k
Installing for dependencies:
gd i386 2.0.33-9.3.fc6 base 155 k
perl-BSD-Resource i386 1.28-1.fc6.1 base 29 k
php-cli i386 5.1.6-12.el5 updates 2.2 M
php-common i386 5.1.6-12.el5 updates 139 k

Transaction Summary
=============================================================================
Install 15 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 12 M
Downloading Packages:
(1/15): mod_python-3.2.8- 100% |=========================| 257 kB 00:00
(2/15): distcache-1.4.5-1 100% |=========================| 119 kB 00:00
(3/15): gd-2.0.33-9.3.fc6 100% |=========================| 155 kB 00:00
(4/15): httpd-2.2.3-7.el5 100% |=========================| 1.1 MB 00:00
(5/15): perl-BSD-Resource 100% |=========================| 29 kB 00:00
(6/15): php-common-5.1.6- 100% |=========================| 139 kB 00:00
(7/15): mod_perl-2.0.2-6. 100% |=========================| 4.0 MB 00:01
(8/15): php-ldap-5.1.6-12 100% |=========================| 32 kB 00:00
(9/15): webalizer-2.01_10 100% |=========================| 105 kB 00:00
(10/15): httpd-manual-2.2 100% |=========================| 831 kB 00:00
(11/15): tux-3.2.18-9.fc6 100% |=========================| 79 kB 00:00
(12/15): php-5.1.6-12.el5 100% |=========================| 1.2 MB 00:00
(13/15): php-cli-5.1.6-12 100% |=========================| 2.2 MB 00:00
(14/15): mod_ssl-2.2.3-7. 100% |=========================| 84 kB 00:00
(15/15): squid-2.6.STABLE 100% |=========================| 1.2 MB 00:00
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: httpd ####################### [ 1/15]
Installing: php-common ####################### [ 2/15]
Installing: php-cli ####################### [ 3/15]
Installing: perl-BSD-Resource ####################### [ 4/15]
Installing: gd ####################### [ 5/15]
Installing: distcache ####################### [ 6/15]
Installing: mod_python ####################### [ 7/15]
Installing: mod_perl ####################### [ 8/15]
Installing: php-ldap ####################### [ 9/15]
Installing: webalizer ####################### [10/15]
Installing: httpd-manual ####################### [11/15]
Installing: tux ####################### [12/15]
Installing: php ####################### [13/15]
Installing: mod_ssl ####################### [14/15]
Installing: squid ####################### [15/15]

Installed: distcache.i386 0:1.4.5-14.1 httpd.i386 0:2.2.3-7.el5.centos httpd-manual.i386 0:2.2.3-7.el5.centos mod_perl.i386 0:2.0.2-6.3.el5 mod_python.i386 0:3.2.8-3.1 mod_ssl.i386 1:2.2.3-7.el5.centos php.i386 0:5.1.6-12.el5 php-ldap.i386 0:5.1.6-12.el5 squid.i386 7:2.6.STABLE6-4.el5 tux.i386 0:3.2.18-9.fc6 webalizer.i386 0:2.01_10-30.1
Dependency Installed: gd.i386 0:2.0.33-9.3.fc6 perl-BSD-Resource.i386 0:1.28-1.fc6.1 php-cli.i386 0:5.1.6-12.el5 php-common.i386 0:5.1.6-12.el5
Complete!

以上でインストール終了。簡単すぎるなー。


では、さっそく確認。
httpdサービスを開始する。

[root@xxxxxx ~]# service httpd start
httpd を起動中: httpd: apr_sockaddr_info_get() failed for xxxxxx.yyy.co.jp
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]

ブラウザから開いてみたところ、「Apache2 Test Page」が表示され、無事Apacheは起動したようだが、気になるメッセージが表示されている。

ぐぐってみた。
http://www.google.co.jp/search?q=Could+not+reliably+determine+the+server's+fully+qualified+domain+name&sourceid=navclient-ff&ie=UTF-8&rlz=1B3GGGL_jaJP215JP216

これはホスト名を設定していないため出力されるメッセージです。ホスト名を指定しなくてもApacheは動作しますので、今は気にしないでください。Apacheの各種設定については第4回で解説する予定です。
「[ThinkIT] 第2回:Apacheをインストールしてみるのは難しくない (3/4):」
http://www.thinkit.co.jp/cert/article/0706/3/2/3.htm

との事。

ホスト名の設定はまだしていないし、気にしなくても良いとの事なので、次にhttpdをスタートアップ時に起動するように設定する。
chkconfigコマンドで設定。

[root@xxxxxx ~]# chkconfig --list httpd
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@xxxxxx ~]# chkconfig httpd on
[root@xxxxxx ~]# chkconfig --list httpd
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off

インストール自体はこんなもんでしょうか。後は各種設定などを実施します。