Friday, November 2, 2007

กำหนดให้user ที่ใช้งาน server สามารถสร้างเวบของตัวเองได้

เข้าไป config ใน ไฟล์
#vi /etc/httpd/conf/httpd.conf
แก้ไขโดย comment บรรทัดนี้
#UserDir disabled

เอา comment บรรทัดนี้ออก
UserDir public_html

กำหนด access control โดย เอา comment ส่วนนี้ออก


เสร็จแล้วsave แล้ว restart http
แค่นี้ user ก็สามารถสร้างหน้าเวบของตัวเองใน home directory ของตัวเองภายในชื่อ folder public_html
เช่น
[tum@localhost ~]$ cd public_html/
[tum@localhost public_html]$ ls
index.php
[tum@localhost public_html]$ vi index.php

อย่าลืมเปลี่ยน permition directory public_html เป็น 755 หรืออะไรก็ได้ทีคนทั่วไปสามารถเรียกดูข้อมูลได้ครับ
#chmod 755 -R public_html

การเรียกหน้าเวบก็
http://localhost/~tum/

ก็เป็นอันเสร็จเรียบร้อยครับ

No comments: