我在 Ubuntu 14.04 机器上运行邮件服务器,没有任何问题。为了检查电子邮件,我使用 aptitude 的 deb 包安装了 roundcube。该程序安装到 /usr/share/roundcube 并在 conf-available 中设置了一个 conf,如下所示:
# Those aliases do not work properly with several hosts on your apache server
# Uncomment them to use it or adapt them to your configuration
Alias /roundcube/program/js/tiny_mce/ /usr/share/tinymce/www/
Alias /roundcube /var/lib/roundcube
# Access to tinymce files
<Directory "/usr/share/tinymce/www/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
<IfVersion >= 2.3>
Require all granted
</IfVersion>
<IfVersion < 2.3>
Order allow,deny
Allow from all
</IfVersion>
</Directory>
<Directory /var/lib/roundcube/>
Options +FollowSymLinks
# This is needed to parse /var/lib/roundcube/.htaccess. See its
# content before setting AllowOverride to None.
AllowOverride All
<IfVersion >= 2.3>
Require all granted
</IfVersion>
<IfVersion < 2.3>
Order allow,deny
Allow from all
</IfVersion>
</Directory>
现在,在这个服务器上托管的每个域上,如果我在 URL 末尾添加 /roundcube,我就会看到 roundcube 登录页面。据我所知,这是由 conf 文件中的前两行设置的。我对 Apache 配置不太熟悉,不知道在注释它们以将 roundcube 设置为只能通过 webmail.my_mail_server.com 等域访问后我应该做什么。此域正确解析为我的邮件服务器。问题只出现在 apache 方面。谢谢您的帮助!
答案1
假设所有其他事项都已准备就绪(适当的Listen
和/或NameVirtualHost
指令、DNS 别名等...),它应该像将整个配置内容包装在一个<VirtualHost>
块中一样简单,如下所示:
<VirtualHost *:80>
ServerName webmail.my_mail_server.com
.... [exsiting config from above] ....
</VirtualHost>