Quản trị net diễn đàn chia sẻ thông tin các thủ thuật mạng, internet bảo mật thông tin dành cho giới IT VIệt hy vọng là nơi bổ ích cho cộng đồng

Quản trị net diễn đàn chia sẻ thông tin các thủ thuật mạng, internet bảo mật thông tin dành cho giới IT VIệt hy vọng là nơi bổ ích cho cộng đồng (http://quantrinet.com/forum/index.php)
-   Giải Pháp Mạng - CNTT (http://quantrinet.com/forum/forumdisplay.php?f=486)
-   -   Cài đặt subversion trên nền window (http://quantrinet.com/forum/showthread.php?t=4095)

hoctinhoc 26-10-2009 01:58 PM

Cài đặt subversion trên nền window
 



Cài đặt subversion trên nền window



- Ta có thể tải bản subversion mới nhất ở http://subversion.tigris.org/
- Chọn gói subversion for Windows NT, 2000, XP and 2003
- Tiến hành cài đặt, giả sử ta cài đặt vào thư mục %Program Files/Subversion

http://gapuwq.bay.livefilestore.com/...JeKE/svn01.JPG





http://gapuwq.bay.livefilestore.com/...XRqM/svn02.JPG

- Sau khi cài đặt, ta thiết lập các biến môi trường cho subversion

http://gapuwq.bay.livefilestore.com/...6_A0/svn03.JPG
http://gapuwq.bay.livefilestore.com/...wAQk/svn04.JPG

- Sau đó ta tiếp tục tải gói TortoiseSVN ở http://tortoisesvn.tigris.org/, đây là Subvertion client được xây dựng như là một shell của window, ta sẽ sử dụng TortoiseSVN thay cho các câu lệnh commandline của svn

http://gapuwq.bay.livefilestore.com/...ortoisesvn.JPG

- Tiếp theo, ta sẽ tạo một thư mục làm Repository cho các project, ví dụ E:\Subversion Repository với TortoiseSVN thay cho lệnh commandline svn mkdir
o Tạo thư mục E:\Subversion Repository
o Vào thư mục này, click phải chuột chọn TortoiseSVN để tạo Repository

http://gapuwq.bay.livefilestore.com/...toisesvn01.JPG

o Chọn Database, có 2 loại Database, sự khác nhau giữa 2 DB này ta sẽ bàn tới ở bài viết khác, ở đây ta chọn FSFS

http://gapuwq.bay.livefilestore.com/...toisesvn02.JPG

o Sau khi tạo thành công, trong thư mục Subvertion Repository sẽ có các file và thư mục như hình

http://gapuwq.bay.livefilestore.com/...toisesvn03.JPG

- Xong bước tạo Repository, ta tiếp tục cấu hình cho Repository này
o Mở file E:\Subversion Repository\conf\ svnserve.conf, ta bỏ đi các comment bên trong
[general]
anon-access = none
auth-access = write

password-db = passwd

authz-db = authz

realm = My First Repository

- anon-access = none/read/write : cho phép user chưa thẩm định quyền truy cập có các chức năng không/đọc/ghi
- auth-access=none/read/write : cho phép user đã thẩm định quyền có các chức năng không/đọc/ghi
- password-db=passwd : chỉ ra file chứa thông tin mật khẩu là file passwd – ngang hàng với file cấu hình này
- authz-db = authz : chỉ ra file chứa thông tin phân quyền là file authz – ngang hàng với file cấu hình này
o Sau khi cấu hình file svnserve.conf, ta tiếp tục cấu hình thông tin cho 2 file passwd và authz ở trên

File paswd
[users]
phuongnhn = phuong
nguyend = nguyen
thaint = thai
tuanvd = tuan


File authz
[groups]
admin = phuongnhn,nguyend
java = phuongnhn,nguyend, tuanvd
csharp= phuongnhn,nguyend, thaint
php = phuongnhn,nguyend

[/]
@admin = rw

[/javaproject]
@java = rw
csharp = r

[/csharpproject]
@csharp = rw
Phuongnhn = r


[/]: thư mục gốc
Chỉ có nhóm admin có quyền đọc và ghi

[/javaproject]: thư mục dự án javaproject
Nhóm java có thể đọc và ghi
Nhóm csharp được phép đọc

[/csharpproject]: thư mục dự án csharpproject
Nhóm csharp được phép đọc và ghi
User phuongnhn được phép đọc

- Tới bước này ta đã cấu hình thông tin xong cho Repository, tiếp theo ta sẽ khởi động svnserver, sử dụng command-line để run server svn với câu lệnh như sau
svnserve --daemon --listen 3000 --root "E:\Subversion Repository"
trong đó,
[--daemon] hoặc [-d]: thiết lập chế độ daemon cho svn server
[--listen-port] 3000: thiết lập cổng cho svn server
Ngoài ra ta có thể dùng tham số --listen-host để xác định hostname hoặc IP
--root "E:\Subversion Repository": thư mục gốc của server
Ngoài ra có thể tải SVNService.msi để run server như một serivce (cái này chưa thử http://my.opera.com/community/graphi...s/knockout.gif ), tải tại mucdong.tk

Sau khi server đã run OK ta có thể làm việc với subversion sử dụng TortoiseSVN http://my.opera.com/community/graphi...s/knockout.gif

Tạo một project mới trong Repository theo các bước sau

http://gapuwq.bay.livefilestore.com/...toisesvn04.JPG
http://gapuwq.bay.livefilestore.com/...toisesvn05.JPG
http://gapuwq.bay.livefilestore.com/...toisesvn06.JPG
http://gapuwq.bay.livefilestore.com/...toisesvn07.JPG
http://gapuwq.bay.livefilestore.com/...toisesvn08.JPG

==> Tương tự cho việc tạo thêm các thư mục khác, hay xóa các thư muc ...

http://gapuwq.bay.livefilestore.com/...toisesvn09.JPG

Trên máy client, ta sẽ checkout thông tin từ Repository
- Tạo một thư mục để chứa thông tin dự án
- Check out các thông tin từ Repository theo các bước sau

http://gapuwq.bay.livefilestore.com/...toisesvn10.JPG
http://gapuwq.bay.livefilestore.com/...toisesvn11.JPG
http://gapuwq.bay.livefilestore.com/...toisesvn12.JPG
http://gapuwq.bay.livefilestore.com/...toisesvn13.JPG
http://gapuwq.bay.livefilestore.com/...toisesvn14.JPG

==> Một số thao tác cơ bản khác
- Tạo mới file/thư mục

http://gapuwq.bay.livefilestore.com/...toisesvn15.JPG
http://gapuwq.bay.livefilestore.com/...toisesvn16.JPG
http://gapuwq.bay.livefilestore.com/...toisesvn17.JPG
http://gapuwq.bay.livefilestore.com/...toisesvn18.JPG
http://gapuwq.bay.livefilestore.com/...toisesvn19.JPG

Trước mỗi bước commit những thông tin mới lên server ta nên tiến hành update lại những thay đổi mới từ server để svn merge lại các thông tin mới này tránh conflict

http://gapuwq.bay.livefilestore.com/...toisesvn20.JPG

Sau khi update ta có thể commit lại server những thay đổi ở client

http://gapuwq.bay.livefilestore.com/...toisesvn21.JPG
http://gapuwq.bay.livefilestore.com/...toisesvn22.JPG
http://gapuwq.bay.livefilestore.com/...toisesvn23.JPG
http://gapuwq.bay.livefilestore.com/...toisesvn24.JPG

- Các chức năng như Xóa file/thư mục, So sánh các phần khác nhau giữa các version của một file chúng ta có thể tham khảo trong Help của TortoiseSVN

http://gapuwq.bay.livefilestore.com/...toisesvn25.JPG


Theo: NGUYEND's blog

:battay:


Bây giờ là 01:51 PM. Giờ GMT +7

Diễn đàn tin học QuantriNet
quantrinet.com | quantrimang.co.cc
Founded by Trương Văn Phương | Developed by QuantriNet's members.
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.