12. MediaTomb 설치 - UPnP 또는 DLNA [NAS 구축기][ubuntu 10.4]

얼렁뚱땅설명서 2012. 3. 20. 03:02

요즘은 고민이 되는 것이 좀 있다. 우분투 12.04 LTS 버전이 조만간 출시될 텐데 10.04에서 계속 이런 포스트를 올려야 하나??
뭐, 12.04가 나왔다고 별다르게 바뀌는 것이 있겠냐 마는..... 오늘은 Media Tomb을 설치한다.


유니버설 플러그 앤 플레이
 (UPnP)는 UPnP 포럼이 공표한 컴퓨터 네트워크 프로토콜의 집합이다. UPnP의 목표는 장치들을 부드럽게 연결하고 가정 네트워크와 회사 환경의 기능(데이터 공유, 통신, 엔터테인먼트)을 단순화하는 것이다. UPnP는 개방된 인터넷 기반의 통신 표준 기반의 UPnP 장치 제어 프로토콜을 정의하고 출판함으로써 이를 달성한다.
UPnP라는 용어는 컴퓨터에 직접 장치를 유동적으로 부착하는 기술인 플러그 앤 플레이에서 비롯한 것이다.


DLNA(디지털 리빙 네트워크 얼라이언스, Digital Living Network Alliance)는 소니가 2003년 6월에 설립한 비영리 단체로, 모바일, 가전 기기, PC, 서비스 제공자 산업의 250개 이상의 회사와 연계하고 있다. 2003년 6월에 디지털 홈 워킹 그룹(Digital Home Working Group)이라는 이름으로 설립되었다가, DNLA의 가이드라인이 확립되어 공표된 12개월 후에 현재의 이름으로 자리잡혔다.


Media Tomb은 UPnP 또는 DLNA을 대표(?)하는 프로그램이다. UPnPDLNA에 대해 위키백과에서는 위와 같이 정의 하고 있다. 이것이 뭐하는 것이냐 하면, 한마디로 영화-음악-사진 등을 간편하게 시청 감상할 수 있는 서비스를 지원 한다는 것이다. 어디서? 당신이 가지고 있는 스마트 폰이나 랜케이블을 꼽을 수 있거나 무선랜 카드를 장작할 수 있는 최신 스마트 TV를 가지고 있다면 말이다.
한계성이라고 한다면... 디지털 리빙 네트워크라는 말처럼 집(서버가 있는 네트워크에서만 ... )에서만 된다는 것이다. 

우분투에서  Media Tomb 의 설치는 매우 간단하다. 아래와 같이 명령을 내리면 된다. 이런 간편함은 우분투의 축복이다.

user@Team4Svr:~$ sudo -s
root@Team4Svr:~# apt-get install mediatomb
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
다음 패키지를 더 설치할 것입니다:
  libffmpegthumbnailer4 libswscale0 mediatomb-common mediatomb-daemon
다음 새 패키지를 설치할 것입니다:
  libffmpegthumbnailer4 libswscale0 mediatomb mediatomb-common mediatomb-daemon
0개 업그레이드, 5개 새로 설치, 0개 지우기 및 10개 업그레이드 안 함.
1,243k바이트 아카이브를 받아야 합니다.
이 작업 후 3,432k바이트의 디스크 공간을 더 사용하게 됩니다.
계속 하시겠습니까 [Y/n]?
받기:1 http://ftp.daum.net/ubuntu/ lucid-updates/main libswscale0 4:0.5.1-1ubuntu1.3 [175kB]
받기:2 http://ftp.daum.net/ubuntu/ lucid/universe libffmpegthumbnailer4 2.0.0-1 [31.2kB]
받기:3 http://ftp.daum.net/ubuntu/ lucid/universe mediatomb-common 0.12.0~svn2018-6ubuntu2 [991kB]
받기:4 http://ftp.daum.net/ubuntu/ lucid/universe mediatomb-daemon 0.12.0~svn2018-6ubuntu2 [24.2kB]
받기:5 http://ftp.daum.net/ubuntu/ lucid/universe mediatomb 0.12.0~svn2018-6ubuntu2 [21.8kB]
내려받기 1,243k바이트, 소요시간 0초 (2,122k바이트/초)
전에 선택하지 않은 libswscale0 패키지를 선택합니다.
(데이터베이스 읽는중 ...현재 163341개의 파일과 디렉토리가 설치되어 있습니다.)
libswscale0 패키지를 푸는 중입니다 (.../libswscale0_4%3a0.5.1-1ubuntu1.3_amd64.deb에서) ...
전에 선택하지 않은 libffmpegthumbnailer4 패키지를 선택합니다.
libffmpegthumbnailer4 패키지를 푸는 중입니다 (.../libffmpegthumbnailer4_2.0.0-1_amd64.deb에서) ...
전에 선택하지 않은 mediatomb-common 패키지를 선택합니다.
mediatomb-common 패키지를 푸는 중입니다 (.../mediatomb-common_0.12.0~svn2018-6ubuntu2_amd64.deb에서) ...
전에 선택하지 않은 mediatomb-daemon 패키지를 선택합니다.
mediatomb-daemon 패키지를 푸는 중입니다 (.../mediatomb-daemon_0.12.0~svn2018-6ubuntu2_all.deb에서) ...
전에 선택하지 않은 mediatomb 패키지를 선택합니다.
mediatomb 패키지를 푸는 중입니다 (.../mediatomb_0.12.0~svn2018-6ubuntu2_all.deb에서) ...
man-db에 대한 트리거를 처리하는 중입니다 ...
ureadahead에 대한 트리거를 처리하는 중입니다 ...
ureadahead will be reprofiled on next reboot
desktop-file-utils에 대한 트리거를 처리하는 중입니다 ...
python-gmenu에 대한 트리거를 처리하는 중입니다 ...
Rebuilding /usr/share/applications/desktop.ko_KR.utf8.cache...
python-support에 대한 트리거를 처리하는 중입니다 ...
libswscale0 (4:0.5.1-1ubuntu1.3) 설정하는 중입니다 ...

libffmpegthumbnailer4 (2.0.0-1) 설정하는 중입니다 ...

mediatomb-common (0.12.0~svn2018-6ubuntu2) 설정하는 중입니다 ...
mediatomb-daemon (0.12.0~svn2018-6ubuntu2) 설정하는 중입니다 ...
* Starting upnp media server mediatomb                                                      [ OK ]

mediatomb (0.12.0~svn2018-6ubuntu2) 설정하는 중입니다 ...

libc-bin에 대한 트리거를 처리하는 중입니다 ...
ldconfig deferred processing now taking place
root@Team4Svr:~#



설치는 잘 끝난 모양이다. 그럼 이제 뭘하지? 설치되고난 터미널을 보면 막막하다. Media Tomb은 자신의 설정을 위해 웹 인터페이스를 제공하는데 포트가 워낙 난잡하고 알기 어렵다.  Media Tomb의 서비스 포트를 알기 위해서는 아래의 명령어를 입력하여 확인하는 방법도 있다.
netstat -lnp로 보면 49152 포트에서 대기하고 있다고 표시되어 있다. 

root@Team4Svr:~# netstat -lnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      11195/smbd
tcp        0      0 0.0.0.0:49152           0.0.0.0:*               LISTEN      21171/mediatomb
tcp        0      0 0.0.0.0:3689            0.0.0.0:*               LISTEN      1328/mt-daapd
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      11195/smbd
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      841/sshd
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      1351/cupsd
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      1299/master
tcp6       0      0 :::22                   :::*                    LISTEN      841/sshd
tcp6       0      0 ::1:631                 :::*                    LISTEN      1351/cupsd
udp        0      0 0.0.0.0:53930           0.0.0.0:*                           868/avahi-daemon: r
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           868/avahi-daemon: r
udp        0      0 0.0.0.0:1900            0.0.0.0:*                           21171/mediatomb
udp        0      0 192.168.10.5:137        0.0.0.0:*                           1523/nmbd
udp        0      0 0.0.0.0:137             0.0.0.0:*                           1523/nmbd
udp        0      0 192.168.10.5:138        0.0.0.0:*                           1523/nmbd
udp        0      0 0.0.0.0:138             0.0.0.0:*                           1523/nmbd
udp        0      0 127.0.0.1:59671         0.0.0.0:*                           21171/mediatomb


netstat -lnp 확인한 포트를 서버 IP 뒤에 붙여 입력하면 아래와 같은 설정페이지륻 얻을 수 있다. Filesystem 탭에서 서비스할 폴더를 선택하여 (+) 버튼을 클릭하면 바로 서비스를 시작한다. Database 탭에서는 아이템을 삭제하거나 편집할 수 있다.
인터페이스는 매우 간단하고 심플하다.



netstat 와 같은 터미널 친화적인 명령어로 포트를 확인하고 그런 것이 싫다면, 우아하게 그래픽 터미널에서 Media Tomb 설정 화면을 띄울 수 있다. 본인의 경우에는 그래픽 터미널을 띄우기 싫어 그냥 터미널을 좋아한다.



하여간, 본인은 스마트 TV가 없으므로 대신 스마트 폰으로 테스트 하겠다. 스마트 폰 앱은 UPnP나 DLNA로 검색하면 된다.
본인은 WOON이라는 앱을 받아 사용한다. 아래는 흔한 UPnP-DLNA 앱 화면 되겠다.







11. ffmpeg + AirVideo Server 설치 [NAS 구축기][ubuntu 10.4]

얼렁뚱땅설명서 2012. 3. 6. 10:58


ffmpeg는 인코딩 프로그램을 유명하다. Airvideo Server을 설치하기 전에 먼저 설치하는 이유는  Airvideo Server가 더 훌륭해 지거나 Live Conversion이 매우 빠르게 수행될 것 같은 느낌 때문이다. 근거는 없다. 

ffmpeg는 컴파일을 해야하므로 일단, 시스템을 업데이트 하고 기본적인 컴파일 도구를 설치한다.
덤으로 인코딩에 사용할 여러개의 라이브러리도 설치한다. 명령어가 조금 길다.

username@Team4Svr:~$ sudo -s
root@Team4Svr:~#  apt-get update
.......
.......
....... 
 
패키지 목록을 읽는 중입니다... 완료
root@Team4Svr:~# apt-get install build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libvorbis-dev libvpx-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
build-essential 패키지는 이미 최신 버전입니다.
.....
.....
..... 
0개 업그레이드, 61개 새로 설치, 0개 지우기 및 0개 업그레이드 안 함.
28.1M바이트 아카이브를 받아야 합니다.
이 작업 후 86.7M바이트의 디스크 공간을 더 사용하게 됩니다.
계속 하시겠습니까 [Y/n]?
.....
.....
너무 길어서 이하생략
.....
.....
libxvidcore-dev (2:1.2.2+debian-0ubuntu2) 설정하는 중입니다 ...
subversion (1.6.6dfsg-2ubuntu1.3) 설정하는 중입니다 ...
texi2html (1.82-1) 설정하는 중입니다 ...
yasm (0.8.0-1) 설정하는 중입니다 ...
libc-bin에 대한 트리거를 처리하는 중입니다 ...
ldconfig deferred processing now taking place



x264 라이브러리를 설치한다. x264는 H.264의 구현으로 '매우 높은 데이터 압축률을 가지는 디지털 비디오 코덱 표준으로 MPEG-4 파트 10 또는 MPEG-4/AVC(고급 비디오 부호화, Advanced Video Coding)라 부르기도 한다.-한국위키-'....... 하여간 좋은 거다.;
 

root@Team4Svr:~# cd
root@Team4Svr:~# git clone git://git.videolan.org/x264.git
Initialized empty Git repository in /home/fishingday/x264/.git/
remote: Counting objects: 15359, done.
remote: Compressing objects: 100% (2923/2923), done.
remote: Total 15359 (delta 12578), reused 15174 (delta 12395)
Receiving objects: 100% (15359/15359), 3.80 MiB | 749 KiB/s, done.
Resolving deltas: 100% (12578/12578), done.
root@Team4Svr:~# cd x264
root@Team4Svr:~/x264#
root@Team4Svr:~/x264# ./configure   <--- yasm 버전이 낮다고 한다. 아래와 같이 한다.
Found yasm 0.8.0.2194
Minimum version is yasm-1.0.0
If you really want to compile without asm, configure with --disable-asm.
root@Team4Svr:~/x264# ./configure --enable-shared --disable-asm
platform:      X86_64
system:        LINUX
cli:           yes
libx264:       internal
shared:        yes
static:        no
asm:           no
interlaced:    yes
avs:           no
lavf:          no
ffms:          no
gpac:          no
gpl:           yes
thread:        posix
filters:       crop select_every
debug:         no
gprof:         no
strip:         no
PIC:           yes
visualize:     no
bit depth:     8
chroma format: all

You can run 'make' or 'make fprofiled' now.
root@Team4Svr:~/x264#
isualize:     no
bit depth:     8
chroma format: all

You can run 'make' or 'make fprofiled' now.
root@Team4Svr:~/x264# checkinstall --pkgname=x264 --pkgversion "2:0.`grep X264_BUILD x264.h -m1 | cut -d' ' -f3`.`git rev-list HEAD | wc -l`+git`git rev-list HEAD -n 1 | head -c 7`" --backup=no --deldoc=yes --fstrans=no --default

checkinstall 1.6.1, Copyright 2002 Felipe Eduardo Sanchez Diaz Duran
           This software is released under the GNU GPL.


The package documentation directory ./doc-pak does not exist.
Should I create a default set of package docs?  [y]: y

Preparing package documentation...OK

*****************************************
**** Debian package creation selected ***
*****************************************

This package will be built according to these values:

0 -  Maintainer: [ root@Team4Svr ]
1 -  Summary: [ Package created with checkinstall 1.6.1 ]
2 -  Name:    [ x264 ]
3 -  Version: [ 2:0.120.2164+gitda19765 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ checkinstall ]
7 -  Architecture: [ amd64 ]
8 -  Source location: [ x264 ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ x264 ]

Enter a number to change any of them or press ENTER to continue:

Installing with make...Installing with install...

========================= Installation results ===========================
....
.... 생략...
....
======================== Installation successful ==========================

Copying documentation directory...
./
./AUTHORS
./doc/
./doc/vui.txt
./doc/standards.txt
./doc/threads.txt
./doc/regression_test.txt
./doc/ratecontrol.txt
./COPYING
grep: /var/tmp/tmp.llEegCHGR8/newfile: 그런 파일이나 디렉터리가 없습니다

Some of the files created by the installation are inside the build
directory: /home/fishingday/x264

You probably don't want them to be included in the package,
especially if they are inside your home directory.
Do you want me to list them?  [n]: n
Should I exclude them from the package? (Saying yes is a good idea)  [y]: y

Copying files to the temporary directory...OK

Stripping ELF binaries and libraries...OK

Compressing man pages...OK

Building file list...OK

Building Debian package...OK

Installing Debian package...OK

Erasing temporary files...OK

Deleting doc-pak directory...OK

Deleting temp dir...OK


**********************************************************************

 Done. The new package has been installed and saved to

 /home/fishingday/x264/x264_2:0.120.2164+gitda19765-1_amd64.deb

 You can remove it from your system anytime using:

      dpkg -r x264

**********************************************************************

root@Team4Svr:~/x264#


 이제 ffmpeg를 설치해 준다.

root@Team4Svr:~# cd
root@Team4Svr:~# svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
....
....
A    ffmpeg/MAINTAINERS
A    ffmpeg/COPYING.LGPLv3
 U   ffmpeg
체크아웃된 리비전 26402.
root@Team4Svr:~# cd ffmpeg
root@Team4Svr:~/ffmpeg# ./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
.......
.......
.......
Enabled bsfs:
aac_adtstoasc           mjpeg2jpeg              mp3_header_decompress
chomp                   mjpega_dump_header      noise
dump_extradata          mov2textsub             remove_extradata
h264_mp4toannexb        mp3_header_compress     text2movsub
imx_dump_header

Enabled indevs:
alsa                    oss                     v4l2
dv1394                  v4l                     x11_grab_device

Enabled outdevs:
alsa                    oss

License: nonfree and unredistributable
Creating config.mak and config.h...
root@Team4Svr:~/ffmpeg# make
CC      libavdevice/alldevices.o
CC      libavdevice/alsa-audio-common.o
CC      libavdevice/alsa-audio-dec.o
CC      libavdevice/alsa-audio-enc.o
CC      libavdevice/avdevice.o
.....
.....
.....
POD     doc/ffmpeg.pod
MAN     doc/ffmpeg.1
POD     doc/ffplay.pod
MAN     doc/ffplay.1
POD     doc/ffprobe.pod
MAN     doc/ffprobe.1
POD     doc/ffserver.pod
MAN     doc/ffserver.1
root@Team4Svr:~/ffmpeg# checkinstall --pkgname=ffmpeg --pkgversion "4:SVN-r`LANG=C svn info | grep Revision | awk '{ print $NF }'`" --backup=no --deldoc=yes --fstrans=no --default
....
....
....
Copying files to the temporary directory...OK

Stripping ELF binaries and libraries...OK

Compressing man pages...OK

Building file list...OK

Building Debian package...OK

Installing Debian package...OK

Erasing temporary files...OK

Deleting doc-pak directory...OK

Deleting temp dir...OK


**********************************************************************

 Done. The new package has been installed and saved to

 /home/fishingday/ffmpeg/ffmpeg_4:SVN-r26402-1_amd64.deb

 You can remove it from your system anytime using:

      dpkg -r ffmpeg

**********************************************************************

root@Team4Svr:~/ffmpeg# hash x264 ffmpeg ffplay
root@Team4Svr:~/ffmpeg# make tools/qt-faststart
CC      tools/qt-faststart.o
LD      tools/qt-faststart
rm tools/qt-faststart.o
root@Team4Svr:~/ffmpeg# checkinstall --pkgname=qt-faststart --pkgversion "4:SVN-r`LANG=C svn info | grep Revision | awk '{ print $NF }'`" --backup=no --deldoc=yes --fstrans=no --default install -D -m755 tools/qt-faststart /usr/local/bin/qt-faststart

checkinstall 1.6.1, Copyright 2002 Felipe Eduardo Sanchez Diaz Duran
           This software is released under the GNU GPL.


The package documentation directory ./doc-pak does not exist.
Should I create a default set of package docs?  [y]: y

Preparing package documentation...OK

*****************************************
**** Debian package creation selected ***
*****************************************

This package will be built according to these values:

0 -  Maintainer: [ root@Team4Svr ]
1 -  Summary: [ Package created with checkinstall 1.6.1 ]
2 -  Name:    [ qt-faststart ]
3 -  Version: [ 4:SVN-r26402 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ checkinstall ]
7 -  Architecture: [ amd64 ]
8 -  Source location: [ ffmpeg ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ qt-faststart ]

Enter a number to change any of them or press ENTER to continue:

Installing with install...Installing with -D...Installing with -m755...Installing with tools/qt-faststart...Installing with /usr/local/bin/qt-faststart...

========================= Installation results ===========================

======================== Installation successful ==========================

.......
.......
.......

Copying files to the temporary directory...OK

Stripping ELF binaries and libraries...OK

Compressing man pages...OK

Building file list...OK

Building Debian package...OK

Installing Debian package...OK

Erasing temporary files...OK

Deleting doc-pak directory...OK

Deleting temp dir...OK


**********************************************************************

 Done. The new package has been installed and saved to

 /home/fishingday/ffmpeg/qt-faststart_4:SVN-r26402-1_amd64.deb

 You can remove it from your system anytime using:

      dpkg -r qt-faststart

**********************************************************************

root@Team4Svr:~/ffmpeg#

짜잔 FFmpeg의 설치가 끝났다. CentOS에서 설치할땐 하루 종일 걸렸던 것 같은데.... 우분투에선 금방 이다. 
그럼 이제 ffmpeg를 실행 해 보자. 기대와 달리 실행할 수 없다는 오류를 냉큼 떨어뜨린다. ㅡㅡ;

root@Team4Svr:~/ffmpeg# ffmpeg
ffmpeg: error while loading shared libraries: libx264.so.120: cannot open shared object file: No such file or directory
root@Team4Svr:~/ffmpeg#

 공유 라이브러리를 찾을 수 없다는 오류 이므로, 아래와 같은 조치를 취한 후 다시 실행해 준다.

root@Team4Svr:~/ffmpeg# vi /etc/ld.so.conf
include /etc/ld.so.conf.d/*.conf

/usr/local/lib   <--- 추가하고 저장 한다.
~
root@Team4Svr:~/ffmpeg# ldconfig
root@Team4Svr:~/ffmpeg# ffmpeg
FFmpeg version SVN-r26402, Copyright (c) 2000-2011 the FFmpeg developers
  built on Mar  6 2012 10:44:30 with gcc 4.4.3
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
  libavutil     50.36. 0 / 50.36. 0
  libavcore      0.16. 1 /  0.16. 1
  libavcodec    52.108. 0 / 52.108. 0
  libavformat   52.93. 0 / 52.93. 0
  libavdevice   52. 2. 3 / 52. 2. 3
  libavfilter    1.74. 0 /  1.74. 0
  libswscale     0.12. 0 /  0.12. 0
  libpostproc   51. 2. 0 / 51. 2. 0
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'
root@Team4Svr:~/ffmpeg#



FFmpeg의 간단하 사용방법이다.

### One-pass CRF
ffmpeg -i input.avi -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre slow -crf 22 -threads 0 output.mp4

### Two-Pass 인코딩
ffmpeg -i input.avi -pass 1 -vcodec libx264 -vpre fast_firstpass -b 512k -bt 512k    -threads 0 -f rawvideo -an -y /dev/null && ffmpeg -i input.avi -pass 2 -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre fast -b 512k -bt 512k -threads 0 output.mp4

### iPod 640x480 으로 인코딩
ffmpeg -i input.avi -acodec libfaac -aq 100 -ac 2 -vcodec libx264 -vpre slow -vpre ipod640 -crf 26 -map_meta_data 0:0 -vf scale=640:-1 -threads 0 output.mp4


아래는 오래전(?)에 테스트 하면서 사용한 명령어이다. 여러가지 포맷으로 변환이 된다.

[root@localhost test] ffmpeg -i 640x480.wmv -y -s 640x360 -acodec libfaac -ar 32000 -ab 48000 -ac 2 -f flv -vcodec flv -b 700k tranc640x360.flv 
....
[root@localhost test] ffmpeg -i 640x480.wmv -y -threads 4-s 640x360 -acodec libfaac -ar 32000 -ab 48000 -ac 2 -f mp4 -vcodec libx264 -vpre fast -b 1000k -g 30 -bf 2 -b_strategy 1 tranc640x360.mp4

[root@localhost test] ffmpeg -i 640x480.wmv -y -threads 4-s 640x360 -acodec libfaac -ar 32000 -ab 48000 -ac 2 -f mp4 -vcodec mpeg4 -b 1000k  tranc640x360.mp4

인코딩 참고 사이트 : http://ospace.tistory.com/125, http://xmlangel2.blogspot.com/2010/04/ffmpeg-%EA%B8%B0%EB%B3%B8-%EC%82%AC%EC%9A%A9%EB%B2%95.html, http://ffmpeg.org/ffmpeg-doc.html 

※ ffmepg 설치방법은 여기서(http://ubuntuforums.org/showthread.php?t=786095) 참고 했다. 배꼈다. ㅡㅡ;



이제 드디어 Airvideo Server를 설치할 차례이다. 설치는 매우 간단하고 빠르다.

root@Team4Svr:~# add-apt-repository ppa:rubiojr/airvideo
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv A58221FEBF9C6AC1914B24ACC2B39E5DF6BD82A0
gpg: requesting key F6BD82A0 from hkp server keyserver.ubuntu.com
gpg: key F6BD82A0: public key "Launchpad PPA for rubiojr" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
root@Team4Svr:~# apt-get update
....
....
root@Team4Svr:~# sudo apt-get install airvideo-server
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
........
........
  airvideo-server ca-certificates-java faac icedtea-6-jre-cacao java-common
  libaccess-bridge-java libaccess-bridge-java-jni libclucene0ldbl libfaad2 libiodbc2
  libmodplug0c2 libmp4v2-0 libmpeg4ip-0 libmysqlclient16 libphonon4 libqscintilla2-5
  libqt4-dbus libqt4-designer libqt4-multimedia libqt4-network libqt4-opengl libqt4-ruby1.8
  libqt4-script libqt4-sql libqt4-sql-mysql libqt4-svg libqt4-test libqt4-webkit libqt4-xml
  libqt4-xmlpatterns libqtruby4shared2 libruby1.8 libsmokeqt4-3 libsmokesoprano3 libsoprano4
  libx264-85 libxcb-shape0 libxcb-shm0 libxcb-xv0 libxine1 libxine1-bin libxine1-console
  libxine1-misc-plugins libxine1-x mpeg4ip-server mysql-common openjdk-6-jre
  openjdk-6-jre-headless openjdk-6-jre-lib phonon phonon-backend-xine ruby ruby1.8
  soprano-daemon ttf-dejavu-extra tzdata-java virtuoso-nepomuk
0개 업그레이드, 57개 새로 설치, 0개 지우기 및 0개 업그레이드 안 함.
78.9M바이트 아카이브를 받아야 합니다.
이 작업 후 228M바이트의 디스크 공간을 더 사용하게 됩니다.
계속 하시겠습니까 [Y/n]?
......
......
......
openjdk-6-jre (6b20-1.9.13-0ubuntu1~10.04.1) 설정하는 중입니다 ...
update-alternatives: /usr/lib/jvm/java-6-openjdk/jre/bin/javaws 사용해서 자동 모드에서 /usr/bin/javaws (javaws) 제공.
update-alternatives: /usr/lib/jvm/java-6-openjdk/jre/bin/pluginappletviewer 사용해서 자동 모드에서 /usr/bin/pluginappletviewer (pluginappletviewer) 제공.
update-alternatives: /usr/lib/jvm/java-6-openjdk/jre/bin/policytool 사용해서 자동 모드에서 /usr/bin/policytool (policytool) 제공.

airvideo-server (0alpha6ubuntu1~lucid1) 설정하는 중입니다 ...
libc-bin에 대한 트리거를 처리하는 중입니다 ...
ldconfig deferred processing now taking place
root@Team4Svr:~# vi /opt/airvideo-server/AirVideoServerLinux.properties
path.ffmpeg = /opt/airvideo-server/bin/ffmpeg
path.mp4creator = /usr/bin/mp4creator
path.faac = /usr/bin/faac
password =
subtitles.encoding = euc-kr   <-- 변경
subtitles.font = undotum  <-- 변경
folders = Movies:/DataCenter/Movies,/DataCenter/Study  <-- 변경

이제 설치가 끝났다. AirVideo Server를 실행하기 위해선 아래의 화면과 같이 프로그램>음악과비디오>Airvideo Server 를 찾아서 실행한다.
서버를 띄우면 아래 화면처럼 아이콘이 생기는 것을 볼 수 있다. 여기서 Start Server를 눌러주면 된다.



아래는 아이폰을 통해 Airvideo Server에 접속한 모습니다. 아이폰의 Airvideo 프로그램은 유료 버전과 무료 버전이 있다. 유료와 무료의 차이점은 목록이 전부다 나오느냐, 일부만 나오느냐의 차이다. 그 외에는 차이는 없는 듯 하다. [+] 버튼을 눌러 Specify Address Manually를 선택한 다음 서버주소와 포트 번호를 누르면 서버를 간단히 추가할 수 있다. 그리고, 서버를 누르면 목록을 볼 수 있고, 목록에서 동영상을 선택하면 된다. mp4로 인코딩 된 동영상은 바로 실행이 되지만, 그 외에는 Play with Live Conversion을 통해 동영상을 즐길 수 있다.




10. 아이튠즈 서버 설치하기 [NAS 구축기][ubuntu 10.4]

얼렁뚱땅설명서 2012. 3. 5. 15:23


지금까지는 NAS의 가장 기본 기능을 끝냈다.
Samba 서버를 이용하여, 언제 어디서나 네트워크 드라이브로 설정할 수 있는 기능을 완성했으며,
덤으로 SSH나 FTP 서버도 설치했다. 
그럼 이제부터, 재미있는 기능들을 설치해 보도록 하자.

처음은 아이튠즈 서버다.  리눅스용 아이튠즈 서버는 firefly(or mt-daapd)가 있다.  apple의 DAAP(Digital Audio Access Protocol)를 구현한 것으로, PC의 아이튠즈나 아이폰, 안드로이드 등에서 사용할 수 있다.


root@Team4Svr:~# apt-get install dpkg-dev
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
다음 새 패키지가 전에 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  x11vnc xvnc4viewer tk freenx-session-launcher expect freenx-rdp libvncserver0 freenx-smb freenx-vnc tcl tcl8.5
  freenx-server
이들을 지우기 위해서는 'apt-get autoremove'를 사용하십시오.
다음 패키지를 더 설치할 것입니다:
  build-essential g++ g++-4.4 libstdc++6-4.4-dev xz-utils
제안하는 패키지:
  debian-keyring debian-maintainers g++-multilib g++-4.4-multilib gcc-4.4-doc libstdc++6-4.4-dbg
  libstdc++6-4.4-doc
다음 새 패키지를 설치할 것입니다:
  build-essential dpkg-dev g++ g++-4.4 libstdc++6-4.4-dev xz-utils
0개 업그레이드, 6개 새로 설치, 0개 지우기 및 0개 업그레이드 안 함.
8,174k바이트 아카이브를 받아야 합니다.
이 작업 후 26.2M바이트의 디스크 공간을 더 사용하게 됩니다.
계속 하시겠습니까 [Y/n]?
받기:1 http://ftp.daum.net/ubuntu/ lucid/main libstdc++6-4.4-dev 4.4.3-4ubuntu5 [1,522kB]
받기:2 http://ftp.daum.net/ubuntu/ lucid/main g++-4.4 4.4.3-4ubuntu5 [5,756kB]
받기:3 http://ftp.daum.net/ubuntu/ lucid/main g++ 4:4.4.3-1ubuntu1 [1,450B]
받기:4 http://ftp.daum.net/ubuntu/ lucid/main xz-utils 4.999.9beta+20091116-1 [233kB]
받기:5 http://ftp.daum.net/ubuntu/ lucid-updates/main dpkg-dev 1.15.5.6ubuntu4.5 [654kB]
받기:6 http://ftp.daum.net/ubuntu/ lucid/main build-essential 11.4build1 [7,278B]
내려받기 8,174k바이트, 소요시간 1초 (6,234k바이트/초)
전에 선택하지 않은 libstdc++6-4.4-dev 패키지를 선택합니다.
(데이터베이스 읽는중 ...현재 128781개의 파일과 디렉토리가 설치되어 있습니다.)
libstdc++6-4.4-dev 패키지를 푸는 중입니다 (.../libstdc++6-4.4-dev_4.4.3-4ubuntu5_amd64.deb에서) ...
전에 선택하지 않은 g++-4.4 패키지를 선택합니다.
g++-4.4 패키지를 푸는 중입니다 (.../g++-4.4_4.4.3-4ubuntu5_amd64.deb에서) ...
전에 선택하지 않은 g++ 패키지를 선택합니다.
g++ 패키지를 푸는 중입니다 (.../g++_4%3a4.4.3-1ubuntu1_amd64.deb에서) ...
전에 선택하지 않은 xz-utils 패키지를 선택합니다.
xz-utils 패키지를 푸는 중입니다 (.../xz-utils_4.999.9beta+20091116-1_amd64.deb에서) ...
전에 선택하지 않은 dpkg-dev 패키지를 선택합니다.
dpkg-dev 패키지를 푸는 중입니다 (.../dpkg-dev_1.15.5.6ubuntu4.5_all.deb에서) ...
전에 선택하지 않은 build-essential 패키지를 선택합니다.
build-essential 패키지를 푸는 중입니다 (.../build-essential_11.4build1_amd64.deb에서) ...
man-db에 대한 트리거를 처리하는 중입니다 ...
xz-utils (4.999.9beta+20091116-1) 설정하는 중입니다 ...
dpkg-dev (1.15.5.6ubuntu4.5) 설정하는 중입니다 ...
libstdc++6-4.4-dev (4.4.3-4ubuntu5) 설정하는 중입니다 ...
g++-4.4 (4.4.3-4ubuntu5) 설정하는 중입니다 ...
g++ (4:4.4.3-1ubuntu1) 설정하는 중입니다 ...
update-alternatives: /usr/bin/g++ 사용해서 자동 모드에서 /usr/bin/c++ (c++) 제공.

build-essential (11.4build1) 설정하는 중입니다 ...
root@Team4Svr:~# apt-get install avahi-daemon
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
avahi-daemon 패키지는 이미 최신 버전입니다.
다음 새 패키지가 전에 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  x11vnc xvnc4viewer tk freenx-session-launcher expect freenx-rdp libvncserver0 freenx-smb freenx-vnc tcl tcl8.5
  freenx-server
이들을 지우기 위해서는 'apt-get autoremove'를 사용하십시오.
0개 업그레이드, 0개 새로 설치, 0개 지우기 및 0개 업그레이드 안 함.
root@Team4Svr:~# apt-get install libgdbm-dev libid3tag0-dev
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
다음 새 패키지가 전에 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  x11vnc xvnc4viewer tk freenx-session-launcher expect freenx-rdp libvncserver0 freenx-smb freenx-vnc tcl tcl8.5
  freenx-server
이들을 지우기 위해서는 'apt-get autoremove'를 사용하십시오.
다음 패키지를 더 설치할 것입니다:
  libid3tag0 zlib1g-dev
다음 새 패키지를 설치할 것입니다:
  libgdbm-dev libid3tag0 libid3tag0-dev zlib1g-dev
0개 업그레이드, 4개 새로 설치, 0개 지우기 및 0개 업그레이드 안 함.
287k바이트 아카이브를 받아야 합니다.
이 작업 후 950k바이트의 디스크 공간을 더 사용하게 됩니다.
계속 하시겠습니까 [Y/n]?
받기:1 http://ftp.daum.net/ubuntu/ lucid/main libgdbm-dev 1.8.3-9 [38.4kB]
받기:2 http://ftp.daum.net/ubuntu/ lucid/main libid3tag0 0.15.1b-10build2 [39.6kB]
받기:3 http://ftp.daum.net/ubuntu/ lucid/main zlib1g-dev 1:1.2.3.3.dfsg-15ubuntu1 [167kB]
받기:4 http://ftp.daum.net/ubuntu/ lucid/main libid3tag0-dev 0.15.1b-10build2 [41.6kB]
내려받기 287k바이트, 소요시간 0초 (874k바이트/초)
전에 선택하지 않은 libgdbm-dev 패키지를 선택합니다.
(데이터베이스 읽는중 ...현재 129763개의 파일과 디렉토리가 설치되어 있습니다.)
libgdbm-dev 패키지를 푸는 중입니다 (.../libgdbm-dev_1.8.3-9_amd64.deb에서) ...
전에 선택하지 않은 libid3tag0 패키지를 선택합니다.
libid3tag0 패키지를 푸는 중입니다 (.../libid3tag0_0.15.1b-10build2_amd64.deb에서) ...
전에 선택하지 않은 zlib1g-dev 패키지를 선택합니다.
zlib1g-dev 패키지를 푸는 중입니다 (.../zlib1g-dev_1%3a1.2.3.3.dfsg-15ubuntu1_amd64.deb에서) ...
전에 선택하지 않은 libid3tag0-dev 패키지를 선택합니다.
libid3tag0-dev 패키지를 푸는 중입니다 (.../libid3tag0-dev_0.15.1b-10build2_amd64.deb에서) ...
man-db에 대한 트리거를 처리하는 중입니다 ...
libgdbm-dev (1.8.3-9) 설정하는 중입니다 ...
libid3tag0 (0.15.1b-10build2) 설정하는 중입니다 ...

zlib1g-dev (1:1.2.3.3.dfsg-15ubuntu1) 설정하는 중입니다 ...
libid3tag0-dev (0.15.1b-10build2) 설정하는 중입니다 ...
libc-bin에 대한 트리거를 처리하는 중입니다 ...
ldconfig deferred processing now taking place
root@Team4Svr:~# apt-get install libsqlite0
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
libsqlite0 패키지는 이미 최신 버전입니다.
다음 새 패키지가 전에 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  x11vnc xvnc4viewer tk freenx-session-launcher expect freenx-rdp libvncserver0 freenx-smb freenx-vnc tcl tcl8.5
  freenx-server
이들을 지우기 위해서는 'apt-get autoremove'를 사용하십시오.
0개 업그레이드, 0개 새로 설치, 0개 지우기 및 0개 업그레이드 안 함.
root@Team4Svr:~# apt-get install libsqlite0-dev
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
다음 새 패키지가 전에 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  x11vnc xvnc4viewer tk freenx-session-launcher expect freenx-rdp libvncserver0 freenx-smb freenx-vnc tcl tcl8.5
  freenx-server
이들을 지우기 위해서는 'apt-get autoremove'를 사용하십시오.
제안하는 패키지:
  sqlite-doc
다음 새 패키지를 설치할 것입니다:
  libsqlite0-dev
0개 업그레이드, 1개 새로 설치, 0개 지우기 및 0개 업그레이드 안 함.
234k바이트 아카이브를 받아야 합니다.
이 작업 후 770k바이트의 디스크 공간을 더 사용하게 됩니다.
받기:1 http://ftp.daum.net/ubuntu/ lucid/main libsqlite0-dev 2.8.17-6build2 [234kB]
내려받기 234k바이트, 소요시간 0초 (1,979k바이트/초)
전에 선택하지 않은 libsqlite0-dev 패키지를 선택합니다.
(데이터베이스 읽는중 ...현재 129857개의 파일과 디렉토리가 설치되어 있습니다.)
libsqlite0-dev 패키지를 푸는 중입니다 (.../libsqlite0-dev_2.8.17-6build2_amd64.deb에서) ...
libsqlite0-dev (2.8.17-6build2) 설정하는 중입니다 ...
root@Team4Svr:~# apt-get install gawk
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
gawk 패키지는 이미 최신 버전입니다.
다음 새 패키지가 전에 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  x11vnc xvnc4viewer tk freenx-session-launcher expect freenx-rdp libvncserver0 freenx-smb freenx-vnc tcl tcl8.5
  freenx-server
이들을 지우기 위해서는 'apt-get autoremove'를 사용하십시오.
0개 업그레이드, 0개 새로 설치, 0개 지우기 및 0개 업그레이드 안 함.
root@Team4Svr:~#
root@Team4Svr:~# apt-get install gcc
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
gcc 패키지는 이미 최신 버전입니다.
다음 새 패키지가 전에 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  x11vnc xvnc4viewer tk freenx-session-launcher expect freenx-rdp libvncserver0 freenx-smb freenx-vnc tcl tcl8.5
  freenx-server
이들을 지우기 위해서는 'apt-get autoremove'를 사용하십시오.
0개 업그레이드, 0개 새로 설치, 0개 지우기 및 0개 업그레이드 안 함.
root@Team4Svr:~# apt-get install mt-daapd
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
다음 새 패키지가 전에 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  x11vnc xvnc4viewer tk freenx-session-launcher expect freenx-rdp libvncserver0 freenx-smb freenx-vnc tcl tcl8.5
  freenx-server
이들을 지우기 위해서는 'apt-get autoremove'를 사용하십시오.
다음 패키지를 더 설치할 것입니다:
  javascript-common libavcodec52 libavformat52 libavutil49 libgsm1 libjs-prototype libjs-scriptaculous
  libschroedinger-1.0-0 libtagc0 wwwconfig-common
제안하는 패키지:
  apache2 httpd mysql-client postgresql-client apache apache-ssl
다음 새 패키지를 설치할 것입니다:
  javascript-common libavcodec52 libavformat52 libavutil49 libgsm1 libjs-prototype libjs-scriptaculous
  libschroedinger-1.0-0 libtagc0 mt-daapd wwwconfig-common
0개 업그레이드, 11개 새로 설치, 0개 지우기 및 0개 업그레이드 안 함.
3,374k바이트 아카이브를 받아야 합니다.
이 작업 후 9,744k바이트의 디스크 공간을 더 사용하게 됩니다.
계속 하시겠습니까 [Y/n]?
받기:1 http://ftp.daum.net/ubuntu/ lucid/universe wwwconfig-common 0.2.1 [22.8kB]
받기:2 http://ftp.daum.net/ubuntu/ lucid/universe javascript-common 7 [3,854B]
받기:3 http://ftp.daum.net/ubuntu/ lucid-updates/main libavutil49 4:0.5.1-1ubuntu1.3 [65.8kB]
받기:4 http://ftp.daum.net/ubuntu/ lucid/main libgsm1 1.0.13-3 [29.3kB]
받기:5 http://ftp.daum.net/ubuntu/ lucid/main libschroedinger-1.0-0 1.0.9.is.1.0.8-0ubuntu1 [213kB]
받기:6 http://ftp.daum.net/ubuntu/ lucid-updates/main libavcodec52 4:0.5.1-1ubuntu1.3 [2,207kB]
받기:7 http://ftp.daum.net/ubuntu/ lucid-updates/main libavformat52 4:0.5.1-1ubuntu1.3 [372kB]
받기:8 http://ftp.daum.net/ubuntu/ lucid/universe libjs-prototype 1.6.1-1 [34.9kB]
받기:9 http://ftp.daum.net/ubuntu/ lucid/universe libjs-scriptaculous 1.8.3-1 [127kB]
받기:10 http://ftp.daum.net/ubuntu/ lucid-updates/main libtagc0 1.6.3-0ubuntu1 [14.3kB]
받기:11 http://ftp.daum.net/ubuntu/ lucid/universe mt-daapd 0.9~r1696.dfsg-15build1 [284kB]
내려받기 3,374k바이트, 소요시간 1초 (2,525k바이트/초)
전에 선택하지 않은 wwwconfig-common 패키지를 선택합니다.
(데이터베이스 읽는중 ...현재 129866개의 파일과 디렉토리가 설치되어 있습니다.)
wwwconfig-common 패키지를 푸는 중입니다 (.../wwwconfig-common_0.2.1_all.deb에서) ...
전에 선택하지 않은 javascript-common 패키지를 선택합니다.
javascript-common 패키지를 푸는 중입니다 (.../javascript-common_7_all.deb에서) ...
전에 선택하지 않은 libavutil49 패키지를 선택합니다.
libavutil49 패키지를 푸는 중입니다 (.../libavutil49_4%3a0.5.1-1ubuntu1.3_amd64.deb에서) ...
전에 선택하지 않은 libgsm1 패키지를 선택합니다.
libgsm1 패키지를 푸는 중입니다 (.../libgsm1_1.0.13-3_amd64.deb에서) ...
전에 선택하지 않은 libschroedinger-1.0-0 패키지를 선택합니다.
libschroedinger-1.0-0 패키지를 푸는 중입니다 (.../libschroedinger-1.0-0_1.0.9.is.1.0.8-0ubuntu1_amd64.deb에서) ...
전에 선택하지 않은 libavcodec52 패키지를 선택합니다.
libavcodec52 패키지를 푸는 중입니다 (.../libavcodec52_4%3a0.5.1-1ubuntu1.3_amd64.deb에서) ...
전에 선택하지 않은 libavformat52 패키지를 선택합니다.
libavformat52 패키지를 푸는 중입니다 (.../libavformat52_4%3a0.5.1-1ubuntu1.3_amd64.deb에서) ...
전에 선택하지 않은 libjs-prototype 패키지를 선택합니다.
libjs-prototype 패키지를 푸는 중입니다 (.../libjs-prototype_1.6.1-1_all.deb에서) ...
전에 선택하지 않은 libjs-scriptaculous 패키지를 선택합니다.
libjs-scriptaculous 패키지를 푸는 중입니다 (.../libjs-scriptaculous_1.8.3-1_all.deb에서) ...
전에 선택하지 않은 libtagc0 패키지를 선택합니다.
libtagc0 패키지를 푸는 중입니다 (.../libtagc0_1.6.3-0ubuntu1_amd64.deb에서) ...
전에 선택하지 않은 mt-daapd 패키지를 선택합니다.
mt-daapd 패키지를 푸는 중입니다 (.../mt-daapd_0.9~r1696.dfsg-15build1_amd64.deb에서) ...
man-db에 대한 트리거를 처리하는 중입니다 ...
ureadahead에 대한 트리거를 처리하는 중입니다 ...
ureadahead will be reprofiled on next reboot
wwwconfig-common (0.2.1) 설정하는 중입니다 ...
javascript-common (7) 설정하는 중입니다 ...

libavutil49 (4:0.5.1-1ubuntu1.3) 설정하는 중입니다 ...

libgsm1 (1.0.13-3) 설정하는 중입니다 ...

libschroedinger-1.0-0 (1.0.9.is.1.0.8-0ubuntu1) 설정하는 중입니다 ...

libavcodec52 (4:0.5.1-1ubuntu1.3) 설정하는 중입니다 ...

libavformat52 (4:0.5.1-1ubuntu1.3) 설정하는 중입니다 ...

libjs-prototype (1.6.1-1) 설정하는 중입니다 ...
libjs-scriptaculous (1.8.3-1) 설정하는 중입니다 ...
libtagc0 (1.6.3-0ubuntu1) 설정하는 중입니다 ...

mt-daapd (0.9~r1696.dfsg-15build1) 설정하는 중입니다 ...
Starting mt-daapd: mt-daapd.

libc-bin에 대한 트리거를 처리하는 중입니다 ...
ldconfig deferred processing now taking place
root@Team4Svr:~#
root@Team4Svr:~# service mt-daapd stop
Stopping mt-daapd: mt-daapd.
Waiting for mt-daapd to terminate.....OK, all clear.

root@Team4Svr:~# vi /etc/mt-daapd.conf

...
...
#
# admin_pw (required)
#
# This is the password to the administrative pages
#

admin_pw = input password
...
...
#
# mp3_dir (required)
#
# Location of the mp3 files to share.  Note that because the
# files are stored in the database by inode, these must be
# in the same physical filesystem.
#

mp3_dir = /DataCenter/Music
...
...

root@Team4Svr:~# service mt-daapd start


이렇게 하면 아이튠즈에서 아이튠즈 서버가 보인다.  
그러나, 한참을 기다려도 음악파일 목록 따위는 보이지 않고, 뺑글뺑글 돌아가는 서버이름만.....ㅡ.ㅜ
아이튠즈 10.5 이상은 패치를 해야만 한다.



패치 방법은 아래와 같다. 
이번엔 길어서 패치과정을 뺐다.

root@Team4Svr:~# service mt-daapd stop
root@Team4Svr:~# aptitude install gpa devscripts debhelper dpatch libflac-dev libvorbis-dev libmpcdec-dev libavcodec-dev libavformat-dev libid3tag0-dev libtagc0-dev libavahi-client-dev libsqlite3-dev libjs-prototype libjs-scriptaculous avahi-daemon autotools-dev
....
....
root@Team4Svr:~# mkdir ~/mt-daapd
root@Team4Svr:~# cd ~/mt-daapd
root@Team4Svr:~# apt-get source mt-daapd
...
...
...

root@Team4Svr:~# cd ~/mt-daapd/mt-daapd-0.9~r1696.dfsg/debian/patches/
root@Team4Svr:~# wget http://www.zero-factorial.com/coding/21_itunes10.5.dpatch
root@Team4Svr:~# echo 21_itunes10.5.dpatch >> 00list
root@Team4Svr:~# cd ../..
root@Team4Svr:~# dch -i "Fix for iTunes 10"
root@Team4Svr:~# debuild -us -uc
...
...
...
root@Team4Svr:~# cd ../../..
root@Team4Svr:~# sudo dpkg -i mt-daapd_0.9~r1696.dfsg-15build2_amd64.deb
...
...
root@Team4Svr:~# service mt-daapd start

 

위와 같이 작업하면 일단 아이튠즈에서 서버가 떠있는 것은 확인할 수 있다. 아이튠즈 서버 관리는 웹브라우저를 통해서도 가능하다.
아이피 주소와 포트번호만 넣어주면 된다. 본인의 경우는 http://192.168.10.5:3689 로 입력하였다. 
 그러면 아래와 같은 화면을 볼 수 있을 것이다. 
사용자 이름은 admin 비밀번호는  mt-daapd.conf 에서 입력한 패스워드를 입력하면 된다.


일단, configuration 항목에 가서 Music Folder의 위치를 입력한다.
여기까지만해도 아이튠즈에서 음악파일 목록을 확인할 수 있을 것이다.


Smart playlists로 음악파일의 목록을 만들어주면, 좀더 심플한 목록을 볼 수 있지만..
이 작업은 노가다가 심하다는 단점이 있다. ㅡㅡ;;
나중에 이것을 어떻게 간단하게 만들어 줄수 있는지 연구(?)해 볼 참이다.



위의 작업이 끝났으면 아래와 같이 아이튠즈에서도, iPhone에서도, 안드로이드에서도 우리의 홈서버가 보유하고 있는 모든 음악을 서비스 받을 수 있다. 



 




09. NTFS 마운트 하기 또는 cp를 이용한 데이터 백업 [NAS 구축기][ubuntu 10.4]

얼렁뚱땅설명서 2012. 3. 1. 22:57

NAS에 대한 고민은 그동안 날려먹은 수 많은 하드디스크의 데이터 때문이었다.
수 많은 밤을 꼴딱새고, 멍한 정신 상태에서 파티션을 날려먹거나 포맷을 한다거나,
삭제 버튼을 눌러버리는 일은 참으로 흔하고 소소한 일들이었다. 시간도 얼마 걸리지 않는다.
그러고 나면, 그 멍한 정신상태에서 다시 복구를 위한 작업에 착수한다.
FinalData 라든가 LiveData라는 결코 가까지 하고 싶지 않은 프로그램을 설치하고 
수 많은 시간들을 기다려야 했다.
그러고 나면, 살리는 데이터 반, 날리는 데이터 반이였다.
아~씨바, 다시는 이런 일로 밤새우지 않으리라... 다짐 했건만...ㅡ.ㅜ


하여간, SSH를 이용한 원격드라이브의 설정까지 무사히 끝냈다면, 
이젠 하드디스크를 하나둘씩 추가하여 용량을 늘일 차례이다.
추가되는 하드디스크는 마운트를 해서 사용한다. 
기본 적인 마운트/언 마운트 명령은 아래의 명령을 이용해서 작업한다.

root@homesvr:/# mount -t ext4 /dev/sde1 /mnt

명령은 mount -t [파일시스템유형] [마운트할장치] [마운트할디렉토리] 로 구성된다.
언 마운트는 좀더 간단하다. 
명령 구성은 umount [마운트한디렉토리] 이다.

root@homesvr:/# umount /mnt


윈도우에서 사용하는 파일시스템 유형은 NTFS이다. 
NTFS를 읽기/쓰기가 가능하도록 마운트하기 위해서는 약간의 수고로움이 있다.
즉, 프로그램 하나를 설치 해야 한다.

root@homesvr:/# apt-get install ntfs-3g
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
ntfs-3g 패키지는 이미 최신 버전입니다.
0개 업그레이드, 0개 새로 설치, 0개 지우기 및 0개 업그레이드 안 함.
root@homesvr:/# (이미 설치 했다는 군요.)
root@homesvr:/# mount -t ntfs-3g /dev/sde1 /mnt


지금까지는 마운트할 하드디스크가 이미 포맷되어 있다는 가정으로 한것이다.
그러나, 처음 하드디스크를 구입할 때는 포맷이 되어 있지 않다.
하드디스크의 포맷은 아래의 그림처럼 GParted를 사용하면 간단히 끝낼 수 있다.
 



마운트 명령을 이용해서 마운트한 하드디스크는 시스템이 리붓되면, 마운트가 되지 않은 상태로 올라온다.
이것을 방지하기 위해서는 /etc/fstab 등록해 주면 된다. 아래는 본인의 서버에 설정된 fstab 이다.
add Disk 라인 위는 시스템이 알아서 설정한 부분이며, 아래의 붉은 줄은 본인이 입력해서 넣은 것이다.

UUID 대신 마운트할 때처럼 /dev/sde1 과 같이 입력해도 마운트가 되는 것으로 안다.
그러나 권장사항이 UUID를 사용하는 것 같다. 맨 아래의 NTFS 하드디스크를 마운트한 것이다.

root@homesvr:/# vi /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda1 during installation
UUID=e544659b-d683-4e82-a2c3-8b582d1257da /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=037ff56d-08ba-4abb-a555-7ed9a68bdb91 none            swap    sw              0       0

############# add Disk #############
## /dev/sdb1
UUID=acb938e8-36ae-4cd1-b1c1-49661d5d1a45 /DataCenter               ext4    errors=remount-ro 0       1
## /dev/sdc1
UUID=5bd2619a-f0e7-4d74-bb43-baf2f5054acc /DutyDisk               ext4    errors=remount-ro 0       1
## /dev/sdd1
UUID=f6804a34-4094-480d-9fa9-186bdabe0e25 /BackupDisk               ext4    defaults   0       2
## /dev/sde1
UUID=E0C62960C62937E4  /NtfsBackup     ntfs-3g defaults,locale=ko_KR.UTF-8     0       0 


UUID는 아래의 명령으로 확인할 수 있다.
 

root@HomeSvr:~# ls -l /dev/disk/by-uuid/
합계 0
lrwxrwxrwx 1 root root 10 2011-11-10 01:06 037ff56d-08ba-4abb-a555-7ed9a68bdb91 -> ../../sda5
lrwxrwxrwx 1 root root 10 2011-11-10 01:06 4a1bf1a9-e9d0-472d-9878-3a98692d3adf -> ../../sda1
lrwxrwxrwx 1 root root 10 2011-11-10 01:06 9fa8485a-dae0-4e50-85be-e5181d37af15 -> ../../sdc1
lrwxrwxrwx 1 root root 10 2011-11-10 01:06 E0C62960C62937E4 -> ../../sde1
lrwxrwxrwx 1 root root 10 2011-11-10 01:06 acb938e8-36ae-4cd1-b1c1-49661d5d1a45 -> ../../sdb1

또는 ....

root@HomeSvr:/# blkid
/dev/ramzswap0: TYPE="swap"
/dev/sdc1: UUID="9fa8485a-dae0-4e50-85be-e5181d37af15" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdb1: LABEL="DataCenter" UUID="acb938e8-36ae-4cd1-b1c1-49661d5d1a45" TYPE="ext4"
/dev/sdd1: LABEL="BackUp" UUID="f6804a34-4094-480d-9fa9-186bdabe0e25" TYPE="ext4"
/dev/sda1: UUID="4a1bf1a9-e9d0-472d-9878-3a98692d3adf" TYPE="ext4"
/dev/sda5: UUID="037ff56d-08ba-4abb-a555-7ed9a68bdb91" TYPE="swap"
/dev/sde1: LABEL="Linux4Windows" UUID="E0C62960C62937E4" TYPE="ntfs"



마지막으로 백업에 대해서 이야기 하겠다. 나의 경우는 콜드 백업을 선호한다. 즉, 복사본을 따로 만들어 두는 것을 선호한다.
레이드의 경우, 한계가 많기 때문에 사용하지 않는다. 일단은 나와 같이 저렴한 비용으로 서버를 구축하고자 하면, 메인보드에 내장된 레이드 컨트롤러를 사용하는 것일 일반적인데 2T~3T를 넘어가면 레이드가 깨진다고 한다. 그리고, 정말 중요한 것은 사람이 손으로 삭제한 것은 레이드 따위가 막아줄 수 있는 것이 아니다. 그건 정말 지워진거다. ㅡㅡ^

그래서 나의 경우는 그냥 그때 그때 복사하는 방법을 선호한다. 그것도 중요한 데이터만...
리눅스의 cp 명령은 생각보다 많은 기능들을 제공해준다. 예를 들어 복사 대상파일이 이미 있는 경우 파일 사이즈나 업데이트 시간이 달라야 복사한다거나 중복될 경우 백업본을 자동으로 만들어준다거나 하는 기능이 있다.
그러나 나의 경우는 자동으로 백업본을 만드는 일따위는 안하며, 같은 파일을 다시 복사하는 일만 안하도록 한다. 심플하게!


아래는 백업을 위한 스크립트다. 간단히 설명하면,

1) 서버의 시간을 맞춘다.
2) /dev/sdd1을 /BackupDisk 라는 폴더에 마운트 한다.
3) 원하는 데이터를 복사한다. 복사 옵션에 -Ru를 붙여서, 복사한 파일을 다시 복사하는 일은 없도록 한다.
4) 복사가 끝나면  /dev/sdd1 의 마운트를 해제 한다.
5) NTFS로 포맷된 디스크가 한번더 2~4의 작업을 반복한다.
6) 백업완료 시간을 화면에 출력한다.

mount와 umount를 반복하는 이유는 누군가 루트에서 [rm -rf * ]를 실행하는 천인공노할 일로 부터 보호하기 위해서다.
이런 일이 없을 것 같지만... 사실 빈번하게 일어난다. 난 아직 루트에서는 해본적 없다. ^^;

root@homesvr:~# mkdir /root/MgrScript
root@homesvr:~# vi /root/MgrScript/backup.sh
#/bin/sh

## 일단 시간을 맞춘다.
/usr/bin/rdate -s time.bora.net

mount -t ext4 /dev/sdd1 /BackupDisk
cp -Ru /DataCenter/* /BackupDisk/DataCenter
cp -Ru /home/* /BackupDisk/home
umount /BackupDisk

ntfs-3g /dev/sde1 /NtfsBackup -o locale=ko_KR.UTF-8
cp -Ru /DataCenter/* /NtfsBackup/DataCenter
cp -Ru /home/* /NtfsBackup/home
umount /NtfsBackup 

echo `date -d today` -end backup



그러나, 이 백업 스크립트를 틈나는 대로 돌릴 수는 없는 일이다.
이걸 cron에 등록하여 때마다 알아서 수행하도록 해준다.
난 이것을 매일 새벽 두시에 수행될 수 있도록 했다.

# export EDITOR=vi
# crontab -e
# m h  dom mon dow   command
0 2 * * * /root/MgrScript/backup.sh >> /root/MgrScript/backup.log  <-- 입력

root@homesvr:~# cd /var/spool/cron/crontabs/
root@homesvr:/var/spool/cron/crontabs# cat root <--- 등록된 것을 확인할 수 있다.
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.ITyvFs/crontab installed on Thu Mar  1 22:53:39 2012)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
# m h  dom mon dow   command
0 2 * * * /root/MgrScript/backup.sh >> /root/MgrScript/backup.log
root@homesvr:/var/spool/cron/crontabs# 


끝.

08. SSH 터널링으로 홈서버를 사무실 내 컴퓨터로... [NAS 구축기][ubuntu 10.4]

얼렁뚱땅설명서 2012. 2. 29. 03:00



Samba를 이용하면 간단하게 파일 서버를 구축할 수 있었다. 
이렇게 구성된 삼바 서버는 대용량 저장용 데이터(영화, 음악, 사진, 문서 등등)를 내 컴퓨터에서 몰아내고,
나의 게임용 컴퓨터엔 SSD라는 쌈팍한 저장장치를 달아 날아다니게 할 수가 있다.
더구나 공유기가 기가바이트를 지원한다면 삼바서버가 느리다는 생각도 들지 않을 것이다.

그러나 삼바서버의 한계성은  로컬 네트워크에서만 동작한다는 것이다.
사무실 컴퓨터에서도 네트워크 드라이브로 잡아서 사용하고 싶지만 그럴 수 없다.
인터넷을 타고 넘을 수 없다니.... 한계다. ㅡㅡ;;;

이런 문제를 해결하기 위해서 이미 지난 시간에 SSH 서버를 설치했다.
보안 터미널로 잘 알려진 SSH는 한 시대를 풍미했던 Telnet을 몰아내고 
그 자리를 차지했을 뿐만 아니라 아주 독특한 기능까지 추가했다.

SSH 터널링은 보안 기능이 없는 서비스들에게 보안 기능을 제공하며,
원거리 전송 기능이 없는 서비스에겐 원거리 전송 기능까지 부여해주는 훌륭한 놈이다.
문제점이 있다면 TCP 프로토콜만 된다는 것이다.
그래도 삼바서버를 인터넷에 태워 사무실 내 컴퓨터 앞에 데려다 주거나,
별다방이나 콩다방에 앉아 된장남 흉내를 낼 때도 나의 삼바 서버를 놋북 앞에 가져다 준다.


Windows7을 기준으로 설명하겠다.
일단 MicroSoft Loopback Adapter를 설치해야 한다. 설치 방법은 간단하다.
[제어판 > 시스템 및 보안 > 장치관리자]를 선택한 후 [네트워크 어댑터] 항목을 선택한 후 
상단 메뉴에서 [동작(A) > 레거시 하드웨어 추가(L)] 를 선택한다. 
그러면 아래와 같은 [하드웨어 추가 마법사 시작] 이라는 화면을 볼 수 있다.
일단 다음을 누른다.



목록에서 직접 선택한 하드웨어 설치(고급)을 누르고, 네트워크 어댑터를 선택한 후 잠시 기다리면 목록이 뜬다.
그 후에 제조업체 항목에서 Microsoft를 선택하고, 네트워크 어댑터 항목에서 Microsoft Loopback Adapter를 선택하면 설치를 할 수 있다.



설치가 끝났으면 다시 [제어판>네트워크 상태 및 작업 보기>어댑터 설정 변경] 을 선택한 후 
우리가 방금 전에 설치한 [LoopBack 어뎁터]를 선택 한 후 속성(R)을 한다. 
Loopback 속성 화면이 뜨면 Internet Protocol Version 4(TCP/IPv4)를 선택하여 
IP 주소와 서브넷 마스크를 아래의 그림과 같이 10.0.0.1/255.255.255.0으로 설정하면 루프백 설정이 끝난다.



Loopback Adapter 설정이 끝나면 이제 본격적으로 SSH 터널링 작업에 들어간다. 
터널링 작업을 위해서는 일단 Putty 라는 프로그램을 사용한다.
Putty는 공짜고 내 컴퓨터에 늘 설치되어 있는 프로그램이라 사용할 뿐 ...
SSH 터널링을 위해서 이 프로그램만 사용할 수 있는 것은 아니다.
SSH 터널링을 위한 프로그램도 많고, SSH 보안 터미널은 대부분이 이 기능을 지원하는 것으로 안다.
그러나, 난 이 프로그램으로만 설명한다.

Putty 프로그램은 여기 https://bitbucket.org/daybreaker/iputty/downloads 또는 
http://www.chiark.greenend.org.uk/~sgtatham/putty/  여기서 다운 받을 수 있다.


일단 Putty 프로그램을 실행 시킨 후 Host Name(or IP Address)에 
서버에 접근할 수 있는 주소와 포트 번호를 입력한다.
그 후 [접속 > SSH > 터널링] 선택한 후 아래의 그림처럼 포워드 포트를 입력하면 된다.

1) 원 포트  - 10.0.0.1:139 대상 - 127.0.0.1:139
2) 원 포트  - 10.0.0.1:445 대상 - 127.0.0.1:139

그리고 잊지 말아야 할 것은 ...  [열기] 버튼을 클릭하기 전에 
세션 항목에 가서 저장된 세션에 적당한 이름을 입력하고 저장을 눌러야
같은 작업을 반복하지 않을 수 있다.


그런데, 한 가지 잊은 것이 있다. Windows7은 보안이 좀 강화되어서 Samba가 사용하는 포트를 막아놓았다.
이것을 해제하기 위해서는 http://www.sshvpn.de 여기에 가서 프로그램을 하나 받아서 실행해 주어야 한다.
그것도 반드시 관리자 권한으로 말이다.   아래 첨부된 파일을 다운 받아도 된다.



모든 작업이 끝났으면 이제 Putty를 이용해 접속을 한다.
그리고, 탐색기를 이용하여 루프백 주소로 설정한 10.0.0.1으로 접속한다.
접속은 탑색기의 주소 입력란에 [\\10.0.0.1] 을 입력하면 된다.
Putty로 접속하기 때문에 Putty의 접속이 끊어지지 않아야 한다.

SSH 터널링은 Samba 서비스의 경우만 사용할 수 있는 것은 아니다.
원격지에서의 서버접근 시 SSH 포트만 열어두고, 나머지는 서비스는 SSH 터널링으로 해결할 수도 있다.
응용범위가 있다. 단, TCP 서비스만 해당된다는 아쉬움이 있다.


 

07. Samba 설치 [NAS 구축기][ubuntu 10.4]

얼렁뚱땅설명서 2012. 2. 21. 16:57


SAMBA는 NAS(Network Attached Storage)의 꽃이다. 나는 이렇게 생각한다.
Windows 운영체제 뿐만 아니라, Unix, MacOS에서도 사용할 수 있는 파일 및 프린터 공유할 수 있다.
본래의 SAMBA프로토콜은 로컬에서만 사용할 수 있지만, 조금만 알면 원격지에서도 사용할 수 있는 방법이 있다.
즉, 집에 설치한 Home Server의 디스크나 프린터를 인터넷 연결이 된 어느 곳에서든 사용할 수 있다는 말이다.

일단 아래와 같이 명령은 입력하면 된다.


username@Team4Svr:~$ sudo -s
root@Team4Svr:~#
root@Team4Svr:~# apt-get install samba smbfs
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
smbfs 패키지는 이미 최신 버전입니다.
smbfs 패키지 수동설치로 지정합니다.
다음 새 패키지가 전에 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  x11vnc xvnc4viewer tk freenx-session-launcher expect freenx-rdp libvncserver0 freenx-smb freenx-vnc tcl tcl8.5
  freenx-server
이들을 지우기 위해서는 'apt-get autoremove'를 사용하십시오.
제안하는 패키지:
  openbsd-inetd inet-superserver smbldap-tools ldb-tools
다음 새 패키지를 설치할 것입니다:
  samba
0개 업그레이드, 1개 새로 설치, 0개 지우기 및 0개 업그레이드 안 함.
6,826k바이트 아카이브를 받아야 합니다.
이 작업 후 18.4M바이트의 디스크 공간을 더 사용하게 됩니다.
받기:1 http://security.ubuntu.com/ubuntu/ lucid-security/main samba 2:3.4.7~dfsg-1ubuntu3.8 [6,826kB]
내려받기 6,826k바이트, 소요시간 7초 (878k바이트/초)
패키지를 미리 설정하는 중입니다...
전에 선택하지 않은 samba 패키지를 선택합니다.
(데이터베이스 읽는중 ...현재 127411개의 파일과 디렉토리가 설치되어 있습니다.)
samba 패키지를 푸는 중입니다 (.../samba_2%3a3.4.7~dfsg-1ubuntu3.8_amd64.deb에서) ...
ureadahead에 대한 트리거를 처리하는 중입니다 ...
ufw에 대한 트리거를 처리하는 중입니다 ...
man-db에 대한 트리거를 처리하는 중입니다 ...
samba (2:3.4.7~dfsg-1ubuntu3.8) 설정하는 중입니다 ...
Generating /etc/default/samba...
Importing account for nobody...ok
Importing account for fishingday...ok
update-alternatives: /usr/bin/smbstatus.samba3 사용해서 자동 모드에서 /usr/bin/smbstatus (smbstatus) 제공.
smbd start/running, process 15080
nmbd start/running, process 15088

root@Team4Svr:~#



SAMBA의 설치는 이것으로 간단히 끝났다.
접속하는 사용자의 Home 디렉토리를 공유하기 위해 /etc/samba/smb.conf를 편집한다.
나머지는 그대로 두고 나온다.

root@Team4Svr:~# vi /etc/samba/smb.conf
.....
.... 
#======================= Share Definitions =======================

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares.  This will share each
# user's home directory as \\server\username
[homes]
   comment = Home Directories
   browseable = no
   writeable = yes

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
;   read only = yes

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
   create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
   directory mask = 0700

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.  Un-comment the following parameter
# to make sure that only "username" can connect to \\server\username
# This might need tweaking when using external authentication schemes
   valid users = %S


삼바서버를 다시 실행시킨다.

root@Team4Svr:~# service smbd restart
smbd start/running, process 15195
root@Team4Svr:~#


아직 파일공유는 불가능 하다. 여기서 파일을 공유하기 위해서는 사용자를 추가하 하고, 서비스할 폴더를 추가하고...
뭘 하려면 뭐하고 뭐하고 해야 한다. 본인은 삼바 설정 파일만 보면 머리가 아파지기 때문에 다른 방법을 찾았다.
아래의 명령을 실행한다.
만약 아래의 명령을 실행하는데, 오류가 발생한다면 /etc/apt/sources.list 파일을 편집한다.
편집은 kr.archive.ubuntu.com 을 ftp.daum.net 으로 변경후 apt-get update 명령을 실행한 후 계속 하면 된다.

root@Team4Svr:~# apt-get install libuser1 python-libuser system-config-samba
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
다음 새 패키지가 전에 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  x11vnc xvnc4viewer tk freenx-session-launcher expect freenx-rdp libvncserver0 freenx-smb freenx-vnc tcl tcl8.5
  freenx-server
이들을 지우기 위해서는 'apt-get autoremove'를 사용하십시오.
다음 패키지를 지울 것입니다:
  libuser1 python-libuser system-config-samba
0개 업그레이드, 0개 새로 설치, 3개 지우기 및 0개 업그레이드 안 함.
이 작업 후 6,414k바이트의 디스크 공간이 비워집니다.
계속 하시겠습니까 [Y/n]?
(데이터베이스 읽는중 ...현재 128780개의 파일과 디렉토리가 설치되어 있습니다.)
system-config-samba 패키지를 지우는 중입니다 ...
python-libuser 패키지를 지우는 중입니다 ...
libuser1 패키지를 지우는 중입니다 ...
hicolor-icon-theme에 대한 트리거를 처리하는 중입니다 ...
desktop-file-utils에 대한 트리거를 처리하는 중입니다 ...
python-gmenu에 대한 트리거를 처리하는 중입니다 ...
Rebuilding /usr/share/applications/desktop.ko_KR.utf8.cache...
man-db에 대한 트리거를 처리하는 중입니다 ...
python-support에 대한 트리거를 처리하는 중입니다 ...
libc-bin에 대한 트리거를 처리하는 중입니다 ...
ldconfig deferred processing now taking place
root@Team4Svr:~# apt-get install libuser1 python-libuser system-config-samba
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
다음 새 패키지가 전에 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  x11vnc xvnc4viewer tk freenx-session-launcher expect freenx-rdp libvncserver0 freenx-smb freenx-vnc tcl tcl8.5
  freenx-server
이들을 지우기 위해서는 'apt-get autoremove'를 사용하십시오.
다음 새 패키지를 설치할 것입니다:
  libuser1 python-libuser system-config-samba
0개 업그레이드, 3개 새로 설치, 0개 지우기 및 0개 업그레이드 안 함.
0바이트/716k바이트 아카이브를 받아야 합니다.
이 작업 후 6,414k바이트의 디스크 공간을 더 사용하게 됩니다.
전에 선택하지 않은 libuser1 패키지를 선택합니다.
(데이터베이스 읽는중 ...현재 127480개의 파일과 디렉토리가 설치되어 있습니다.)
libuser1 패키지를 푸는 중입니다 (.../libuser1_1%3a0.56.9.dfsg.1-1ubuntu3_amd64.deb에서) ...
전에 선택하지 않은 python-libuser 패키지를 선택합니다.
python-libuser 패키지를 푸는 중입니다 (.../python-libuser_1%3a0.56.9.dfsg.1-1ubuntu3_amd64.deb에서) ...
전에 선택하지 않은 system-config-samba 패키지를 선택합니다.
system-config-samba 패키지를 푸는 중입니다 (.../system-config-samba_1.2.63-0ubuntu4_all.deb에서) ...
man-db에 대한 트리거를 처리하는 중입니다 ...
desktop-file-utils에 대한 트리거를 처리하는 중입니다 ...
python-gmenu에 대한 트리거를 처리하는 중입니다 ...
Rebuilding /usr/share/applications/desktop.ko_KR.utf8.cache...
hicolor-icon-theme에 대한 트리거를 처리하는 중입니다 ...
python-support에 대한 트리거를 처리하는 중입니다 ...
libuser1 (1:0.56.9.dfsg.1-1ubuntu3) 설정하는 중입니다 ...
python-libuser (1:0.56.9.dfsg.1-1ubuntu3) 설정하는 중입니다 ...
system-config-samba (1.2.63-0ubuntu4) 설정하는 중입니다 ...
libc-bin에 대한 트리거를 처리하는 중입니다 ...
ldconfig deferred processing now taking place
python-support에 대한 트리거를 처리하는 중입니다 ...
python-central에 대한 트리거를 처리하는 중입니다 ...
root@Team4Svr:~#



이제 그래픽컬한 화면을 띄우면 아래의 화면과 같이 시스템>관리>Samba 라는 항목이 추가된 것을 볼수 있다.
여기서 Samba 사용자를 추가하고 디렉토리를 공유하면 된다. 
설정이 완료되면 아래의 그림처럼 탐색기에서 서버의 IP 주소 를 입력하면 된다.





06. pure-ftpd 설치 [NAS 구축기][ubuntu 10.4]

얼렁뚱땅설명서 2012. 2. 17. 20:49

원래는 Samba 설치와 SSH 터널링을 쓰려고 했으나...
일단은 가벼운 마음으로 FTP 서비스를 설치하고자 한다.
FTP 서버는 Proftp나 vsftp등 여러가지가 있지만...
간단하고 한글지원 잘되고 뭐 이런 이유로 pure-ftpd를 설치한다. 
설치 방법은 아래와 같다.


username@HomeSvr:~# sudo -s
[sudo] password for username:
root@HomeSvr:~# apt-get install pure-ftpd
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
다음 패키지를 더 설치할 것입니다:
  openbsd-inetd pure-ftpd-common
다음 새 패키지를 설치할 것입니다:
  openbsd-inetd pure-ftpd pure-ftpd-common
0개 업그레이드, 3개 새로 설치, 0개 지우기 및 0개 업그레이드 안 함.
396k바이트 아카이브를 받아야 합니다.
이 작업 후 1,167k바이트의 디스크 공간을 더 사용하게 됩니다.
계속 하시겠습니까 [Y/n]?
받기:1 http://kr.archive.ubuntu.com/ubuntu/ lucid/main openbsd-inetd 0.20080125-4ubuntu2 [38.5kB]
받기:2 http://kr.archive.ubuntu.com/ubuntu/ lucid/universe pure-ftpd-common 1.0.24-1 [178kB]
받기:3 http://kr.archive.ubuntu.com/ubuntu/ lucid/universe pure-ftpd 1.0.24-1 [179kB]
내려받기 396k바이트, 소요시간 0초 (841k바이트/초)
패키지를 미리 설정하는 중입니다...
전에 선택하지 않은 openbsd-inetd 패키지를 선택합니다.
(데이터베이스 읽는중 ...현재 149966개의 파일과 디렉토리가 설치되어 있습니다.)
openbsd-inetd 패키지를 푸는 중입니다 (.../openbsd-inetd_0.20080125-4ubuntu2_amd64.deb에서) ...
전에 선택하지 않은 pure-ftpd-common 패키지를 선택합니다.
pure-ftpd-common 패키지를 푸는 중입니다 (.../pure-ftpd-common_1.0.24-1_all.deb에서) ...
전에 선택하지 않은 pure-ftpd 패키지를 선택합니다.
pure-ftpd 패키지를 푸는 중입니다 (.../pure-ftpd_1.0.24-1_amd64.deb에서) ...
man-db에 대한 트리거를 처리하는 중입니다 ...
ureadahead에 대한 트리거를 처리하는 중입니다 ...
ureadahead will be reprofiled on next reboot
openbsd-inetd (0.20080125-4ubuntu2) 설정하는 중입니다 ...
 * Stopping internet superserver inetd                                                                  [ OK ]
 * Not starting internet superserver: no services enabled

pure-ftpd-common (1.0.24-1) 설정하는 중입니다 ...

pure-ftpd (1.0.24-1) 설정하는 중입니다 ...
Starting ftp server: Running: /usr/sbin/pure-ftpd -l pam -E -O clf:/var/log/pure-ftpd/transfer.log -u 1000 -8 UTF-8 -B

root@HomeSvr:~# echo "cp949" | tee /etc/pure-ftpd/conf/ClientCharset
cp949
root@HomeSvr:~# echo "yes" | tee /etc/pure-ftpd/conf/BrokenClientsCompatibility
yes
root@HomeSvr:~# echo "yes" | tee /etc/pure-ftpd/conf/DontResolve
yes
root@HomeSvr:~# echo "yes" | tee /etc/pure-ftpd/conf/ChrootEveryone
yes
root@HomeSvr:~# /etc/init.d/pure-ftpd restart
Restarting ftp server: Running: /usr/sbin/pure-ftpd -l pam -E -O clf:/var/log/pure-ftpd/transfer.log -u 1000 -H -9 cp949 -b -8 UTF-8 -A -B


05. 원격 접속하기 - SSH, freeNX [NAS 구축기][ubuntu 10.4]

얼렁뚱땅설명서 2012. 2. 17. 20:15


우분투에 접속하는 방법은 여러가지가 있다.
전통적인 터미널로 접속하는 방법인 SSH를 이용하는 방법과
그래픽 화면으로 접속하는 방법인  VNC와 freeNX 등이 있다.
본인은 VNC 보다는 freeNX를 추천한다. 

VNC의 설정은 여기서 확인하길 바란다.  http://ssndwind.tistory.com/36
 

freeNX는 SSH를 이용하기 때문에 가장 먼저 SSH를 설치하는 것이 우선이다.
SSH의 설치는 매우 간단하다.


username@homesvr:~$ 
sudo -s
[sudo] password for username: 
root@Team4Svr:~# apt-get install ssh
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다       
상태 정보를 읽는 중입니다... 완료
다음 패키지를 더 설치할 것입니다:
  openssh-server
제안하는 패키지:
  rssh molly-guard openssh-blacklist openssh-blacklist-extra
다음 새 패키지를 설치할 것입니다:
  openssh-server ssh
0개 업그레이드, 2개 새로 설치, 0개 지우기 및 0개 업그레이드 안 함.
306k바이트 아카이브를 받아야 합니다.
이 작업 후 864k바이트의 디스크 공간을 더 사용하게 됩니다.
계속 하시겠습니까 [Y/n]? 
받기:1 http://kr.archive.ubuntu.com/ubuntu/ lucid-updates/main openssh-server 1:5.3p1-3ubuntu7 [305kB]
받기:2 http://kr.archive.ubuntu.com/ubuntu/ lucid-updates/main ssh 1:5.3p1-3ubuntu7 [1,256B]
내려받기 306k바이트, 소요시간 1초 (256k바이트/초)
패키지를 미리 설정하는 중입니다...
전에 선택하지 않은 openssh-server 패키지를 선택합니다.
(데이터베이스 읽는중 ...현재 125813개의 파일과 디렉토리가 설치되어 있습니다.)
openssh-server 패키지를 푸는 중입니다 (.../openssh-server_1%3a5.3p1-3ubuntu7_amd64.deb에서) ...
전에 선택하지 않은 ssh 패키지를 선택합니다.
ssh 패키지를 푸는 중입니다 (.../ssh_1%3a5.3p1-3ubuntu7_all.deb에서) ...
ureadahead에 대한 트리거를 처리하는 중입니다 ...
ureadahead will be reprofiled on next reboot
ufw에 대한 트리거를 처리하는 중입니다 ...
man-db에 대한 트리거를 처리하는 중입니다 ...
openssh-server (1:5.3p1-3ubuntu7) 설정하는 중입니다 ...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
ssh start/running, process 2167

ssh (1:5.3p1-3ubuntu7) 설정하는 중입니다 ...

root@Team4Svr:~#  

이렇게 하면 간단히 설치가 끝난다.
접속을 확인하기 위해서는 Putty와 같은 프로그램을 사용하면 된다.
Host Name 에는 IP주소를 넣어도 되고, 공유기설정편에서
포트포워딩과 DDNS를 설정했다면 그 주소를 사용해도 된다. 
Host Name을 입력하고 [열기]를 클릭하면 답답한 까만 화면이 커서를 껌뻑이며 기다릴 것이다.
그래도 이 녀석은 생각보다 아름다운 놈이니 사랑해 주도록 하자. 
 

이 프로그램은 여기 
https://bitbucket.org/daybreaker/iputty/downloads 또는 
http://www.chiark.greenend.org.uk/~sgtatham/putty/  여기서 다운 받을 수 있다.




계속 이어서 freeNX를 설치한다. 방법은 아래와 같다.

root@Team4Svr:~# add-apt-repository ppa:freenx-team/ppa
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv F3A662B57D580D3A2E98E5152A8E3034D018A4CE
gpg: requesting key D018A4CE from hkp server keyserver.ubuntu.com
gpg: key D018A4CE: public key "Launchpad PPA for FreeNX Team" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
root@Team4Svr:~#
root@Team4Svr:~# apt-get update
받기:1 http://kr.archive.ubuntu.com lucid Release.gpg [189B]
기존 http://kr.archive.ubuntu.com/ubuntu/ lucid/main Translation-ko
기존 http://kr.archive.ubuntu.com/ubuntu/ lucid/restricted Translation-ko
기존 http://kr.archive.ubuntu.com/ubuntu/ lucid/universe Translation-ko
기존 http://kr.archive.ubuntu.com/ubuntu/ lucid/multiverse Translation-ko
받기:2 http://kr.archive.ubuntu.com lucid-updates Release.gpg [198B]
무시http://kr.archive.ubuntu.com/ubuntu/ lucid-updates/main Translation-ko
무시http://kr.archive.ubuntu.com/ubuntu/ lucid-updates/restricted Translation-ko
무시http://kr.archive.ubuntu.com/ubuntu/ lucid-updates/universe Translation-ko
무시http://kr.archive.ubuntu.com/ubuntu/ lucid-updates/multiverse Translation-ko
기존 http://kr.archive.ubuntu.com lucid Release
기존 http://kr.archive.ubuntu.com lucid-updates Release
기존 http://kr.archive.ubuntu.com lucid/main Packages
기존 http://kr.archive.ubuntu.com lucid/restricted Packages
기존 http://kr.archive.ubuntu.com lucid/main Sources
기존 http://kr.archive.ubuntu.com lucid/restricted Sources
기존 http://kr.archive.ubuntu.com lucid/universe Packages
기존 http://kr.archive.ubuntu.com lucid/universe Sources
기존 http://kr.archive.ubuntu.com lucid/multiverse Packages
기존 http://kr.archive.ubuntu.com lucid/multiverse Sources
기존 http://kr.archive.ubuntu.com lucid-updates/main Packages
기존 http://kr.archive.ubuntu.com lucid-updates/restricted Packages
기존 http://kr.archive.ubuntu.com lucid-updates/main Sources
기존 http://kr.archive.ubuntu.com lucid-updates/restricted Sources
기존 http://kr.archive.ubuntu.com lucid-updates/universe Packages
기존 http://kr.archive.ubuntu.com lucid-updates/universe Sources
기존 http://kr.archive.ubuntu.com lucid-updates/multiverse Packages
기존 http://ppa.launchpad.net lucid Release.gpg
무시http://ppa.launchpad.net/freenx-team/ppa/ubuntu/ lucid/main Translation-ko
기존 http://kr.archive.ubuntu.com lucid-updates/multiverse Sources
기존 http://ppa.launchpad.net lucid Release
기존 http://ppa.launchpad.net lucid/main Packages
기존 http://security.ubuntu.com lucid-security Release.gpg
무시http://security.ubuntu.com/ubuntu/ lucid-security/main Translation-ko
무시http://security.ubuntu.com/ubuntu/ lucid-security/restricted Translation-ko
무시http://security.ubuntu.com/ubuntu/ lucid-security/universe Translation-ko
무시http://security.ubuntu.com/ubuntu/ lucid-security/multiverse Translation-ko
기존 http://security.ubuntu.com lucid-security Release
기존 http://security.ubuntu.com lucid-security/main Packages
기존 http://security.ubuntu.com lucid-security/restricted Packages
기존 http://security.ubuntu.com lucid-security/main Sources
기존 http://security.ubuntu.com lucid-security/restricted Sources
기존 http://security.ubuntu.com lucid-security/universe Packages
기존 http://security.ubuntu.com lucid-security/universe Sources
기존 http://security.ubuntu.com lucid-security/multiverse Packages
기존 http://security.ubuntu.com lucid-security/multiverse Sources
내려받기 387바이트, 소요시간 5초 (74바이트/초)
패키지 목록을 읽는 중입니다... 완료
root@Team4Svr:~#
root@Team4Svr:/etc/init# aptitude install freenx-server
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
Reading extended state information
Initializing package states... 완료
Writing extended state information... 완료
The following NEW packages will be installed:
  expect{a} freenx-server freenx-session-launcher{a} tcl8.5{a}
0 packages upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/1,984kB of archives. After unpacking 5,722kB will be used.
Do you want to continue? [Y/n/?]
Writing extended state information... 완료
패키지를 미리 설정하는 중입니다...
전에 선택하지 않은 tcl8.5 패키지를 선택합니다.
(데이터베이스 읽는중 ...현재 132202개의 파일과 디렉토리가 설치되어 있습니다.)
tcl8.5 패키지를 푸는 중입니다 (.../tcl8.5_8.5.8-2_amd64.deb에서) ...
전에 선택하지 않은 expect 패키지를 선택합니다.
expect 패키지를 푸는 중입니다 (.../expect_5.44.1.14-5_amd64.deb에서) ...
전에 선택하지 않은 freenx-server 패키지를 선택합니다.
freenx-server 패키지를 푸는 중입니다 (.../freenx-server_0.7.3.git110520.3884279-0ubuntu1ppa4_amd64.deb에서) ...
전에 선택하지 않은 freenx-session-launcher 패키지를 선택합니다.
freenx-session-launcher 패키지를 푸는 중입니다 (.../freenx-session-launcher_0.7.3.git110520.3884279-0ubuntu1ppa4_amd64.deb에서) ...
man-db에 대한 트리거를 처리하는 중입니다 ...
ureadahead에 대한 트리거를 처리하는 중입니다 ...
tcl8.5 (8.5.8-2) 설정하는 중입니다 ...

expect (5.44.1.14-5) 설정하는 중입니다 ...

freenx-server (0.7.3.git110520.3884279-0ubuntu1ppa4) 설정하는 중입니다 ...
freenx-server start/running

freenx-session-launcher (0.7.3.git110520.3884279-0ubuntu1ppa4) 설정하는 중입니다 ...

libc-bin에 대한 트리거를 처리하는 중입니다 ...
ldconfig deferred processing now taking place
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
Reading extended state information
Initializing package states... 완료
Writing extended state information... 완료
root@Team4Svr:~#  



명령어 3번만 입력하면 설치는 간단히 끝난다. 그러나 손은 조금더 봐야 한다.
간략히 말해, 설정파일을 열어서 3군데를 편집하고, 키파일을 만들어 주면 nxserver를 사용할 수 있는 상태가 된다.


root@Team4Svr:~#
root@Team4Svr:~# cd /etc/nxserver
root@Team4Svr:/etc/nxserver# ls
node.conf  node.conf.d  nxacl  nxcheckload  nxshadowacl
root@Team4Svr:/etc/nxserver# vi node.conf

#########################################################################
# General FreeNX directives
#########################################################################

# The host name which is used by NX server. It's should be used if it's
# different than the default hostname (as returned by `hostname`)
SERVER_NAME="$(hostname)" <--- # 제거

# The node ip which is used by NX Node in unecnrypted session mode.
# Set it if you want to use a specific external ip or the autodetection
# is not working.
#EXTERNAL_PROXY_IP=""

# The port number where local 'sshd' is listening.
SSHD_PORT=22 <--- # 제거


#########################################################################
# Authentication / Security directives
#########################################################################

# Authentication directives

# This adds the usermode to the possible authentication methods
# Usermode means that a user can start the nxserver as his shell
# and connect directly to the right server via a custom client.
#ENABLE_USERMODE_AUTHENTICATION="0"

# This adds the passdb to the possible authentication methods
#ENABLE_PASSDB_AUTHENTICATION="0"

# This adds SSH to the possible authentication methods. For it to work sshd
# must be set up at localhost accepting password authentication.
ENABLE_SSH_AUTHENTICATION="1" <--- # 제거

# This adds SU to the possible authentication methods. For it to work the
# "nx" user must be in the wheel (RedHat, Fedora) or the users group (SUSE)
# and the user logging in must have a valid shell that accepts the -c
# parameter.
#ENABLE_SU_AUTHENTICATION="0"

----
root@Team4Svr:/etc/nxserver# /usr/lib/nx/nxkeygen
Unique key generated; your users must install

    /var/lib/nxserver/home/.ssh/client.id_dsa.key

on their computers.
root@Team4Svr:/etc/nxserver# cp /var/lib/nxserver/home/.ssh/client.id_dsa.key client.id_dsa.key
root@Team4Svr:/etc/nxserver# ls
client.id_dsa.key  node.conf  node.conf.d  nxacl  nxcheckload  nxshadowacl
root@Team4Svr:/etc/nxserver# cat client.id_dsa.key
-----BEGIN DSA PRIVATE KEY-----
MIIBuwIBAAKBgQD4guNuz7zayUfzNlroQ+lGbmM3kbJSPALDWDsN1t2gop3i5xK2
SV1TaoBGNlsL4IWqn0bGjSZ3ulNKkohO20ltGG3oId6jDlSbc2IvhBrybNonc6rs
x/63NcXnp8rN1WeuUrHj+uvsgsHiBGc7m5Mb7Jub31g6ndBgUjaIqLQMFwIVANZy
CDqEGS9NlGdeSO5D2pNDaCVxAoGAFlsuFWVJiRN9boAw46zjlp/TsyfQE5jjakNv
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
UYomTy3IBJgJCOZS7KY9rqeDoB05RNsD3Lmh4zGJt2wy8olXYWA36mHwGwovrwJl
/2vGdiMCgYEAsE4q3qOQhxS3IiMcSlRXRCHHfL+WXmAwhZo6y+Xf9hU5l69txoC8
Nr1tmkAqqf7K73MiXgC8DWgbtMn5M2nWqOiR4bmGt369mWsbQJvWyLAEU4En5q/4
DB0Y2+C9Ho3KrCHKZxINT8Gfr31p3QmEBRXhdu31XKzNo3KUOBjznIECFBlZ6Z0F
coC8jtYnYzVGV9uadhsU
-----END DSA PRIVATE KEY-----
root@Team4Svr:/etc/nxserver#
root@Team4Svr:/etc/nxserver# service freenx-server restart
freenx-server start/running
root@Team4Svr:/etc/nxserver#


맨 마지막에 Client.id_dsa.key의 내용은 잘 복사해 둬야 한다.
이것은 FreeNX Client를 이용한 접속에서 사용해야 한다.

설치가 끝나면 FreeNX Client 프로그램을 설치하자.
FreeNX Client는 다음 주소에서 받을 수 있다.
여기서 받을 수 있다. --> 
http://www.nomachine.com/download.php 

다운받아 설치하고 나면, 아래의 그림처럼 Session 에 서버이름을 만들어주고,
Host 입력 칸에 서버 주소를 적어준다. 포트포워딩과 DDNS를 설정했으며, 그 주소를 적어 주어도 된다.
그러면 인터넷이 연결된 모든 장소에서도 접근할 수 있을 것이다.




Next 버튼을 클릭하여 다음 화면이 나오면 자신의 환경에 맞는  desktops을 선택하면 된다.
우분투 10.04는 기본이 GNOME이다. 선택을 완료했으면 다시 Next를 클릭한다. 

 



Finish를 클릭하고 다음으로 넘어오면 아래와 같은 화면을 만날 수 있다. 
그러면, 먼저 Configure... 버튼을 누르고, 다시 Key... 버튼을 누른 다음
nxserver 서버 설치 마지막 단계에서 복사해둔 client.id_dsa.key 값을 입력하고 저장하면 된다.
이제 아이디와 패스워드를 입력하고 Login 버튼은 누르면
당신의 우분투 서버와의 감동적인 만남을 어디서든 할수가 있다.



04. 공유기 설정 [NAS 구축기]

얼렁뚱땅설명서 2012. 1. 7. 02:42

NAS 서버의 용도는 집에서 공유 저장소에서 접근하는 것을 목적으로 하기도 하지만, 대부분의 욕심은 외부에서도 접근하는 것을 목적으로 한다. 그러한 용도를 만족하기 위해서는 공유기의 설정이 필수이다.

그러니까, 공유기 너머에 있는 서버에 접속을 위한 방법은 서버를 DMZ에 위치 시키거나 Twin IP를 설정하거나 해야 한다. 다른 방법으로는 포트 포워딩 시키는 방법이 있는데... 추천은 포트 포워딩 이다. 이유는 별거 없다. 서버를 외부로 부터 안전하게 지키기 위해서 이다. 이벤트 로그를 보면 하루에도 엄청난 수의 해킹 시도가 있었는지 알게 된다. 그렇지만 걱정할 것은 없다. 암호만 잘 만들어 두면 된다. 대부분의 공격은 단순한 사전 공격일 뿐이니까 말이다. 

포트포워딩은 필요한 포트 하나만 열어 두는 것으로 나머지 포트는 공유기가 알아서 다 막아준다. 본인은 22번 포트 하나만 열어두는 것을 추천한다. 이것만 열어두어도 SAMBA 서비스 정도는 사용이 가능하다. 물론, 나는 욕심이 많아서 여러가지 서비스를 열어 두었다.



외부에서 집에 있는 서버에 연결하는 방법은 위에서 열거한 방법 이외에도 VPN을 사용하는 방법이 있다.
그러나, VPN은 서버에 연결하는 것이 아닌, 네트워크에 연결하는 방법이고, 속도도 느려 추천하지 않는다.
또한, 일부의 공유기만 VPN 서버를 내장하고 있고, 대부분은 이러한 기능이 없다.
물론, 본인은 욕심이 많기 때문에 사용한다.
 




NAS 서버를 운용하면서 가장 필요한 기능 중 하나가 DDNS 서비스다.
이것이 지원되어야 공유기를 재 시작할 때마다 변경되는 IP에 대응할 수가 있다.
DDNS 서비스는 대부분의 공유기에서 지원한다.