Apache 구성 예를 사용하여 mail.mydomain.com
하위 도메인에 roundcube를 설정했습니다. roundcube와 함께 제공됩니다. 이제 https에서 루트 도메인에 도달하려고하면 하위 도메인으로 리디렉션하지 않고 roundcube 인터페이스를 표시합니다.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 [email protected]
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 [email protected]
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 [email protected]
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 [email protected]
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>
어떻게 구성 잘못된 것 같다?
새 가상 호스트를 이전 .conf 파일과 동일한 .conf 파일에 배치 했습니까? 그들이 분리 된 폴더에 정확히 어떤 폴더에 새로운 .conf 파일을 넣었습니까? –
@Dusan Bajic 같은 폴더, 실제로 동일한 파일, 이전의 것들이 대체되어 mydomain.ro.conf와 mail.mydomain.ro.conf가 있습니다. – Sergiu
미안하지만, 나는 그것을 얻지 못했습니다. 같은 파일이면 두 파일이 있다고 가정합니다. 두 개의 .conf 파일 (메일 도메인 용, 하나의 루트 도메인 용)이있는 경우 .conf 파일이있는 정확한 위치 (해당 폴더의 전체 경로)는 무엇입니까? –