简体   繁体   English

子域不起作用

[英]Sub-domain not working

I'm pretty new to apache, so probably the solution will be obvious to you... I'm running on Debian wheezy 我对Apache很陌生,所以解决方案对您来说很明显...我正在Debian Wheezy上运行

Here are my two file in /etc/apache2/sites-availables : 这是我在/etc/apache2/sites-availables两个文件:

amelineandraphael 阿美琳

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName amelineandraphael.raphaelnussbaumer.com

        DocumentRoot /var/www/amelineandraphael
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/amelineandraphael>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

zoziology 动物学

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName zoziologie.raphaelnussbaumer.com

    DocumentRoot /var/www/zoziologie
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /var/www/zoziologie>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

  • I have added a symbolic link to /etc/apache2/sites-enables 我已将符号链接添加到/etc/apache2/sites-enables
  • I've run sudo a2ensite amelineandraphael and sudo a2ensite zoziologie 我已经运行了sudo a2ensite amelineandraphaelsudo a2ensite zoziologie
  • and restart the apache server. 并重新启动apache服务器。

The sub-domain zoziologie.raphaelnussbaumer.com is working but amelineandraphael.raphaelnussbaumer.com redirect me to the default index.html at /var/www/ . 子域名zoziologie.raphaelnussbaumer.com正在运行,但是amelineandraphael.raphaelnussbaumer.com将我重定向到/var/www/的默认index.html。

Here are the .htaccess of /var/www/amelineandraphael : 这是/var/www/amelineandraphael的.htaccess /var/www/amelineandraphael

SetEnv PHP_VER 5_4

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Any idea ? 任何想法 ?

I think I found the solution. 我想我找到了解决方案。 Although I'm not sure that's the only part of the solution: 尽管我不确定那是解决方案的唯一部分:

sudo a2dissite 000-default

Unfortunately I can't comment yet as I don't have the rep, so sorry about this being an "answer". 不幸的是,由于我没有代表,因此我无法发表评论,对于此为“答案”,我们深感抱歉。

I'm wondering if you have a DNS "A" record for that subdomain? 我想知道您是否对该子域有DNS“ A”记录? You may have a wildcard DNS record though, which would make this a moot point 不过,您可能有通配符DNS记录,这将成为一个争论点

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

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