将子域的通配符与少数子子域的通配符合并的问题

时间:2010-06-21 18:59:55

标签: php .htaccess dns subdomain wildcard

我安装了EHCP,因为它在服务器上很简单,很有用,只有很少的FTP帐户和网站。它只测试服务器。

问题是:我可以访问* .avki.zgarnijlicke.pl,* .kierowca.zgarnijlicke.pl但* .zgarnijlicke.pl无效。

我的配置是: a)Apache模板:

#____________start of {domainname}__paneluser:{panelusername}_reseller:{reseller}_id:{id}____________
# explanation  {aciklama}

<VirtualHost *> ServerName {domainname} ServerAlias www.{domainname} # buraya aliaslar yazilacak.. {aliases}

    UseCanonicalName Off
    DocumentRoot {homedir}/httpdocs
    ScriptAlias /cgi-bin/ {homedir}/httpdocs/cgi-bin/

    \# this combined log format is understandable by webalizer... some other formats are not recognised by webalizer.. thats why, specified here explicitly.. 

    LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; combined
    LogFormat &quot;%v:%h %l %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; vhost_combined
    CustomLog  {homedir}/logs/access_log combined
    CustomLog  /var/log/apache_common_access_log vhost_combined

    php_admin_value open_basedir {homedir}
    php_admin_value upload_tmp_dir {homedir}/phptmpdir
    php_admin_value session.save_path {homedir}/phptmpdir

    AccessFileName .htaccess

    &lt;Directory {homedir}&gt;
    AllowOverride all
    &lt;/Directory&gt;
    {customhttp}

</VirtualHost>

<VirtualHost *> ServerName webmail.{domainname} ServerAlias mail.{domainname} ServerAlias email.{domainname}

DocumentRoot /var/www/vhosts/ehcp/webmail

    LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; combined
    LogFormat &quot;%v:%h %l %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; vhost_combined
    CustomLog  {homedir}/logs/access_log combined
    CustomLog  /var/log/apache_common_access_log vhost_combined

    php_admin_value open_basedir /var/www/vhosts/ehcp/webmail
    php_admin_value upload_tmp_dir /var/www/vhosts/ehcp/webmail/data
    php_admin_value session.save_path /var/www/vhosts/ehcp/webmail/data

</VirtualHost>

<VirtualHost *> ServerName cpanel.{domainname} ServerAlias panel.{domainname} ServerAlias ehcp.{domainname} ServerAlias cp.{domainname}

DocumentRoot /var/www/vhosts/ehcp/

    LogFormat &quot;%v:%h %l %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; vhost_combined
    CustomLog  /var/log/apache_common_access_log vhost_combined

    php_admin_value open_basedir /var/www/vhosts/ehcp/

</VirtualHost> #____________end of {domainname}__paneluser:{panelusername}_reseller:{reseller}_id:{id}____________

b)apache别名: UseCanonicalName Off DocumentRoot {homedir}/httpdocs ScriptAlias /cgi-bin/ {homedir}/httpdocs/cgi-bin/ \# this combined log format is understandable by webalizer... some other formats are not recognised by webalizer.. thats why, specified here explicitly.. LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; combined LogFormat &quot;%v:%h %l %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; vhost_combined CustomLog {homedir}/logs/access_log combined CustomLog /var/log/apache_common_access_log vhost_combined php_admin_value open_basedir {homedir} php_admin_value upload_tmp_dir {homedir}/phptmpdir php_admin_value session.save_path {homedir}/phptmpdir AccessFileName .htaccess &lt;Directory {homedir}&gt; AllowOverride all &lt;/Directory&gt; {customhttp}

    LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; combined
    LogFormat &quot;%v:%h %l %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; vhost_combined
    CustomLog  {homedir}/logs/access_log combined
    CustomLog  /var/log/apache_common_access_log vhost_combined

    php_admin_value open_basedir /var/www/vhosts/ehcp/webmail
    php_admin_value upload_tmp_dir /var/www/vhosts/ehcp/webmail/data
    php_admin_value session.save_path /var/www/vhosts/ehcp/webmail/data

c)DNS模板 LogFormat &quot;%v:%h %l %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; vhost_combined CustomLog /var/log/apache_common_access_log vhost_combined php_admin_value open_basedir /var/www/vhosts/ehcp/

2 个答案:

答案 0 :(得分:1)

解决。 别名:

*.zgarnijlicke.pl
DNS模板:
$TTL    86400
@       IN      SOA     ns.{domainname}. {dnsemail} (
                        {serial}     ; Serial
                        10800   ; Refresh
                        1200     ; Retry
                        86400  ; Expire
                        86400 ) ; Minimum

{domainname}. IN NS ns.{domainname}. ns.{domainname}. IN A {dnsip} ns1.{domainname}. IN A {dnsip} ns2.{domainname}. IN A {dnsip} dns.{domainname}. IN A {dnsip} dns1.{domainname}. IN A {dnsip} dns2.{domainname}. IN A {dnsip} {domainname}. IN A {webip} mail.{domainname}. IN A {mailip} smtp.{domainname}. IN A {webip} webmail.{domainname}. IN A {webip} ftp.{domainname}. IN CNAME {domainname}. www.{domainname}. IN CNAME {domainname}. {domainname}. IN MX 10 mail.{domainname}. {domainname}. IN TXT "v=spf1 a mx"

{customdns}

  • IN A {webip}

Apache模板没有变化。

现在,它正在发挥作用。 asd.qwe.qwe.asd.qwe.asd.zgarnijlicke.pl和hello.zgarnijlicke.pl

答案 1 :(得分:0)

您不能将域名用作A记录分配的右侧。 *。{domainname} 14400 IN A {domainname}

请尝试以下方法:

*。{domainname} 14400 IN CNAME {domainname}

或者如果您需要使用A记录,请尝试

*。{domainname} 14400 IN A {webip}