ubuntu:apache

文書の過去の版を表示しています。


Apache

ここは「Apache」のページです。Apache の設定について書いています。 前提として環境は Ubuntu Server 24.04 LTS になります。

インストールは簡単です。apt コマンドでインストールできます。

apt install apache2 

まずは、最低限の設定を行います。複数の設定ファイルを修正します。

/etc/apache2/apache2.conf のファイルの最後に、以下のパラメーターを追加。

ServerName www.example.com 

/etc/apache2/conf-enabled/security.conf は、以下のパラメーターがあるので値を次のように変更します。

ServerTokens Prod
ServerSignature Off

次はディレクトリ指定でアクセスした際に、どのファイルを表示するかです。 /etc/apache2/mods-enabled/dir.conf の DirectoryIndex に値をセットします。 デフォルトで入っていると思いますが、自分は次のようにしました。

DirectoryIndex index.html

そのほか、サーバー管理者の設定です。 /etc/apache2/sites-enabled/000-default.conf の ServerAdmin パラメーターにメールアドレスが設定できます。

ServerAdmin www@example.com
  • ubuntu/apache.1780834704.txt.gz
  • 最終更新: 2026/06/07 21:18
  • by hermit