8

どういうわけか、仮想ホスト ファイルが正常に動作していません。理由はわかりません。おはよう脳内の単なるメール機能に違いありません :p

現在、次のような /etc/apache2/ ディレクトリで利用可能なサイトへのシンボリックリンクを介して2つのサイトを有効にしました:

0 Nov 21 12:24 000-default -> ../sites-available/default
0 Nov 21 14:52 001-site -> ../sites-available/site

私のVHostsファイルは次のようになります:

デフォルト

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName (the IP Address from my Server)
        ServerAlias (the 2nd IP Address from my Server)
        DocumentRoot /var/www/default
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/default>
                Options FollowSymLinks MultiViews
                AllowOverride None
                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
        LogLevel warn

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

サイト

<VirtualHost *:80>
    ServerAdmin myname@example.de
    DocumentRoot /var/www/site/
    ServerName jobbörse-köln.de
    ServerAlias www.example.de ww.example.de w.example.de

    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /var/www/site>
            Options FollowSymLinks MultiViews
            AllowOverride None
            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}/site-error.log
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/site-access.log combined
</VirtualHost>

どういうわけか、「example.de」に進むと、SITE ディレクトリではなく DEFAULT ディレクトリに移動します。ログファイルでさえ:

site-error.log
site-access.log

0バイトのまま...何が間違っているのですか? 私はそれが愚かで簡単なものだと確信しています...

4

1 に答える 1

9

両方の仮想ホスト エントリにデフォルトの 80 ポートを使用しています。したがって、構成として NameVirtualHost *:80 を使用していることを願っています。

VirtualHost を共有した構成では、ポート 80 で重複しているため、最初のものが優先されます。

于 2013-11-22T15:56:22.053 に答える