> >

「[warn] VirtualHost ***.***.***.***:443 overlaps with VirtualHost ***.***.***.***:443, the first has precedence, perhaps you need a NameVirtualHost directive」というエラーが表示されます

設定・インストール

Apacheで名前ベースのマルチドメインを構成する場合に発生するエラーです。 名前ベースのマルチドメインではNameVirtualHostディレクティブを用いてIPアドレスを指定する必要があります。

[例]
NameVirtualHost *:443

<VirtualHost *:443>
DocumentRoot "/var/www/html"
ServerName example.com:443
SSLCertificateFile /etc/httpd/conf/ssl.crt/example_com.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/example_com.key
SSLCACertificateFile /etc/httpd/conf/ssl.crt/example_com.ca-bundle
</VirtualHost>

<VirtualHost *:443>
DocumentRoot "/var/www/contact"
ServerName contact.example.com:443
SSLCertificateFile /etc/httpd/conf/ssl.crt/example_com.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/example_com.key
SSLCACertificateFile /etc/httpd/conf/ssl.crt/example_com.ca-bundle
</VirtualHost>

<VirtualHost *:443>
DocumentRoot "/var/www/sales"
ServerName sales.example.com:443
SSLCertificateFile /etc/httpd/conf/ssl.crt/example_com.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/example_com.key
SSLCACertificateFile /etc/httpd/conf/ssl.crt/example_com.ca-bundle
</VirtualHost>
IPベースで利用する場合は、<VirtualHost *:443>に個別のIPアドレスを設定してください。NameVirtualHostは不要です。
[例]
<VirtualHost 192.168.1.100:443>
DocumentRoot "/var/www/html"
ServerName example.com:443
SSLCertificateFile /etc/httpd/conf/ssl.crt/example_com.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/example_com.key
SSLCACertificateFile /etc/httpd/conf/ssl.crt/example_com.ca-bundle
</VirtualHost>

<VirtualHost 192.168.1.101:443>
DocumentRoot "/var/www/contact"
ServerName contact.example.com:443
SSLCertificateFile /etc/httpd/conf/ssl.crt/example_com.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/example_com.key
SSLCACertificateFile /etc/httpd/conf/ssl.crt/example_com.ca-bundle
</VirtualHost>

<VirtualHost 192.168.1.102:443>
DocumentRoot "/var/www/sales"
ServerName sales.example.com:443
SSLCertificateFile /etc/httpd/conf/ssl.crt/example_com.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/example_com.key
SSLCACertificateFile /etc/httpd/conf/ssl.crt/example_com.ca-bundle
</VirtualHost>

同一カテゴリの質問

ページの先頭に戻る

> >