ค้นๆ หาๆ ก็เจอคำตอบจากคุณ ผู้เรียนรู้ 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/
ถ้าคุณไม่ได้เซ็ตค่าอะไรแปลก ๆ เท่านี้คิดว่าก็ใช้ได้แล้ว
ก็ขอบคุณเจ้าของกระทู้ ณ ทีนี้ด้วยครับ
ไม่มีความเห็น