Apaches AuthFormLogoutLocation的问题
在我的VirtualHost配置中,我有一个注销重定向,它似乎不起作用。我总是在Firefox或Edge(最新版本)上重置连接 以下是我的apache配置:Apaches AuthFormLogoutLocation的问题,apache,session,logout,apache2.4,Apache,Session,Logout,Apache2.4,在我的VirtualHost配置中,我有一个注销重定向,它似乎不起作用。我总是在Firefox或Edge(最新版本)上重置连接 以下是我的apache配置: Alias /logouttest /var/www/html/logouttest LogLevel trace8 CustomLog /var/log/httpd/q-folder/access_log common ErrorLog /var/log/httpd/q-folder/error_log DocumentRoot /va
Alias /logouttest /var/www/html/logouttest
LogLevel trace8
CustomLog /var/log/httpd/q-folder/access_log common
ErrorLog /var/log/httpd/q-folder/error_log
DocumentRoot /var/www/html/logouttest
<Directory /var/www/html/logouttest>
AllowOverride all
Options -MultiViews
AuthType Basic
AuthName "please login"
AuthBasicProvider ldap
AuthLDAPURL ldap://xx.xxxxx.xx:389/OU=xxxxxx,OU=company,DC=xxxxx,DC=xx?sAMAccountName?sub?(objectclass=*)
AuthLDAPBindDN CN=LDAPQuery,OU=xxxxx,OU=xxxxxx,OU=xxxxxx,DC=xxxx,DC=xx
AuthLDAPBindPassword 'xxxxxxxx'
Require valid-user
RewriteEngine On
RewriteCond %{LA-U:REMOTE_USER} (.+)
RewriteRule . - [E=RU:%1,NS]
RequestHeader add X-Forwarded-User %{RU}e
Session On
SessionCookieName session path=/
</Directory>
<Location "/logout">
SetHandler form-logout-handler
AuthType Basic
AuthName "please login"
AuthFormLogoutLocation "/logout/logout.html"
Session On
SessionCookieName session path=/
</Location>
到目前为止,我没有机会显示注销页面。
谢谢您的帮助。这是我的良好工作配置 httpd.conf中的配置部分
------8<----8<------
<Location /logout>
SetHandler form-logout-handler
AuthFormLogoutLocation "/login_logout/logout.html"
Session On
# Session laeuft in einer Sekunde ab
SessionMaxAge 1
SessionCookieName form_auth_session path=/
SessionCryptoPassphrase "<CryptoPassPhrase>"
</Location>
<Location />
AuthFormProvider ldap file
AuthLDAPURL "ldap://<LDAP-DN-URI>"
AuthUserFile <save_pfad>/.htpasswd
AuthName "authenticationform"
AuthType form
ErrorDocument 401 /login_logout/do_login.php
AuthFormFakeBasicAuth on
Session On
# Anmeldung 3Monate = 31+30+31= 92 Tage * 24h * 3600 Sekunden = 7948800 Sekunden gültig
SessionMaxAge 7948800
SessionCookieName form_auth_session path=/
SessionCryptoPassphrase "<CryptoPassPhrase>"
</Location>
------8<----8<------
有些位于apache配置virtualhosts.htacces或其他位置
------8<----8<------
<Location /secure/>
Require valid-user
</Location>
------8<----8<------
----8
基恩在这里唠叨
魏特莱东:[]
WIN2003 Anmeldung erforderlich。。。
用户:
密码:
这些配置非常可靠和舒适。
我希望这解决了你的问题
许多伟大的事物:-)
LoadModule session_crypto_module modules/mod_session_crypto.so
------8<----8<------
<Location /secure/>
Require valid-user
</Location>
------8<----8<------
<?php
// Source: [http://stackoverflow.com/questions/6768793/get-the-full-url-in-php][1]
function url_origin( $s, $use_forwarded_host = false )
{
$ssl = ( ! empty( $s['HTTPS'] ) && $s['HTTPS'] == 'on' );
$sp = strtolower( $s['SERVER_PROTOCOL'] );
$protocol = substr( $sp, 0, strpos( $sp, '/' ) ) . ( ( $ssl ) ? 's' : '' );
$port = $s['SERVER_PORT'];
$port = ( ( ! $ssl && $port=='80' ) || ( $ssl && $port=='443' ) ) ? '' : ':'.$port;
$host = ( $use_forwarded_host && isset( $s['HTTP_X_FORWARDED_HOST'] ) ) ? $s['HTTP_X_FORWARDED_HOST'] : ( isset( $s['HTTP_HOST'] ) ? $s['HTTP_HOST'] : null );
$host = isset( $host ) ? $host : $s['SERVER_NAME'] . $port;
return $protocol . '://' . $host;
}
function full_url( $s, $use_forwarded_host = false )
{
return url_origin( $s, $use_forwarded_host ) . $s['REQUEST_URI'];
}
$absolute_url = full_url( $_SERVER );
?>
<html>
<head>
<title>Form-Auth: <?php echo $absolute_url?></title>
</head>
<body>
<center>
<table style="margin-top:2em;" border=1 cellspacing=0>
<tr><th nowrap bgcolor=skyblue><?php echo $absolute_url ?></th></tr>
<?php
if (preg_match("/^http:/", $absolute_url))
{
$save_absolute_url=preg_replace("/^http:/", "https:", $absolute_url);
?>
<tr>
<th nowrap align=middle style="padding:2em; background:#ff0000;color:yellow;">
KEINE sichere Verbindung !!!<br> Passwort wird in Klartext über das Netz übertragen !!! <br><br>
Weiterleitung: [<a href="<?php echo $save_absolute_url?>"><?php echo $save_absolute_url?></a>]
</th>
</tr>
<?php
} // end if (! preg_match("/^https:", $absolute_url))
?>
<tr><td nowrap align=middle style="border-bottom:0;">WIN2003-Anmeldung erforderlich ...</td></tr>
<tr>
<td nowrap align=middle style="border-top:0; padding-top:1em;padding-left:2em;padding-right:2em;padding-bottom:0;">
<form method="POST" action="">
User: <input type="text" name="httpd_username" value="" placeholder="Benutzername" />
Password: <input type="password" name="httpd_password" value="" placeholder="Password" />
<input type="submit" name="login" value="Login" />
</form>
</td>
</tr>
</table>
</center>
</body>
</html>