Apache mod_userdir.c


พอดีติดปัญหา ในการ config user_mod ให้กับ apache

Forbidden You don't have permission to access /~Account



ค้นๆ หาๆ ก็เจอคำตอบจากคุณ ผู้เรียนรู้ Fedora ที่ pantip

1.ในไฟล์ httpd.conf

#
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
#UserDir disable บรรทัดนี้ให้เอา # ออก แล้วแก้เป็น UserDir enable all

#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disable" line above, and uncomment
# the following line instead:
#
UserDir public_html



#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#




บรรทัดนี้ให้แก้เป็น
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec

Order allow,deny
Allow from all


Order deny,allow
Deny from all



2.หลังจากนั้นให้ไปสร้าง directory public_html ของแต่ละ user เช่น
user ชื่อ wara ก็ให้ไปสร้าง directory public_html ของ home directory ของ user wara
ดังนี้ mkdir /home/wara/public_html
3.สร้าง file index.html ใน directory public_html
4.restart service httpd โดยใช้คำสั่ง /etc/init.d/httpd restart
5.ทดสอบโดยเปิด Browser แล้วใส่ URL เป็น http://127.0.0.1/~wara/

6.ถ้ายังมี error ดังนี้ Forbidden You don't have permission to access /~wara on this server
ก็แสดงว่าคุณไม่ได้รับสิทธิในการเข้าไปใช้งานใน directory นั้นแก้โดยการเพิ่มสิทธิการใช้งานโดย
ใช้คำสั่ง chmod 755 /home/wara
7.ทดสอบโดยเปิด Browser แล้วใส่ URL เป็น http://127.0.0.1/~wara/
ถ้าคุณไม่ได้เซ็ตค่าอะไรแปลก ๆ เท่านี้คิดว่าก็ใช้ได้แล้ว

ก็ขอบคุณเจ้าของกระทู้ ณ ทีนี้ด้วยครับ

คำสำคัญ (Tags): #http#apache#server
หมายเลขบันทึก: 18916เขียนเมื่อ 14 มีนาคม 2006 16:27 น. ()แก้ไขเมื่อ 1 มิถุนายน 2012 17:54 น. ()สัญญาอนุญาต: จำนวนที่อ่านจำนวนที่อ่าน:


ความเห็น (0)

ไม่มีความเห็น

พบปัญหาการใช้งานกรุณาแจ้ง LINE ID @gotoknow
ClassStart
ระบบจัดการการเรียนการสอนผ่านอินเทอร์เน็ต
ทั้งเว็บทั้งแอปใช้งานฟรี
ClassStart Books
โครงการหนังสือจากคลาสสตาร์ท