PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : bestimmte Domain in Unterordner leiten



TKbeat
19.08.09, 13:33
Hallo,

gibt es die Möglichkeit den Apache so zu konfigurieren das er bei einer bestimmten URL Content aus einem bestimmten Unterordner ausliefert ?

Also bei aufruf von subdomain.domainAA.com soll content aus /aa/aa
ausgeliefert werden und bei subdomain.ganzandreurl.com soll er aus /bb/bb Content ausliefern . Kann der Apache dies auswerten und je nach Fall "umleiten" ?


viele Grüße
tkbeat

muell200
19.08.09, 13:36
gibt es die Möglichkeit den Apache so zu konfigurieren das er bei einer bestimmten URL Content aus einem bestimmten Unterordner ausliefert ?


ja - stichwort - virtual host

TKbeat
19.08.09, 16:47
Danke für den Tip

Das funktioniert zwar , ich habe allerdings für beide Domains bzw für bei Unterordner Ordner eine Authentifizierung aktiviert die schon funktioniert hat .

Diese greift nun nicht mehr , d. h. die Ordner sind frei zugänglich was eher nicht gewünscht ist .

Die conf ist für 2 Ordner welche nicht unterhalb von /var/www/ liegen sondern direkt im Root:

/trac/shop
/svn/shop


Dies wurde aber in der conf berücksichtigt siehe :



<VirtualHost *:80>

ServerAdmin admin@meinefirma.de
Servername svn.domain1.org
DocumentRoot /svn/shop

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On

<Location /svn>

DAV svn
SVNParentPath /svn

# AuthzSVNAccessFile /etc/svnaccess

</Location>

<Location /svn/shop>

PythonOption TracEnv "/svn/shop"
PythonOption TracUriRoot "/svn/shop"
AuthType Basic
AuthName "Shop"
AuthBasicProvider ldap
# Order Allow,Deny
Allow from All
AuthLDAPURL ldap://ldapserver
AuthzLDAPAuthoritative on
AuthLDAPBindDN ldapuser
AuthLDAPBindPassword ldappass
Require valid-user
</Location>

</VirtualHost *:80>




<VirtualHost *:80>

ServerAdmin admin@meinefirma.de

ServerName bug.domain2.org
DocumentRoot /trac/shop


<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On


<Location /trac>

SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /trac
PythonOption TracUriRoot /trac

AuthType Basic
AuthName "Trac"
AuthUserFile /etc/svnauth
Require valid-user

</Location>


<Location /trac/skshop>

#LoadModule auth_module modules/mod_auth.so
#LoadModule ldap_module modules/util_ldap.so
#LoadModule auth_ldap_module modules/mod_auth_ldap.so

PythonOption TracEnv "/trac/shop"
PythonOption TracUriRoot "/trac/shop"
AuthType Basic
AuthName "Shop"
AuthBasicProvider ldap
# Order Allow,Deny
Allow from All
AuthLDAPURL ldap://ldapserver
AuthzLDAPAuthoritative on
AuthLDAPBindDN ldapuser
AuthLDAPBindPassword ldappass

# Require ldap-group ou=Users,dc=meinedc

</Location>


</VirtualHost>

zyrusthc
19.08.09, 17:46
Wie währe es den mit einen simplen:

<VirtualHost *:80>
ServerName bla.foo.bar
ServerAlias *.bla.foo.bar
Redirect permanent /bla http://www.bla.foo.bar/
</VirtualHost>

Greeez Oli

TKbeat
19.08.09, 19:56
danke, aber fehlt dann hier nicht die ldap authentifizierung ?

marce
20.08.09, 07:29
und ein allowOverride none ist evtl. nicht ganz glücklich, wenn Du Auth haben willst.

Packe bitte die Config auch in [code]-Tags, dann kann man sie wesentlich besser lesen...

TKbeat
20.08.09, 10:05
done, nur wie lös ich jetzt o. g. Problem am besten ?

marce
20.08.09, 11:55
gerade gesehen: wenn die VZ nicht unterhalb des DocRoot liegen ist location die falsche Direktive...

TKbeat
20.08.09, 12:06
kannst du sagen welche ich nehmen sollte ?

Directory ?

marce
20.08.09, 12:09
Die Apache-Doku hat dazu eine ded. Meinung...

http://httpd.apache.org/docs/2.2/de/mod/core.html