简体   繁体   English

多个apache子域-主域和子域都具有相同的CNAME,IP和PORT。 一个子域有效,另一个不起作用

[英]Multiple apache subdomains - main domain and subs all same CNAME, IP and PORT. One subdomain works, the other doesn't

I am trying to create a setup so that I have the following three domains: 我试图创建一个安装程序,以便具有以下三个域:

mydomain.com files.mydomain.com mail.mydomain.com

I have managed to get the first two to work but the third keeps redirecting back to the main domain instead. 我设法使前两个工作,但第三个继续重定向回主域。

In /etc/apache2/sites-enabled/ I have three .conf files. 在/ etc / apache2 / sites-enabled /中,我有三个.conf文件。 The first: 首先:

<VirtualHost *:80>
        ServerName mydomain.com
        ServerAlias www.mydomain.com
        DocumentRoot /var/www/wordpress
        ...
</VirtualHost>

The second: 第二:

<VirtualHost *:80>
    ServerName files.mydomain.com
    DocumentRoot /var/www
    Alias /media  /home/user/cloud/media
    ....
</VirtualHost>

and the third: 第三:

<VirtualHost .*:80>
     ServerName mail.mydomain.com
     DocumentRoot /var/www
     Alias /mail /usr/share/mail
     ....
</VirtualHost>

All three have been a2ensite'd and I have restarted apache2. 所有这三个都已被访问,并且我已经重新启动了apache2。 Any ideas what I am doing wrong? 有什么想法我做错了吗? Cheers! 干杯!

There is a dot: 有一个点:

<VirtualHost .*:80>
             ^
             ^
             ^

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM