Never ask how to use, just wonder how to make...

Dec 23, 2010

Cài đặt server SVN trên nền CentOS

Subversion (SVN) là một phần mềm mã nguồn mở dùng để quản lý và kiểm tra các phiên bản mã nguồn khác nhau trong quá trình phát triển phần mềm.
Trong bài viết này tôi sẽ trình bày các bước thiết lập một máy chủ Subversion trên nền hệ điều hành CentOS. Bài hướng dẫn này bao gồm các nội dung chính:
- Cài đặt subversion và cách tạo một repository mới
- Thiết lập WebDAV để có thể sử dụng SVN qua giao thức HTTP
Bạn cần hiểu về các khái niệm của SVN trước khi cài đặt. Có thể tham khảo ở link sau: http://svnbook.red-bean.com/en/1.5/svn.basic.html

1. Cài đặt Subversion
Trên Centos, cài đặt subversion rất đơn giản, bạn chỉ cần sử dụng lệnh yum:
# yum install subversion

2. Bước tiếp theo sẽ là tạo một repository mới. Giả sử bạn đã có thư mục /services/subversion, và muốn tạo repository mới ở đây, tên là new_project. Các lệnh để thiết lập như sau:
# svnadmin create --fs-type fsfs /services/subversion/repositories/new_project

3. Cài đặt và cấu hình mod_dav_svn của Apache
WebDAV (RFC 2518) là một tập hợp các chuẩn mở rộng của giao thức HTTP, để cho phép nhiều người dùng có thể hợp tác sửa đổi và quản lý từ xa các file trên một webserver. Được viết dựa trên tập chuẩn WebDAV, module dav_svn của Apache cho phép chúng ta truy cập repository SVN của mình thông qua máy chủ web Apache.
- Cài đặt mod_dav_svn:
# yum install mod_dav_svn
- File /etc/httpd/conf.d/subversion.conf:
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
< Location /repos/ >
DAV svn
SVNParentPath /services/subversion/repositories/
AuthzSVNAccessFile /services/subversion/auth/acl
SVNListParentPath on
SVNPathAuthz off
AuthType Basic
AuthName "SVN Center"
AuthUserFile /services/subversion/auth/account
Require valid-user
</Location >
Các tham số quan trọng của file subversion.conf:
Tham số Location quy định URL SVN của bạn (VD: http://example.com/repos/new_project).
Tham số SVNParentPath khai báo đường dẫn tới thư mục chứa các repository.
Tham số AuthUserFile khai báo đường dẫn tới file chứa các tài khoản người dùng SVN.
Giá trị của tham số AuthzSVNAccessFile là đường dẫn đầy đủ của file cấu hình ACL, có chức năng phân quyền cho người dùng.
- Tạo thư mục auth:
# mkdir /services/subversion/auth
- Tạo file tài khoản:
# touch /services/subversion/auth/account
- Tạo file access control list:
# touch services/subversion/auth/acl
- Restart Apache:
# service httpd restart

4. Để có thể sử dụng repository new_project ta đã tạo ở bước 2, cần thiết lập permission cho phép Apache sử dụng thư mục repository (giả sử Apache đang được chạy bởi user apache):
# chown -R apache:apache /services/subversion/repositories/new_project
# chmod -R g+w /services/subversion/repositories/new_project
# chmod g+s /services/subversion/repositories/new_project/db

5. Tạo một tài khoản SVN mới bằng lệnh (hệ thống sẽ yêu cầu bạn khai báo mật khẩu cho tài khoản này):
# htpasswd -m /services/subversion/auth/account svn_user

6. Cấp quyền truy cập cho tài khoản svn_user bằng cách khai báo repository và tài khoản vào file acl như sau:
[new_project:/]
svn_user = rw

Như vậy, tài khoản svn_user sẽ có quyền đọc và ghi đối với repository new_project. Bạn có thể check out repository của mình thông qua URL http://example.com/repos/new_project với tài khoản trên.
Nếu bạn muốn tạo thêm một repository mới, hãy thực hiện lại các bước 2, 4, 5, 6.

Để tìm hiểu thêm về cách cài đặt và cấu hình Subversion, bạn hãy đọc chương 5 của ebook: http://svnbook.red-bean.com/en/1.5/svn-book.html


Dec 4, 2010

Google sắp mở Chrome Web Store


Đang code thì nhận được email từ team Chrome/Chromium. Như vậy là Google sắp tung ra chiêu mới: Web Store, để chọn đường cho việc kinh doanh apps trên Chrome OS sau này. Các bạn tập tành viết app dần đi, sắp bán được rồi đấy ^^.


Upcoming Launch of the Chrome Web Store

Hello!

Thank you for developing for Google Chrome. These last few months, our team has been hard at work, preparing for the Chrome Web Storelaunch later this year. Extensions and themes for Google Chrome will be part of this new store. With this email we wanted to inform you of some upcoming developments and changes in the extensions gallery and how you can best prepare the items you have listed in the gallery for the upcoming launch.

  1. We have updated our guidelines for extension and theme creative assets: We recommend you to produce all the creative materials described in our docs. These are currently available only to apps developers but the same guidelines will apply to all items listed in the store once we launch. So, if you get these prepared now, you are going to be ready when the store launches. For those of you with complex extensions, we also highly recommend investing some time in preparing videos and slideshows, describing how your extensions work.

  1. Double-check our branding policies: If you are using Google trademarks and brand names to describe your items, please take a moment to re-read our branding policies to help you avoid common mistakes.

  1. Verify your listed items using Google’s Webmaster Tools: This new feature allows you to associate your website with the items you have posted in the store. This will make users more comfortable trying them out. Access this feature at the developer dashboard.

  1. Set up your Google Checkout merchant account and associate it with your developer account: If you are located in the US and want to sell apps and eventually extensions or themes through the store, you’ll need to register for a Google Checkout merchant account. You can find more information on this new help article.

  1. Make your extensions more discoverable: We will be launching a robust system of extensions categories in the gallery. You now have the option to classify your extension in up to three of these categories through the developer dashboard. This will help your extension be discovered by users who will be browsing the pages for each category.

Thank you again for making Google Chrome a better browser.

The Google Chrome Extensions team