アプリケーション開発ポータルサイト
ServerNote.NET
Amazon.co.jpでPC関連商品タイムセール開催中!
カテゴリー【Apache
【Apache2】Could not reliably determine the server's fully qualified domain nameと言われる場合
POSTED BY
2023-09-03
apache2ctl configtest

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK

と言われることがある。これは、configにて

<VirtualHost *:80>
    ServerAdmin webmaster@example1155.jp
    ServerName site1.example1155.jp
    CustomLog "/home/www/site1/logs/access_log" combined
    ErrorLog "/home/www/site1/logs/error_log"
    DocumentRoot "/home/www/site1/objs"
</VirtualHost>

のように、ServerNameがVirtualHostの中にしか無い場合言われるようだ。

ServerName site1.example1155.jp

<VirtualHost *:80>
    ServerAdmin webmaster@example1155.jp
    ServerName site1.example1155.jp
    CustomLog "/home/www/site1/logs/access_log" combined
    ErrorLog "/home/www/site1/logs/error_log"
    DocumentRoot "/home/www/site1/objs"
</VirtualHost>

と、VirtualHostの外にデフォルトのServerNameを記述したら上記警告は出なくなった。

※本記事は当サイト管理人の個人的な備忘録です。本記事の参照又は付随ソースコード利用後にいかなる損害が発生しても当サイト及び管理人は一切責任を負いません。
※本記事内容の無断転載を禁じます。
【WEBMASTER/管理人】
自営業プログラマーです。お仕事ください!
ご連絡は以下アドレスまでお願いします★

☆ServerNote.NETショッピング↓
ShoppingNote / Amazon.co.jp
☆お仲間ブログ↓
一人社長の不動産業務日誌
【キーワード検索】