为特定页面设置httpd身份验证

时间:2012-06-06 06:51:23

标签: authentication apache

我有一个脚本安装这一切对我来说,但我试图配置它我喜欢。

问题是它是在web目录的根目录下我想要它到目录中的特定文件夹...我将如何解决这个问题...

这就是我现在所拥有的

    ServerName localhost
<VirtualHost *:80>

    ServerAdmin admin@rutorrent
    ServerName localhost
    DocumentRoot /var/rutorrent/

    <Directory />
        AllowOverride None
        Order deny,allow
        Deny from all
    </Directory>
    <Location />
        AuthType Basic
        AuthName "My ruTorrent web site"
        AuthUserFile "/etc/httpd/rutorrent_passwd"
        Require valid-user
        Order allow,deny
        Allow from all
    </Location>
    <Location ~ "^/rutorrent/(conf|share)">
        Order deny,allow
        Deny from all
    </Location>
    <Location ~ "/\\.svn">
        Order deny,allow
        Deny from all
    </Location>
    <Location "/RPC00001">
        AuthType Basic
        AuthName "My ruTorrent web site"
        AuthUserFile "/etc/httpd/rutorrent_passwd"
        Require user torrent
    </Location>
</VirtualHost>
<VirtualHost *:443>
    SSLEngine On
    SSLCertificateFile /etc/httpd/rutorrent.pem
    ServerAdmin admin@rutorrent
    ServerName localhost
    DocumentRoot /var/rutorrent

    <Directory />
        AllowOverride None
        Order deny,allow
        Deny from all
    </Directory>
    <Location />
        AuthType Basic
        AuthName "My ruTorrent web site"
        AuthUserFile "/etc/httpd/rutorrent_passwd"
        Require valid-user
        Order allow,deny
        Allow from all
    </Location>
    <Location ~ "^/rutorrent/(conf|share)">
        Order deny,allow
        Deny from all
    </Location>
    <Location ~ "/\\.svn">
        Order deny,allow
        Deny from all
    </Location>
    <Location "/RPC00001">
        AuthType Basic
        AuthName "My ruTorrent web site"
        AuthUserFile "/etc/httpd/rutorrent_passwd"
        Require user torrent
    </Location>
</VirtualHost>
#SCGIMount /RPC00001 127.0.0.1:23876

我想这样做,所以它要求/ var / rutorrent / passwordarea中的密码

我也不介意为/ var / rutorrent提供单独的密码和用户名,所以如果有人可以分享如何做到这一点,我会非常感激。

由于

0 个答案:

没有答案