メール設定 · 1 min read · Jan 03, 2026
ISPConfig 3 サーバー (Debian Lenny) でのウェブサイト向け SquirrelMail の有効化
多くの人々が、ISPConfig 3 を通じて作成されたウェブサイトで SquirrelMail ウェブメールパッケージを使用する際に、404 Not Found エラーなどの問題を報告しています。「Perfect Server」ガイドに従って ISPConfig 3 を設定した場合、すでに SquirrelMail はインストールされていますが、同じ問題が発生している場合は、このガイドが役立ちます。このガイドでは、Debian Lenny サーバーで SquirrelMail を設定し、ISPConfig を通じて作成されたウェブサイトから使用できるようにする方法を説明します。
SquirrelMail の設定
SquirrelMail の Apache 設定は /etc/squirrelmail/apache.conf ファイルにありますが、このファイルは /etc/apache2/conf.d/ ディレクトリにないため、Apache に読み込まれません。したがって、/etc/apache2/conf.d/ ディレクトリに /etc/squirrelmail/apache.conf を指すシンボリックリンク squirrelmail.conf を作成し、その後 Apache を再読み込みします:
cd /etc/apache2/conf.d/
ln -s ../../squirrelmail/apache.conf squirrelmail.conf
/etc/init.d/apache2 reloadこれで完了です - /etc/apache2/conf.d/squirrelmail.conf は SquirrelMail のインストールディレクトリ /usr/share/squirrelmail を指すエイリアス /squirrelmail を定義します。
次に、ISPConfig のウェブサイトのオプションタブにある PHP open_basedir フィールドに、ディレクトリ /usr/share/squirrelmail と /etc/squirrelmail (SquirrelMail の設定が保存されているディレクトリ) を追加します。例えば、次のようにします:

ISPConfig がサイト設定を更新するまで、2、3 分待ちます。これで、次のようにウェブサイトから SquirrelMail にアクセスできるようになります:
http://www.example.com/squirrelmailISPConfig コントロールパネルの vhost からも次のようにアクセスできます (ISPConfig での設定は不要です):
http://server1.example.com:8080/squirrelmail/squirrelmail の代わりに /webmail のエイリアスを使用したい場合は、/etc/apache2/conf.d/squirrelmail.conf を開きます…
vi /etc/apache2/conf.d/squirrelmail.conf… そして次の行を追加します: Alias /webmail /usr/share/squirrelmail:
Alias /squirrelmail /usr/share/squirrelmail
Alias /webmail /usr/share/squirrelmail
Options Indexes FollowSymLinks
php_flag register_globals off
php_flag register_globals off
DirectoryIndex index.php
# configtest へのアクセスは情報漏洩を防ぐためにデフォルトで制限されています
order deny,allow
deny from all
allow from 127.0.0.1
# ユーザーは http://webmail.example.com のようなシンプルな URL を好むでしょう
#
# DocumentRoot /usr/share/squirrelmail
# ServerName webmail.example.com
#
# 利用可能な場合は https にリダイレクトします (thanks [email protected])
#
# 注意: これを行う方法はいくつかあり、どれが適切かは
# サイトの設定によります。確信がない場合は、apache のドキュメントを参照してください。
# この例はどこでも機能するわけではありません。
#
#
#
#
# RewriteEngine on
# RewriteCond %{HTTPS} !^on$ [NC]
# RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI} [L]
#
#
# その後、Apache を再読み込みします:
service apache2 reloadこれで、次のように SquirrelMail にアクセスできるようになります:
http://www.example.com/webmail
http://server1.example.com:8080/webmailユーザーが SquirrelMail にアクセスできる webmail.example.com のような vhost を定義したい場合は、次の vhost 設定を /etc/apache2/conf.d/squirrelmail.conf に追加する必要があります:
nano /etc/apache2/conf.d/squirrelmail.conf[...]
DocumentRoot /usr/share/squirrelmail
ServerName webmail.example.com
1.2.3.4 をサーバーの正しい IP アドレスに置き換えることを忘れないでください。もちろん、webmail.example.com に対する DNS レコードが、vhost 設定で使用する IP アドレスを指している必要があります。また、ISPConfig に webmail.example.com の vhost が存在しないことを確認してください (そうしないと、両方の vhost が干渉します)。
その後、Apache を再読み込みします…
service apache2 reload… そして http://webmail.example.com で SquirrelMail にアクセスできます!
リンク
- SquirrelMail: http://squirrelmail.org/
- The Perfect Server – Debian Lenny (Debian 5.0) With MyDNS & Courier [ISPConfig 3]: https://www.howtoforge.com/perfect-server-debian-lenny-ispconfig3
- The Perfect Server – Debian Lenny (Debian 5.0) With BIND & Dovecot [ISPConfig 3]: https://www.howtoforge.com/perfect-server-debian-lenny-debian-5.0-with-bind-and-dovecot-ispconfig-3
- ISPConfig: http://www.ispconfig.org/
- Debian: http://www.debian.org/
- Apache mod_rewrite
新しい投稿を受信箱で受け取る
スパムはありません。いつでも購読を解除できます。