close

2. 個人網站:public_html

(1)建立目錄及index.html
#chmod 701 /home/student
#su - student
[student@server118 ~]$
$mkdir public_html

%可以在/etc/skel 先設定, useradd會自動幫user建立public_html目錄

[student@server118 ~]$ cat > index.html Student public homepage
> student public homepage
> ookk
[student@server118 ~]$


(2)修改SElinux指紋

[root@server118 public_html]# restorecon -R /home/student/public_html
[root@server118 public_html]# ll -Z
-rw-rw-r-- student student root:object_r:httpd_sys_content_t index.html

(3)建立soft link
*未建立link前
http://server118.example.com/~student

* 建立link (比較方便user使用)
#ln -s /home/student/public_html /var/www/html/student
http://server118.example.com/student

(4) vi /etc/httpd/conf/httpd.conf
---略---
# 加"#" 打開UserDir
#UserDir disable
---略---
# 把"#"拿掉, UserDir=$HOME/public_html
UserDir public_html
---略---

(5)重新啟動httpd
#service httpd restart


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 aquatower 的頭像
    aquatower

    2006隨手札記

    aquatower 發表在 痞客邦 留言(0) 人氣()