windows xp下設置apache目錄訪問身份驗證(目錄訪問控制)
發表于:2007-05-25來源:作者:點擊數:
標簽:
一.編輯httpd.conf 加入 Alias/picture/"E:/picture/" #設置虛擬目錄picture到根目錄 Directory"E:/picture/" OptionsIndexesMultiViews AllowOverrideAuthConfig OrderDeny,Allow Allowfromall OptionsAll AllowOverrideAll /Directory 二.在E:/picture/下
一.編輯httpd.conf
加入
Alias /picture/ "E:/picture/"
#設置虛擬目錄picture到根目錄
<Directory "E:/picture/">
Options Indexes MultiViews
AllowOverride AuthConfig
Order Deny,Allow
Allow from all
Options All
AllowOverride All
</Directory>
二.在E:/picture/下創建.hta
clearcase/" target="_blank" >ccess文件
authtype basic
authname "登陸凡星專區"
authuserfile e:/picture/.htpasswd
require valid-user
三.在E:/picture/下創建密碼文件
1.明文密碼:
創建pass.txt
內容格式為:username:password
冒號前為用戶名,后面為密碼,可以放到其他目錄,二中的authuserfile的目錄也要相應的改動。
2.創建MD5加密的密碼文件
在虛擬DOS下進入你的apache目錄下的bin目錄,輸入命令
htpasswd -c e:\picture\.htpasswd fanxing
接下去要求輸入兩次密碼
上面命令行的意思是在E:/picture/下創建密碼檔.htpasswd
。好了,現在重啟apache,在IE里訪問picture就要求輸入用戶名和密碼了!
[color=red:21ccfd3b0b]以上部分參考了
linux下配置的資料,由謝丹峰@zucc在
Windows XP下實踐并整理成文,如需轉載,請注明出處[/color:21ccfd3b0b]
harryliu 回復于:2004-11-16 18:42:26
|
我很想知道,你們的.htaccess文件是如何在windows下生成的.
|
a010 回復于:2004-11-16 19:05:06
|
方法一:
可以創建文本文檔a.txt ,只要使里面的內容為
authtype basic
authname "登陸凡星專區"
authuserfile e:/picture/.htpasswd
require valid-user
然后下面就是把文件改為.htaccess
設置文件夾選項》查看》隱藏已知文件的擴展名 的勾去掉,然后重命名a.txt為.htaccess
以可以利用FTP客戶端工具的話,直接瀏覽本地目錄,找到a.txt,重命名為.htaccess
方法二:使用ultraedit32
編輯內容
authtype basic
authname "登陸凡星專區"
authuserfile e:/picture/.htpasswd
require valid-user
保存為.htaccess
方法三:
在虛擬dos下進入E:/picture
再輸入 edit .htaccess
進入藍色的編輯窗,輸入
authtype basic
authname "登陸凡星專區"
authuserfile e:/picture/.htpasswd
require valid-user
然后保存,在E:/picture 下就會出現一個.htaccess文件了
OK,現在應該夠明白了!
[color=red:4e60f16a01]由謝丹峰@zucc在Windows XP下實踐并整理成文,如需轉載,請注明出處[/color:4e60f16a01]
|
原文轉自:http://www.kjueaiud.com
老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月
|