Sub-domain not working

左心房为你撑大大i 提交于 2019-12-13 07:19:39

问题


I'm pretty new to apache, so probably the solution will be obvious to you... I'm running on Debian wheezy

Here are my two file in /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
  • I've run sudo a2ensite amelineandraphael and sudo a2ensite zoziologie
  • and restart the apache server.

The sub-domain zoziologie.raphaelnussbaumer.com is working but amelineandraphael.raphaelnussbaumer.com redirect me to the default index.html at /var/www/.

Here are the .htaccess of /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 ?


回答1:


I think I found the solution. Although I'm not sure that's the only part of the solution:

sudo a2dissite 000-default



回答2:


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? You may have a wildcard DNS record though, which would make this a moot point



来源:https://stackoverflow.com/questions/37477000/sub-domain-not-working

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!