반응형

우분투 저장소 변경하기

$ sudo vi /etc/apt/sources.list

:%s/kr.archive.ubuntu.com/ftp.daum.net/g

:%s/security.ubuntu.com/ftp.daum.net/g

$ sudo apt-get update && sudo apt-get upgrade


WOL  설정하기

1. 공유기 설정(WOL 설정 가능기종)

2. ubuntu 서버 설정하기

ethtool이 설치 되어 있는지 확인

$ whereis ethtool

경로가 나오면 설치되어 있는것이고 아무 경로도 나오지 않는다면 아래 명령어로 설치

$ sudo apt-get install ethtool

wol 스크립트 생성 경로로 이동

$ cd /etc/init.d/

vi 편집기를 이용해 파일 생성

$ sudo vi wakeonlanconfig

ethtool -s eth0 wol g

exit

작성된 설정 스크립트 실행 권한 부여

$ sudo chmod a+x wakeonlanconfig

정상완료시 아무런 메시지도 출력되지 않음

부팅시마다 해당 스크립트가 자동실행되도록 설정

$ sudo update-rc.d -f wakeonlanconfig defaults

마지막으로 최초 한번 스크립트 실행

$ sudo /etc/init.d/wakeonlanconfig


torrent 프로그램 Transmission-daemon 설치 및 설정

Transmission-daemon 설치

$ sudo apt-get install transmission-daemon

설정파일 수정하기 전에 서비스를 중지시킨다

$ sudo service transmission-daemon stop

설정파일 수정(!!주석부분은 빼고 저장한다)

$ sudo vi /etc/transmission-daemon/settings.json

{

    "alt-speed-down": 50,

    "alt-speed-enabled": false,

    "alt-speed-time-begin": 540,

    "alt-speed-time-day": 127,

    "alt-speed-time-enabled": false,

    "alt-speed-time-end": 1020,

    "alt-speed-up": 50,

    "bind-address-ipv4": "0.0.0.0",

    "bind-address-ipv6": "::",

    "blocklist-enabled": false,

    "blocklist-url": "http://www.example.com/blocklist",

    "cache-size-mb": 4,

    "dht-enabled": true,

    "download-dir": "/home/guda/Downloads",    //다운로드 완료 파일 경로

    "download-limit": 100,

    "download-limit-enabled": 0,

    "download-queue-enabled": true,

    "download-queue-size": 5,

    "encryption": 1,

    "idle-seeding-limit": 30,

    "idle-seeding-limit-enabled": false,

    "incomplete-dir": "/home/guda/temp",                        // 다운로드 임시 파일 경로

    "incomplete-dir-enabled": true,                                  // 다운로드 임시 파일 경로 사용여부

    "lpd-enabled": false,

    "max-peers-global": 200,

    "message-level": 2,

    "peer-congestion-algorithm": "",

    "peer-limit-global": 240,

    "peer-limit-per-torrent": 60,

    "peer-port": 51413,

    "peer-port-random-high": 65535,

    "peer-port-random-low": 49152,

    "peer-port-random-on-start": false,

    "peer-socket-tos": "default",

    "pex-enabled": true,

    "port-forwarding-enabled": false,

    "preallocation": 1,

    "prefetch-enabled": 1,

    "queue-stalled-enabled": true,

    "queue-stalled-minutes": 30,

    "ratio-limit": 2,

    "ratio-limit-enabled": false,

    "rename-partial-files": true,

    "rpc-authentication-required": true,

    "rpc-bind-address": "0.0.0.0",

    "rpc-authentication-required": true,

    "rpc-bind-address": "0.0.0.0",

    "rpc-enabled": true,

    "rpc-password": "{daad7d2d8asdf342hiike4541c7e8b55234dfsd9d6aad0nyBkOaGE",  //패스워드(자동암호화됨)

    "rpc-port": 9091,                                        //포트번호

    "rpc-url": "/transmission/",

    "rpc-username": "guda",                            //아이디

    "rpc-whitelist": "127.0.0.1",                        //접속가능 IP주소 리스트(화이트 리스트)

    "rpc-whitelist-enabled": false,                    //접속가능 IP주소 리스트(화이트 리스트) 사용여부

    "scrape-paused-torrents-enabled": true,

    "script-torrent-done-enabled": false,

    "script-torrent-done-filename": "",

    "seed-queue-enabled": false,

    "seed-queue-size": 10,

    "speed-limit-down": 100,

    "speed-limit-down-enabled": false,

    "speed-limit-up": 100,

    "speed-limit-up-enabled": false,

    "start-added-torrents": true,

    "trash-original-torrent-files": false,         //토렌트 파일 삭제 여부

    "umask": 18,

    "upload-limit": 100,

    "upload-limit-enabled": 0,

    "upload-slots-per-torrent": 14,

    "utp-enabled": true,

    "watch-dir": "/home/guda/torrent",        //토렌트 자동추가 폴더

    "watch-dir-enabled": true                    //토렌트 자동추가 시행 여부

}


설정한 폴더 권한 설정

$ sudo chmod 770 다운로드 폴더

$ sudo chgrp -R debian-transmission  다운로드 폴더  

$ sudo chmod 770 watch-dir 폴더

$ sudo chgrp -R debian-transmission  watch-dir 폴더  

$ sudo chmod 770 다운로드중인 폴더

$ sudo chgrp -R debian-transmission  다운로드중인 폴더  


서비스 재시작

$ sudo service transmission-daemon start

 

기본 계정인 debian-transmission 이 아닌 별도의 계정으로 구동 및 저장하고 싶을 때 아래와 같이 수정

$ sudo vi /etc/init/transmission-daemon.conf

         #setuid debian-transmission

         setuid guda


$ sudo chown guda.guda -R /var/lib/transmission-daemon

$ sudo chown guda.guda -R /etc/transmission-daemon

$ sudo chown guda.guda /usr/bin/transmission-daemon


재부팅 후 설정이 초기화 되었다면 아래 방식으로 변경

$ sudo update-rc.d -f transmission-daemon remove

$ sudo vi /etc/rc.local 

transmission-daemon 추가 


samba 설치

$ sudo apt-get install samba smbfs


 samba  접속시 사용할 비밀번호 설정

아이디는 서버접속에 사용하는 아이디로 하되 비번은 독립적으로 설정된다

$ sudo smbpasswd -a 현재접속중인 아이디(ubuntu 계정이 생성되어 있는경우 )


접속하는 사용자의 Home 디렉토리 공유를 위해 설정파일 편집

Share Definitions 부분만 설정 변경

$ sudo 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 director as \\server\username

[homes]

   comment = Home Directories

   browseable = no


# 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 = no


# 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

# The following parameter makes sure that only "username" can connect

#

# This might need tweaking when using external authentication schemes

   valid users = %S


설정 변경이 완료 되었으면 samba를 재시작해준다.

$ sudo service smbd restart


마지막으로 서버가 재부팅될때마다 samba가 자동으로 실행되도록 설정

$ sudo update-rc.d smbd defaults


MediaTomb 설치하기(UPnP, DLNA)

서버가 있는 같은 네트워크 대역대에서만 된다.

$ sudo apt-get install mediatomb


web ui 사용할수 있도록 설정 , 한글도 나오도록 설정

$ sudo vi /etc/mediatomb/config.xml

<ui enabled="yes" show-tooltips="yes">


 <transcoding enabled="yes">


<import hidden-files="no">

<filesystem-charset>UTF-8</filesystem-charset>

<metadata-charset>UTF-8</metadata-charset>

<scripting script-charset="UTF-8">


mediatomb 재시작

$sudo /etc/init.d/mediatomb restart


접속확인해보자

http://아이피:49152/


아이튠즈 서버 설치

$ sudo apt-get install forked-daapd

라이브러리 디렉토리를 수정

$ sudo vi /etc/forked-dappd.conf

directories = { "경로 설정" }

재시작

$ sudo /etc/init.d/forked-daapd restart


Air video 설치

저장소 및 폰트 추가

$ sudo apt-get install python-software-properties


$ sudo add-apt-repository ppa:rubiojr/airvideo


$ sudo add-apt-repository "deb http://dev.naver.com/repos deb/"


$ sudo apt-get install ttf-nanum ttf-nanum-coding


$ sudo apt-get install openjdk-6-jdk


$ sudo apt-get install airvideo-server


$ sudo vi /opt/airvideo-server/AirVideoServerLinux.properties


$ sudo vi /etc/init.d/airvideo-server

#!/bin/bash

case "$1" in

    start)

        echo "Starting AirVideo"

           start-stop-daemon --start --quiet -b -m -p /var/run/airvideo-server.pid --chuid guda --exec /usr/bin/j

ava -- -jar /opt/airvideo-server/AirVideoServerLinux.jar /opt/airvideo-server/AirVideoServerLinux.properties

;;

    stop)

        echo "Stopping AirVideo"

           start-stop-daemon --stop --quiet --pidfile /var/run/airvideo-server.pid

           rm -f /var/run/airvideo-server

;;

    *)

        echo "Usage: /etc/init.d/airvideo-server {start|stop}"

        exit 1

;;

esac

exit 0


$ sudo chmod +x /etc/init.d/airvideo-server

$ sudo update-rc.d airvideo-server defaults


$ sudo service airvideo-server start

+ Recent posts