Difference between revisions of "Xampp htaccess password"
From MS Computech
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | วิธีการ สร้าง htaccess password protect folder xampp windows | + | วิธีการ สร้าง htaccess password protect folder xampp windows<br> |
− | 1.cmd > C:\xampplite\apache\bin>htpasswd.exe -c -b folder.users | + | 1.cmd |
+ | <pre> | ||
+ | C:\xampplite\apache\bin>htpasswd.exe -c -b folder.users yourusername yourpassword | ||
+ | </pre> | ||
2.copy folder.users file ไปที่ C:\xampplite\security<br> | 2.copy folder.users file ไปที่ C:\xampplite\security<br> | ||
+ | หรือ | ||
+ | <pre> | ||
+ | C:\xampplite\apache\bin>htpasswd.exe -c C:\xampplite\security\folder.users msc | ||
+ | Automatically using MD5 format. | ||
+ | New password: *** | ||
+ | Re-type new password: *** | ||
+ | Adding password for user msc | ||
+ | </pre> | ||
3.create file .htaccess ที่ Folder ที่ต้องการ Protect<br> | 3.create file .htaccess ที่ Folder ที่ต้องการ Protect<br> | ||
4..htaccess<br> | 4..htaccess<br> | ||
<pre> | <pre> | ||
− | AuthName " | + | AuthName "Protected Area" |
AuthType Basic | AuthType Basic | ||
AuthUserFile "C:\xampplite\security\folder.users" | AuthUserFile "C:\xampplite\security\folder.users" | ||
require valid-user | require valid-user | ||
</pre> | </pre> | ||
+ | จบ<br> | ||
+ | ================================================= | ||
+ | Source | ||
+ | ================================================= | ||
+ | [http://www.stabeler.com/blog/487/how_to_use_htpasswd_to_create_protected_directories_XAMPP___apache/ Xampp] |
Latest revision as of 16:02, 3 April 2010
วิธีการ สร้าง htaccess password protect folder xampp windows
1.cmd
C:\xampplite\apache\bin>htpasswd.exe -c -b folder.users yourusername yourpassword
2.copy folder.users file ไปที่ C:\xampplite\security
หรือ
C:\xampplite\apache\bin>htpasswd.exe -c C:\xampplite\security\folder.users msc Automatically using MD5 format. New password: *** Re-type new password: *** Adding password for user msc
3.create file .htaccess ที่ Folder ที่ต้องการ Protect
4..htaccess
AuthName "Protected Area" AuthType Basic AuthUserFile "C:\xampplite\security\folder.users" require valid-user
จบ
=====================================
Source