ich habe Probleme mit meiner vHosts-Datei, und zwar funktionieren Subdomains nicht.
Und so sieht's aus. Ich habe zwei Dateien für vHosts. Einmal die default:
- Code: Select all
NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@[TLD].de
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
Options -Indexes
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 /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
Außerdem eine eigens erstellte Datei:
- Code: Select all
<VirtualHost *>
ServerAdmin webmaster@[TLD].de
ServerName [SUB].[TLD].de
CustomLog /var/log/www/[SUB].[TLD].de-custom.log combined
ErrorLog /var/log/www/[SUB].[TLD].de-error.log
DocumentRoot /var/www/[SUB]
<Directory "/var/www/[SUB]">
Allow from all
AllowOverride All
Options FollowSymLinks +Indexes
</Directory>
</VirtualHost>
<VirtualHost *>
ServerAdmin webmaster@[TLD].de
ServerName [TLD].de
RedirectPermanent / http://www.[TLD].de/
</VirtualHost>
<VirtualHost *>
ServerAdmin webmaster@[TLD].de
ServerName www.[TLD].de
CustomLog /var/log/www/[TLD].de-custom.log combined
ErrorLog /var/log/www/[TLD].de-error.log
DocumentRoot /var/www/site
<Directory "/var/www/site">
Allow from all
AllowOverride All
Options FollowSymLinks +Indexes
</Directory>
</VirtualHost>
(Ich habe hier zensiert: [TLD] und [SUB] sehen im Original natürlich anders aus)
Es funktioniert erfolgreich:
www.[TLD].de
[TLD].de
Es funktioniert nicht:
[SUB].[TLD].de
Ich erhalte bei der Subdomain eine "Seite nicht gefunden"-Meldung. Sie ist aber existent, so wie sie im DocumentRoot gesetzt ist!
Wo ist der Fehler?