![]() ![]() ลีนุกซ์ (Linux) : superuser |
ปรับปรุง : 2566-02-17 (ปรับรุ่นเป็น 9.0) |
|
หน้าหลัก | ลีนุกซ์คืออะไร | แนะนำหนังสือ | superuser | บันทึกปัญหา | |
0974 |
9.74 User authentication ด้วย .htpasswd + .htaccess
: การปิดห้อง แต่ยอมให้เข้าด้วย username และ password ที่กำหนด อ่านเพิ่มเติมได้จาก http://www.apacheweek.com/features/userauth หรือ http://www.thaiall.com/cgi/htpasswd.pl
AuthName "User:yourname Password:yourpassword for accessing this directory" AuthType Basic require valid-user DirectoryIndex index.html index.htm index.shtml index.php
yourname:UtecEDcEa3/L2 ครั้งแรกที่สร้าง .htaccess และ .htpasswd ก็ไม่เกิดผล คือสองแฟ้มนี้ไม่ทำงาน ตรวจสอบแล้วพบว่าผู้ดูแลต้องแก้แฟ้ม /etc/httpd/conf/httpd.conf ให้ส่วนของ <Directory "/var/www/html"> ในบรรทัดที่เขียนว่า AllowOverride None เปลี่ยนเป็น AllowOverride All หรือส่วนของ <Directory "/"> ในบรรทัดที่เขียนว่า AllowOverride None เปลี่ยนเป็น AllowOverride All ถ้าท่านใช้ public_html http://www.isinthai.com/lock/index.php :: ใช้แสดงรหัสที่ผู้ใช้กำหนดขึ้น และนำไปเพิ่มในแฟ้ม .htpasswd ของ directory ที่ต้องการ lock | |
--- |
ใช้เวลาโหลดเว็บเพจ: 422 มิลลิวินาที สูง: 2253 จุด กว้าง: 1264 จุด |
"ไม่เริ่มต้นในวันนี้ จะไม่มีทางสำเร็จในวันพรุ่ง" โดย โยฮัน ว็อล์ฟกัง ฟ็อน เกอเทอ |