我已经使用mail.mydomain.com配置示例roundcube在Apache子域名上设置了roundcube。现在,当我尝试访问https上的根域时,它会显示圆形界面(没有重定向到子域)。
# Apache2 vhost configuration sample for Roundcube
# https://linode.com/docs/email/clients/installing-roundcube-on-ubuntu-14-04/
<VirtualHost *:80>
# Virtual host configuration + information (replicate changes to *:443 below)
ServerAdmin tehnic@luckypizza.ro
ServerName mail.luckypizza.ro
ServerAlias mail.laiancu.ro
DocumentRoot /var/www/roundcube
ErrorLog /var/log/apache2/webmail/error.log
CustomLog /var/log/apache2/webmail/access.log combined
# Permanently redirect all HTTP requests to HTTPS
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R=301,L]
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
# Virtual host configuration + information (replicate changes to *:80 above)
ServerAdmin tehnic@mydomain.ro
ServerName mail.mydomain.ro
ServerAlias mail.myotherdomain.ro
DocumentRoot /var/www/roundcube
# ErrorLog /var/log/apache2/webmail/error.log
# CustomLog /var/log/apache2/webmail/access.log combined
# SSL certificate + engine configuration
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/mail.mydomain.ro/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mail.mydomain.ro/privkey.pem
# Roundcube directory permissions + restrictions
<Directory /var/www/roundcube>
Options -Indexes
AllowOverride All
</Directory>
<Directory /var/www/roundcube/config>
Order Deny,Allow
Deny from All
</Directory>
<Directory /var/www/roundcube/temp>
Order Deny,Allow
Deny from All
</Directory>
<Directory /var/www/roundcube/logs>
Order Deny,Allow
Deny from All
</Directory>
</VirtualHost>
</IfModule>我已经将此配置复制到根网站,如下所示:
<VirtualHost *:80>
# Virtual host configuration + information (replicate changes to *:443 below)
ServerAdmin tehnic@mydomain.ro
ServerName mydomain.ro
ServerAlias www.mydomain.ro
DocumentRoot /var/www/mydomain/root/public
ErrorLog /var/log/apache2/lucky_error.log
CustomLog /var/log/apache2/lucky_access.log combined
# Permanently redirect all HTTP requests to HTTPS
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R=301,L]
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
# Virtual host configuration + information (replicate changes to *:80 above)
ServerAdmin tehnic@mydomain.ro
ServerName mydomain.ro
ServerAlias www.mydomain.ro
DocumentRoot /var/www/mydomain/root/public
# ErrorLog /var/log/apache2/lucky_error.log
# CustomLog /var/log/apache2/lucky_access.log combined
# SSL certificate + engine configuration
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/mydomain.ro/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.ro/privkey.pem
# Roundcube directory permissions + restrictions
<Directory /var/www/mydomain/root/public>
Options -Indexes
AllowOverride All
</Directory>
</VirtualHost>
</IfModule>配置似乎出了什么问题?
发布于 2017-11-27 22:39:21
问题可能与服务器端缺乏SNI支持有关,导致所有请求都发送到同一虚拟主机。您可以在此处检查先决条件:https://wiki.apache.org/httpd/NameBasedSSLVHostsWithSNI,或者您也可以通过删除两个虚拟主机中的一个进行测试,测试,将其带回,并删除第二个虚拟主机。
https://stackoverflow.com/questions/47512394
复制相似问题