SSL을 설정했을 때 가상 호스트가 제한되지 않는 이상한 문제가 있습니다. 가상 호스트가 이름에만 국한되지 않는다는 사실을 제외하면 모든 것이 예상대로 작동합니다. 예를 들어 https://qa.example.com/으로 이동하면 정확한 페이지가 표시됩니다. 그러나 https://foo.example.com/으로 이동하면 동일한 페이지가 제공됩니다! http://httpd.apache.org/docs/2.2/vhosts/name-based.html에서 이름 기반 구성을 읽었으므로 손실이 발생했습니다.가상 호스트가 ServerName 속성을 사용하지 않음
NameVirtualHost *:80
Listen 80
<IfModule mod_ssl.c>
NameVirtualHost *:443
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
NameVirtualHost *:443
Listen 443
</IfModule>
지금 내 /etc/apache2/sites-enabled/000-default
파일도 매우이다 : 나는 NameVirtualHost
항목을 정의 곳
<IfModule mod_ssl.c>
<VirtualHost *:443>
<IfModule dir_module>
DirectoryIndex login.html
</IfModule>
ServerAdmin [email protected]
ServerName qa.example.com
DocumentRoot /var/www/example
<Directory />
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
JkMount /axonify/* worker1
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined
SSLEngine on
SSLCertificateFile "/etc/ssl/certs/star.example.com.crt"
SSLCertificateKeyFile "/etc/ssl/private/star.example.com.key"
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>
</IfModule>
내 /etc/apache2/ports.conf
파일은 다음과 같습니다
/etc/apache2/sites-enabled/mysite-ssl
파일입니다 단순 :
<VirtualHost *:80>
ServerAdmin [email protected]
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>
o사이트가 배포되어 있고 단일 SSL 사용 가능 사이트 만 배포했습니다.
문제를 해결했습니다. 필자는 불일치하는 가상 호스트의 폴백 (fallback) 역할을하는''항목을 지정하는 default-ssl 파일이 필요하다고 생각합니다. –