自宅サーバー Fedora (Home) » Debian GNU/Linux » Apache で Web サーバー構築 »  Apache HTTP Server 2.0 の設定

Apache HTTP Server 2.0 の設定

Apache をインストールするとデフォルトの設定ファイル httpd.conf が作成されます。
Apache の設定はこの httpd.conf ファイルを使って行います。
ここでは Apache を起動するための最低限の設定を行います。

Apache の基本的な設定

Apache の設定は /usr/local/httpd/conf/httpd.conf を使って行います。
設定ファイルを編集して ServerAdmin ディレクティブと ServerName ディレクティブの設定を行います。

# vi /usr/local/httpd/conf/httpd.conf
/usr/local/httpd/conf/httpd.conf ファイルの 278 行目辺り
#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.  e.g. admin@your-domain.com
#
ServerAdmin webmaster@debianj.comサーバー管理者のメールアドレス

#
# 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 server.debianj.com:80ホスト名とポート番号
— 以下省略 —

httpd.conf の書式チェック

apachectl 制御スクリプト を使って Apache の設定ファイル httpd.conf の書式チェックを行うことができます。

# /usr/local/httpd/bin/apachectl configtest
Syntax OK
カテゴリー
  • Fedora のインストール (24)
  • OpenSSH で SSH サーバー構築 (4)
  • NTP で時刻情報サーバー構築 (4)
  • Apache HTTP Server で Web サーバー構築 (32)
  • MySQL でデーターベースサーバー構築 (10)
  • PostgreSQL でデーターベースサーバー構築 (22)
  • PHP で Web アプリケーションサーバー構築 (4)
  • qmail でメールサーバー構築 (7)
  • Tomcat で Web アプリケーションサーバー構築 (3)
  • Samba でファイルサーバー構築 (3)
  • BIND でネームサーバー構築 (3)
  • ProFTPD で FTP サーバー構築 (5)
  • snort でネットワーク進入探知システム構築 (3)
  • CMS でサイト構築 (3)
  • ネットワーク設定 (3)
  • システム設定 (4)
  • ライブラリのインストール (8)
  • Debian GNU/Linux (26)
  • Ubuntu (17)
  • メモ (6)
  • このサイトについて (4)
  • 相互リンク (6)