8/1/12

TẠO WEBSITE CHO NGƯỜI DÙNG


1.1.1.     TẠO WEBSITE CHO NGƯỜI DÙNG

Mô hình và yêu cầu bài tập

Hướng dẫn thực hiện

a.      Tạo userdir
1)     Khai báo UserDir
2)     Cập quyền hạn truy cập
b.      Reload web service
c.      Kiểm tra hoạt động của trang web

Các bước thực hiện

a)   Bước 1: Kiểm tra hoạt động của trang web http://www.serverlinux.vn
b)  Bước 2: Cấu hình tập tin httpd.conf cho phép tạo trang web cá nhân cho user. Thêm vào các dòng như bên dưới:
Dòng 355 đổi thành: UserDir www
Thêm vào code từ dòng 384 đến dòng 295
<Directory /home/*/www>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
      Order allow,deny
      Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
      Order deny,allow
      Deny from all
</LimitExcept>
</Directory>
c)   Bước 3: Tạo các user hv1 và hv2 bằng các câu lệnh như bên dưới:
[root@localhost ~]# useradd hv1
[root@localhost ~]# passwd hv1
Changing password for user hv1.
New UNIX password:
BAD PASSWORD: it is WAY too short
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@localhost ~]# useradd hv2
[root@localhost ~]# passwd hv2
Changing password for user hv2.
New UNIX password:
BAD PASSWORD: it is WAY too short
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
d)  Bước 4: Tạo trang web cá nhân trên user hv1
-      Tạo thư mục www:
[hv1@Webserver ~]$ mkdir www
[hv1@Webserver ~]$ ls
bootstat.dat  explorer.scf  history.txt  JRE32.dll
explorer.exe  FaxSetup.log  index.html   www
-      Tạo tập tin www/index.html
[hv1@Webserver ~]$vi index.html
<html>
<body>
Day la trang web cua user hv1
</body>
</html>
-      Phân quyền truy cập
#chmod 711 /home/*
#chmod 755 /home/hv1/www.index.html
e)   Bước 5: Truy cập vào trang web http://www.serverlinux.vn/~hv1
f)    Bước 6: Làm tương tự cho user hv2

Bài đăng phổ biến