Menu

Redirecting login to aliased or symlink dir

Johan
2006-05-26
2013-04-25
  • Johan

    Johan - 2006-05-26

    (Sorry for starting to discuss this in the other thread.. since this has nothing to do with compiling the module i might aswell start a new thread)

    I wanted to share my login script for many domains, so i moved it outside my mod_vhost_alias module and into a shared dir.
    I tried including it by setting an Alias /login/ /path/to/login/ or a Symlink.

    When entering the page with explorer or safari i get an error.. using an mozilla browser i get my error page - but memcookie sets a valid (!!) cookie, so upon browser refresh i can enter my page.

    Here's an example conf:
    NameVirtualHost *:80
    <VirtualHost *:80>
      UseCanonicalName Off
      VirtualDocumentRoot "/usr/storage/%2+/%1.1/%1.2/%1/www/"
      Options Includes
      AddOutputFilter INCLUDES .html

      # shared stuff
      Alias /login/ /usr/local/httpd/share/login/

      <Directory />
        AllowOverride Limit AuthConfig FileInfo
      </Directory>

    # boot up auth
      <Location />
        Auth_memCookie_Memcached_AddrPort 127.0.0.1:11211
        Auth_memCookie_CookieName "mycookie"
        Auth_memCookie_Authoritative On
        Auth_memCookie_GroupAuthoritative On
        Auth_memCookie_MatchIP On
        Auth_memCookie_SessionTableSize 4

        ErrorDocument 401 /login/

        AuthType "Cookie"
        AuthName "blogsoft"
      </Location>

      <Location /_login/>
        Satisfy Any
        Options ExecCGI
      </Location>

      <Location /_login/index.html>
        SetHandler fastcgi-script
      </Location>
    </Virtualhost>

     
    • Johan

      Johan - 2006-05-28

      Forgot to mention that i run "Require valid-user" trough .htaccess

       
    • Mathieu CARBONNEAUX

      i'm not sure but:
      Alias /login/ /usr/local/httpd/share/login/
      must be :
      Alias /_login/ /usr/local/httpd/share/login/

      or remove '_' in location below:

      <Location /_login/>
      Satisfy Any
      Options ExecCGI
      </Location>

      <Location /_login/index.html>
      SetHandler fastcgi-script
      </Location>

      but i'm not sure that use of fastcgi module and location on '/' plus alias on '/login' on the same virtual host are possible...

      if not work, use wirtual host like login.mydom.tld for the login script...

      and use ErrorDocument 401 http://login.mydom.tld on each vhost ...

       
Auth0 Logo