基于的Perl CGI的Apache目录的指令认证::会议 [英] Apache directory directive authentication based on Perl CGI::Session

查看:103
本文介绍了基于的Perl CGI的Apache目录的指令认证::会议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我固定我的网站使用CGI:会话,但我的web服务器具有指向文档根目录之外,包含文件的别名目录

I've "secured" my site using CGI:Session but my webserver has an alias directory that points outside the document root and contains files

    Alias /files /myData/all
<Directory /myData/all >
    Options Indexes MultiViews
     AllowOverride None
     Order deny,allow
     Allow from all
</Directory>

我怎么可以链接目录以我的CGI:会话,以便它的安全?阿帕奇怎么会知道用户是否有一个有效的cookie,并允许他们访问 /文件

类似的问题:<一href=\"http://stackoverflow.com/questions/2187200/using-php-apache-to-restrict-access-to-static-files-html-css-img-etc\">Using PHP / Apache来限制访问静态文件(HTML,CSS,IMG等)

推荐答案

您没有保护您的'现场'。

You didn't secure your 'site'.

当访问者加载您的Perl脚本(S) - 但是你安排做,在Apache的 - 你的脚本读取其发送的cookie,找到一个很感兴趣,看着了在其会话存储(可能是一个DB_File在磁盘归档),并试图从商店加载一个会话。

When visitors load your perl script(s) - however you've arranged to do that in Apache - your script reads their sent cookies, find the one it's interested in, looks that up in its session store (might be a DB_File archive on disk) and attempts to load a "session" from the store.

这是你的决定是什么,从那里做;你可能告诉访问者登录,如果没有会话,否则显示(登录的用户),您的网站的特权部分(可能包括一个退出选项,它会破坏会话存储为登录的用户)

It's your decision what to do from there; you're probably telling the visitor to log in if there's no session, and otherwise showing (the logged in user) privileged parts of your 'site' (possibly including a 'logout' option which destroys the session store for that logged in user).

有关将'保护',其他文件夹,您需要使用其他perl脚本为它服务。无论是:

For that other folder to be 'protected' you'll need to serve it using another perl script. Either by:


  • 一)重写请求,或

  • 二)书面承认会话存储一个mod_perl的认证处理程序

  • c)改变您的会话模块,一个是与Apache更好地融入

不知道怎么了最新它是,但阿帕奇::是SessionManager 似乎提供会话的API,可以访问来自你的Perl code和作为Apache认证投手 - 你问什么了,恕我直言,但它不是CGI ::会议做执行 - 例如:选择 C)上述

Not sure how up-to-date it is, but Apache::SessionManager appears to offer a session API that's accessible from both your perl code and as an Apache authentication hander -- exactly what you asked for, IMHO, except that it's not CGI::Session doing the implementation - i.e: option c) above.

这篇关于基于的Perl CGI的Apache目录的指令认证::会议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆