colinux 上の Fedora7 に Apache をインストールする

オライリーの「CGIプログラミング」で Apache が必要になったのでインストールした。インストール手順をメモしておく。


Apache が既にインストールされているか確認

% yum list installed | grep httpd


インストールされていなかったので、yum で入れる

% sudo yum install httpd


試しに起動してみると、なんか文句を言われるけど起動する。

% sudo /etc/init.d/httpd start
httpd を起動中: httpd: apr_sockaddr_info_get() failed for colinux
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
                                                           [  OK  ]


このメッセージは、「/etc/httpd/conf/httpd.conf」の「ServerName」を与えてやると出なくなる。

% sudo emacs /etc/httpd/conf/httpd.conf

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If this is not set to valid DNS name for your host, server-generated
# redirections will not work.  See also the UseCanonicalName directive.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
#
#ServerName www.example.com:80
ServerName colinux:80

colinux の部分はホスト名を指定すればよい。自分は「C:\WINNT\system32\drivers\etc\hosts」で「192.168.0.2 colinux」としているので、IPアドレスの代わりにホスト名を使った。


試しに、適当なブラウザで「http://colinux/」にアクセスしてみるとテストページが表示される。


細かい設定は後でやることにする。