Virtuelle hosts subdomains zeigen auf Falsches Verzeichnis

Ich erstellt 2 virtuelle hosts http://web1.com:2107 zeigt auf "/var/www/web1" Ordner und zweite http://web2.com:2107 zeigt auf "/var/www/web2". alle subdomains im web2 arbeiten gut, Aber im Falle von "web1".com:2107 ich in der Lage bin zu sehen, nur die home-Seite. wenn ich versuche, öffnen Sie eine beliebige subdomain von web1 wie http://Spiele.web1.com:2107 es Punkte zu web2 Startseite ie /var/www/web2/Verzeichnis

Gibt es etwas falsch in der Konfiguration ?

unten ist der code für hosts, ich bin mit

<VirtualHost *:80>
ServerName  web2.com
ServerAdmin [email protected]
ServerAlias http://www.web2.com
DocumentRoot /var/www/web2
<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>
<Directory /var/www/web2>
    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 All
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>

ErrorLog    /var/www/web2/error80.log
CustomLog   /var/www/web2/access80.log Combined
</VirtualHost>

<VirtualHost *:2107>
ServerName  web2.com    
ServerAdmin [email protected]
ServerAlias http://www.web2.com
DocumentRoot /var/www/web2
<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>
<Directory /var/www/web2>
    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 All
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>

    ErrorLog /var/www/web2/error.log
CustomLog   /var/www/web2/access80.log Combined
LogLevel warn

CustomLog /var/log/apache2/web2.com_access.log combined

Alias /doc/"/usr/share/doc/"
<Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>

===================================================================

NameVirtualHost *:2107
<VirtualHost *:2107>
    ServerName web1.com
    ServerAlias http://web1.com
    DocumentRoot /var/www/web1
    <Directory /var/www/web1/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
    </Directory>
    ErrorLog        /var/www/web1/error.log
    CustomLog       /var/www/web1/access.log Combined
</VirtualHost>
Ich hatte das gleiche und in meinem Fall Teil mit "NameVirtualHost *:80" war ich eine Datei, die nicht im Haupt-httpd.conf - so vhosts wurden nicht aktiviert, und daher alle auf in die default-vhost.

InformationsquelleAutor www.amitpatil.me | 2011-12-15

Schreibe einen Kommentar