분류없음2010/01/27 17:20
Linux2010/01/27 15:32
출처 : http://blog.naver.com/fragboom/memo/140099325806
1. 설치
설치파일은 직접 svn 홈페이지에서 받아오는 방법도 있지만
기본적인 yum을 이용해서 받고 설치해보자.
#yum list subversion
이라고 치면
subversion.x86_64
subversion.i386
이렇게 나온다.
해당 os의 bit에 맞추어 인스톨하자.
2. Repository 생성
우선 repository를 생성해보자.
#mkdir /data/svn (원하는폴더)
#svnadmin create --fs-type fsfs project (원하는 작업폴더이름)
이렇게 하면 /data/svn/project 이런식으로 생성되며 파일 타입은 fsfs (일반 파일시스템구조이다)
여기서 파일시스템 구조 및 Berkeley DB를 선택할수 있는데
Berkeley DB는
http://www.oracle.com/technology/software/products/berkeley-db/db/index.html
여기서 다운받아 쓸수 있으며
일반적으로 파일시스템구조가 관리에 용이 하다고 한다.( 디렉토리/파일 구조)
3. 환경설정
기본적인 환경설정 및 아이디 계정 및 암호를 관리하자.
/data/svn/project/conf/svnserve.conf 수정
------
[general]
anon-access = none 익명사용자는 읽지도 쓰지도 못한다.
auth-access = write 인증사용자는 쓰기도 가능하다.
password-db = passwd 암호가 들어있는 파일명이다
authz-db = authz 인증사용자 정보가 있는 파일명
realm = project Repository 첫번째 repository를 적어준다. (ex: project)
--------------------
/data/svn/project/conf/authz 수정
--------
[groups]
developer = kim, young, park
designer = song
[project:/]
@developer = rw
[project:/web/game]
@designer = rw
[project:/web/html]
@designer = rw
[project:/web/image]
@designer = rw
[project:web/js]
@designer = rw
---------------
이렇게 developer 와 designer 의 접근 가능 폴더를 정해줄수 있다.
/data/svn/project/conf/passwd 수정
-------
[users]
kim = kimpasswd
young = 1234
park = parking123
----
이런식으로 아이디 = 암호 설정을 해준다.
여기까지 설정이 다 된 상태이며
이제 svn daemon 을 가동시켜보자.
[root@mediare bin]# svnserve --help
사용법: svnserve [options]
옵션 목록:
-d [--daemon] : 데몬 모드
--listen-port arg : 리슨 포트 (데몬 모드)
--listen-host arg : 리슨 호스트명 혹은 IP 주소 (데몬 모드)
--foreground : 포어그라운드로 실행 (디버깅용)
-h [--help] : 이 도움말을 출력함
--version : 프로그램 버젼 정보를 보여줍니다
-i [--inetd] : inetd 모드
-r [--root] arg : 서비스를 제공할 루트 디렉토리
-R [--read-only] : 저장소 구성화일을 무시하고. 읽기 전용으로 바꿈.
-t [--tunnel] : 터널 모드
--tunnel-user arg : 터널 사용자명 (생략값은 현재 uid의 이름)
-T [--threads] : fork대신 thread 사용합니다.
-X [--listen-once] : 1 회만 listen 합니다. (디버깅에 사용됩니다.)
--pid-file arg : 서버 프로세스 ID를 file 인자에 기록
# svnserve -d -r /data/svn &
이렇게 실행시키면 기본포트인 3690 으로 listen 하게 된다.
접속은 svn client를 이용해야한다.
------------------------------------------- 추가 -------------------------------------------
[SVN]수정 명령의 루트를 열 수 있는 권할을 얻지 못하였습니다
SVN과 함께 작업을 하다가 종종 아래와 같은 메세지를 얻는경우가 있다.
"수정 명령의 루트를 열 수 있는 권할을 얻지 못하였습니다."
영문으로는 "svn: Not authorized to open root of edit operation" 이다.
이 Error의 해결방법은 다음과 같다.
svnserve.conf 파일의 anon-access 권한을 none 으로하면된다.
anon-access=none
이외 두번재 방법은 만약 anon-access=read로 한경우 authz-db 파일에 폴더 접근 설정을 아래와 같이하면된다.
[/]
* = r
TAG svn
Java2010/01/26 09:30
http://qurl.net/1YU
http://rurl.org/808
http://jtty.com/cuy
http://elfurl.com/li4na
http://shurl.org/pHbnD
http://shrinkster.com/s9y
http://tinyurl.com/yvvtag
http://clipurl.com/?PAP269
http://shorl.com/dihyfradiduba
와 같은 URL Shortening Service 의 결과물로 생성된 Shorten URL 의 Original URL 을 찾아내는 프로그램 소스를 간단히 코딩해보았음. (HTTP Protocol 규약중 301 Moved 을 이용)
/**
* Shorten URL 의 Expanded URL 을 찾아서 반환한다. (HTTP 301 Moved Protocol 이용)
* @param shortenUrl
* @return
*/
public String getExpandedUrl(String shortenUrl){
String redirectUrl = null;
try{
URL url = new URL(shortenUrl);
String resHost = url.getHost();
HttpURLConnection connection = (HttpURLConnection) url.openConnection(Proxy.NO_PROXY); //using proxy may increase latency
connection.setInstanceFollowRedirects(false);
connection.connect();
redirectUrl = connection.getHeaderField("Location");
connection.getInputStream().close();
if(redirectUrl!=null){
if(redirectUrl.toLowerCase().startsWith("http")){
URL exUrl = new URL(redirectUrl);
if(exUrl.getHost().toLowerCase().equals(resHost)){
redirectUrl = null;
}
}else{
redirectUrl = null;
}
}
}catch(Exception ex){
ex.printStackTrace();
}
return redirectUrl;
}
@Test
public void testGetExpandedUrl() {
Logger.debug(this,"testGetExpandedUrl started");
String[] testAddress = {
"http://bit.ly/6I8gfz", "http://www.msn.co.kr", "http://www.microsoft.com", "http://news.naver.com"
};
for(String address : testAddress){
String expandedUrl = this.getExpandedUrl(address);
Logger.debug(this,"URL [" + address + "] -> " + ((expandedUrl==null) ? "(not found)" : expandedUrl) + ")");
}
Logger.debug(this,"testGetExpandedUrl finished");
}