VirtualDocumentRoot kollidiert mit DocumentRoot, hilfe!

Alles, was den Apache betrifft, kann hier besprochen werden.

VirtualDocumentRoot kollidiert mit DocumentRoot, hilfe!

Postby SolSoCoG » 21. May 2009 20:21

Ich habe ein GROßES Problem!

Ich möchte x.domain.de an /var/www/user_web/x vergeben. Das klappt mit der aktuellen config (siehe unten) auch.

NUR, die /var/www/index.php wird ignoriert wenn man auf die Hauptdomain geht und stattdessen nun auf /var/www/user_web/ bzw /www weitergeleitet!

Bitte um schnelle Hilfe! Sehr dringend.

Code: Select all
NameVirtualHost *
<VirtualHost *>
    UseCanonicalName Off
       Servername domain.de
       ServerAlias www.domain.de
                       RewriteEngine on
   ServerAdmin webmaster@localhost
   DocumentRoot /var/www/
      VirtualDocumentRoot /var/www/user_web/%-3+

   <Directory />
      Options FollowSymLinks
      AllowOverride ALL
   </Directory>
   <Directory /var/www/>

      Options Indexes FollowSymLinks MultiViews
      AllowOverride ALL
      Order allow,deny
      allow from all
      # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                # RedirectMatch ^/$ /apache2-default/
   </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>


Was ist da faul?

Mit freundlichen Grüßen,
Alexander
SolSoCoG
 
Posts: 30
Joined: 05. April 2008 13:35

Re: VirtualDocumentRoot kollidiert mit DocumentRoot, hilfe!

Postby Wiedmann » 21. May 2009 20:41

Was ist da faul?

Nichts, du hast ja nur diesen einen VHost definiert, also kommen bei jedem Request (+ Hostname) die Regel von VirtualDocumentRoot zum Tragen.

Willst du für manche Hostnamen ein anders Verhalten, musst du für diese danach separate VHosts anlegen.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: VirtualDocumentRoot kollidiert mit DocumentRoot, hilfe!

Postby SolSoCoG » 21. May 2009 20:46

Habe nun

Code: Select all
<VirtualHost *>
    ServerAdmin mail@mail.de
    DocumentRoot /var/www
    ServerName domain.de
    Serveralias www.domain.de
</VirtualHost>


hinzugefügt am Ende. Klappt jedoch immernoch nicht :(.
SolSoCoG
 
Posts: 30
Joined: 05. April 2008 13:35

Re: VirtualDocumentRoot kollidiert mit DocumentRoot, hilfe!

Postby Wiedmann » 22. May 2009 05:56

Habe nun ... hinzugefügt am Ende. Klappt jedoch immernoch nicht

Jetzt hast du 2 VHosts mit den selben ServerName und ServerAlias Werten (sollte ja schon das error.log bemängeln).
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: VirtualDocumentRoot kollidiert mit DocumentRoot, hilfe!

Postby SolSoCoG » 22. May 2009 08:47

Ja wie soll ich es denn sonst anstellen das auf *.domain.de subdomains und auf http://www.domain.de bzw domain.de hauptseite erscheint ohne das ich es manuell machen muss?
Last edited by SolSoCoG on 22. May 2009 08:53, edited 2 times in total.
SolSoCoG
 
Posts: 30
Joined: 05. April 2008 13:35

Re: VirtualDocumentRoot kollidiert mit DocumentRoot, hilfe!

Postby Wiedmann » 22. May 2009 08:51

Ja wie soll ich es denn sonst anstellen das auf *.domain.de subdomains

Indem du das beim ersten VHost weglässt?
--> Du willst ja gar nicht, dass dieser auf domain.de oder www.domain.de reagieren soll.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: VirtualDocumentRoot kollidiert mit DocumentRoot, hilfe!

Postby SolSoCoG » 22. May 2009 09:13

Hehe, nun hab ich es auch mal gerafft, danke :roll:.

Um aus subdomain.domain.de gleichzeitig auch domain.de/subdomain zu machen muss ich mich mit rewrite befassen?
SolSoCoG
 
Posts: 30
Joined: 05. April 2008 13:35

Re: VirtualDocumentRoot kollidiert mit DocumentRoot, hilfe!

Postby Wiedmann » 22. May 2009 09:19

Um aus subdomain.domain.de gleichzeitig auch domain.de/subdomain zu machen muss ich mich mit rewrite befassen?

Yup. Oder du änderst deine Verzeichnisstruktur.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to Apache

Who is online

Users browsing this forum: No registered users and 37 guests