SHOUTcast/Installation/ko

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page SHOUTcast/Installation and the translation is 100% complete.
Other languages:


이 안내서에서는 SHOUTcast 서버 및 SHOUTcast 트랜스로 스트리밍 라디오 서버를 설정하는데 필요한 단계를 하나씩 진행합니다.

SHOUTcast 서버 설정

파일 설치

SHOUTcast 서버는 media-sound/SHOUTcast-server-bin에서 찾을 수 있습니다. 다음 명령으로 설치할 수 있습니다:

root #emerge --ask shoutcast-server-bin

이제 SHOUTcast 서버를 설치합니다. 다음 단계에서는 새로 설치한 SHOUTcast 서버를 설정합니다.

SHOUTcast 서버 설정

이제 SHOUTcast 서버를 설치했고 설정해야합니다. 설정 파일은 /etc/shoutcast/sc_serv.conf에서 찾을 수 있습니다. 설정을 시작해보겠습니다. 루트 계정인지 확인하고 선호하는 편집기로 설정 파일을 여십시오:

root #$EDITOR /etc/shoutcast/sc_serv.conf

이 명령은 SHOUTcast 서버 설정 파일을 보여줍니다. /etc/shoutcast/sc_serv.conf는 설정할 수 있는 제각기 다른 여러가지 옵션이 있는 설정 파일입니다. 특정 옵션들을 설정하는 방법을 살펴보겠습니다.

필수 옵션

코드 사용자 제한 설정
; MaxUser.  The maximum number of simultaneous listeners allowed.
; Compute a reasonable value for your available upstream bandwidth (i.e. if
; you have 256kbps upload DSL, and want to broadcast at 24kbps, you would
; choose 256kbps/24kbps=10 maximum listeners.)  Setting this value higher
; only wastes RAM and screws up your broadcast when more people connect
; than you can support.
MaxUser=10

이는 최대 사용자 수를 설정합니다. 설명에 나타난대로 256kbps 업로드 환경에서 사용자를 100명으로 설정하는건 바보같은 짓입니다. SHOUTcast 서버를 LAN에 전송하려고 실행한다면 훨씬 더 큰 값 (앞서 언급한 100도 거뜬)으로 설정할 수 있습니다. 실제 사용중인 대역폭이 뭐가 되었든 남용은 하지 말 것을 기억해두십시오. 대역폭을 초과 사용하면 ISP에 고가의 비용 부담이 되므로 일부는 계정을 차단하거나 고액의 추가 비용을 청구하며 간혹 모두 해당될 수도 있습니다.

코드 암호 설정
; Password.  While SHOUTcast never asks a listener for a password, a
; password is required to transport audio stream to the server, and to perform
; administration via the web interface to this server.  This password should
; consist of only letters and numbers, and it's the same password that your
; broadcaster will need to enter in the SHOUTcast Source Plug-in for Winamp.
; THIS VALUE CANNOT BE BLANK.
Password=a_hard_to_crack_password

암호를 설정하는 부분입니다. 암호는 분명한 텍스트입니다. 보안상, 중요한 시스템 구성 요소 또는 다른 민감한 정보를 암호에 넣지 마십시오. 최대한 임의의 문자 또는 숫자의 조합 형태로 넣으십시오. 이 암호는 SHOUTcast 트랜스(또는 다른 컨텐트 제공자)에 연결하고 스트리밍 컨텐트를 제공받을 때 사용할 암호입니다.

코드 대기 포트 설정
; PortBase. This is the port number your server will run on.  The
; value, and the value + 1 must be available.  If you get a fatal error when
; the DNAS is setting up a socket on startup, make sure nothing else on the
; machine is running on the same port (telnet localhost port number -- if you
; get connection refused then you're clear to use that port).  Ports less than 1024
; may require root privileges on *nix machines.  The default port is 8000.
PortBase=8000

이 값은 SHOUTcast 서버에 연결할 사용자가 어떤 포트로 접근하게 할지를 설정합니다. 기본 포트는 8000번이며 대부분의 mp3 서버 기능을 수행하는 프로그램(오데이셔스, 윈앰프 등)이 기본적으로 연결하는 포트입니다. 이 설정에서 나타난대로 1024보다 작은 값을 사용하려면, 루트 계정으로 실행해야합니다. 허나, 여러분의 SHOUTcast 서버에 1024보다 작은 값을 포트 번호로 사용하는데는 전적으로 반대합니다.

코드 기록 설정
; LogFile: file to use for logging. Can be '/dev/null' or 'none'
; or empty to turn off logging. The default is ./sc_serv.log
; on *nix systems or sc_serv_dir\sc_serv.log on win32.
; Note: on win32 systems if no path is specified the location is
; in the same directory as the executable, on *nix systems it is in the
; current directory.
LogFile=/var/log/SHOUTcast.log

SHOUTcast 서버 기록 파일 위치를 설정합니다. 이빌드는 /dev/null로 설정했기 때문에 실제 기록 내용을 건지려면 이 값을 바꿔야합니다. 전 기본적으로 /var/log 위치로 설정했습니다. 여러분의 경우에는 여러분이 필요한대로 설정할 수 있습니다.

코드 실시간 상태 표시 활성화
; RealTime displays a status line that is updated every second
; with the latest information on the current stream (*nix and win32
; console systems only)
RealTime=0

현재 재생중인 노래를 매 초마다 표준 출력 대상으로 나타냅니다. 이 항목은 이빌드에서 비활성화했으므로 SHOUTcast 데몬은 가능한한 조용하게 돌아갈 수 있습니다. 이 값을 매 초마다 업데이트 하려면 1로 설정하십시오. 허나 상태 페이지를 대신 사용하는게 좋겠습니다.

코드 실시간 기록 활성화
; ScreenLog controls whether logging is printed to the screen or not
; on *nix and win32 console systems. It is useful to disable this when
; running servers in background without their own terminals. Default is 1
ScreenLog=0

데몬을 가능한한 조용하게 실행하도록 기본적으로 이빌드에서 비활성화했습니다. 이 항목은 어떤 동작(연결, 연결 끊어짐 등)이든지 실시간으로 일어나는 동작에 대해 표준 출력을 대상으로 기록을 남겨둡니다. 허나, 기록 파일이 동일한 동작을 수행하므로 차라리 기록 파일을 쓰는게 좋겠습니다.

코드 표시할 마지막 노래 갯수 설정
; ShowLastSongs specifies how many songs to list in the /played.html
; page.  The default is 10.  Acceptable entries are 1 to 20.
ShowLastSongs=10

나타난 바와 같이 /played.html에서 나타낼 최근 재생 항목을 얼마나 많이 표시할지를 설정하는 값입니다. 20보다 큰 값으로 설정하면, 커피를 좀 많이 드시고 있어야 할지도 모릅니다.

코드 파일 시스템 수정 기록 설정
; TchLog decides whether or not the DNAS log file should track yp
; directory touches.  Adds and removes still appear regardless of
; this setting.
; Default is yes
; TchLog=yes

이 설정값은 DNAS(분산 네트워크 오디오 서버), 또는 SHOUTcast 에서 잠깐동안 디렉터리 수정 내용에 대한 기록을 활성화 또는 비활성화합니다. 되도록이면 더 안전한 기록을 원하는 분께 추천합니다. 기본적으로 집에서 사용하거나 평범한 사용자라면 이 설정이 필요하지 않습니다.

코드 http 요청 기록 활성화
; WebLog decides whether or not hits to http:// on this DNAS will
; be logged.  Most people leave this off because the DSP plug-in
; uses http:// calls to update titles and get the listener count,
; which takes up a lot of log space eventually.  If you want to
; see people making hits on your admin.cgi or index pages, turn
; this back on.  Note that this setting does NOT affect XML stats
; counters for hits to http:// pages.
; Default is no.
; WebLog=no

이 항목은 SHOUTcast 에서 제공하는 HTTP 서버에 접근하는 모든 동작을 기록할지 여부를 지정합니다. 가능한한 더욱 안전하게 기록할 사람에게 추천하지만, 집에서 사용하거나 평범한 사용자라면 이 설정이 필요하지 않습니다.

코드 W3C 기록 활성화
; W3CEnable turns on W3C Logging.  W3C logs contain httpd-like accounts
; of every track played for every listener, including byte counts those listeners
; took.  This data can be parsed with tools like Analog and WebTrends, or given
; to third parties like Arbitron and Measurecast for their reporting systems.
; Default is Yes (enabled).
W3CEnable=Yes
  
; W3CLog describes the name of the log file for W3C logging.  Default log file is
; sc_w3c.log, in the same directory wherever the DNAS gets started from.
W3CLog=/dev/null

첫번째 옵션은 W3C 기록을 활성화합니다. 기록 형식은 나열한 프로그램에서 쉽게 해석할 수 있습니다. 가능한한 자세한 통계를 내려는 사람에게 상당히 추천하는 항목입니다. 두번째 옵션은 W3C 기록을 저장할 위치입니다. 이빌드에서는 /dev/null로 설정했습니다.

네트워크 설정

코드 근원 IP 설정
; SrcIP, the interface to listen for source connections on (or to make relay
; connections on if relaying). Can and usually will be ANY or 127.0.0.1
; (Making it 127.0.0.1 will keep other machines from being able to
; broadcast using your SHOUTcast Server )
SrcIP=ANY

SrcIP 변수에는 IP 스트리밍 컨텐트를 끌어올 곳을 설정합니다. 다른 서버(릴레이), localhost(일반), 또는 인터페이스를 지원하는 다른 IP가 될 수 있습니다. localhost로 설정하면 활용 중인 SHOUTcast 서버에서 다른 서버를 브로드캐스트 소스로 처리하는 일을 막습니다. 기본 값은 ANY이며 SHOUTcast 서버를 어떤 IP 주소에서든 서비스하게합니다. 보안상 이유로 IP 주소를 지정하는게 좋습니다.

코드 대상 IP 설정
; DestIP, IP to listen for clients on (and to contact yp.SHOUTcast.com)
; can and usually will be be ANY. If your machine has multiple IP addresses,
; set this to the one you want it to be accessed by.
DestIP=ANY

사용자가 어떤 IP 주소로 연결할 경우 허용할 지를 결정합니다. localhost(반사회적이거나 자신에게만 스트리밍을 할 경우), 자체 IP(로컬 네트워크용 192.168.0.101), 외부 IP(로컬망이 아닌 광역망을 대상으로 스트리밍 서비스를 할 경우, 209.204.249.201)가 될 수 있습니다. 대부분 여기 언급한 IP 대힌 127.0.0.1을 활용하여 스트리밍에 접근할 수 있습니다. ANY 설정값은 모든 인터페이스를 통해 모든 IP 주소로 서버를 바인딩합니다.

코드 프록시/yp.SHOUTcast.com 포트 설정
; Yport, port to connect to yp.SHOUTcast.com on. For people behind caching
; web proxies, change this to the alternate port (666 is what it might be,
; check www.SHOUTcast.com if you have problems). Otherwise, leave this at 80.
; We're actively working on re-opening port 666, but as of release the only
; working port is port 80.
Yport=80

두가지 기능을 합니다. 첫번째 값은 yp.SHOUTcast.com에 연결할 포트 번호입니다. yp.SHOUTcast.com는 널소프트 공개 서버 페이지이므로 사용자가 청취할 위치를 압니다. 사용자는 이 페이지를 통해 여러분의 방송국을 검색할 수 있습니다. 두번째는 웹 프록시에 사용합니다. 여기에 포트 값을 사용하면 프록시 연결에 사용할 포트를 지정할 수 있고, DestIP 값을 지정하면 스트리밍에 사용할 IP 주소를 지정할 수 있습니다.

코드 역방향 DNS 설정
; NameLookups.  Specify 1 to perform reverse DNS on connections.
; This option may increase the time it takes to connect to your
; server if your DNS server is slow.  Default is 0 (off).
NameLookups=0

클라이언트의 역방향 DNS 조회를 허용할지 말지를 지정합니다. 이 설정 값은 각각의 호스트 이름을 찾아 IP 주소를 취하도록 합니다. 자세한 보고 기록을 남기려면 이 옵션을 사용하십시오.

코드 릴레이 설정
; RelayPort and RelayServer specify that you want to be a relay server.
; Relay servers act as clients to another server, and rebroadcast.
; Set RelayPort to 0, RelayServer to empty, or just leave these commented
; out to disable relay mode.
; RelayPort=8000
; RelayServer=192.168.1.58

릴레이 서버로 동작하게끔 지정합니다. 릴레이 서버는 특정 클라이언트로만 스트리밍을 전달할 수 있도록 저대역폭 연결을 취할 때 사용하며, 더 많은 클라이언트에게 좀 더 높은 대역폭으로 서비스를 제공합니다. RelayPort는 릴레이 처리 할 SHOUTcast 서버의 포트 번호와 IP 주소를 지정합니다. 릴레이 서버로 둘 계획이 아니면 이 부분의 주석을 제거하십시오.

서버 설정

코드 관리자 암호 설정
; AdminPassword.  This password (if specified) changes the
; behavior of Password to be a broadcast-only password, and
; limits HTTP administration tasks to the password specified
; here.  The broadcaster, with the password above, can still
; log in and view connected users, but only the AdminPassword
; will grant the right to kick, ban, and specify reserve hosts.
; The default is undefined (Password allows control for both
; source and admin)
; AdminPassword=adminpass

이 항목을 설정하면 방송 송출자와 관리자를 만듭니다. 방송 송출자는 암호로 로그인할 수 있으며 연결 상태를 볼 수 있습니다. 하지만 서버에서 추방/영구 추방/관리작업을 할 사용자는 관리 암호를 지니고 있어야합니다. 이 옵션은 서버상에서 더 특별한 역할을 부여합니다. 시스템 관리자와 방송 송출자가 동일인이 아닌 경우 이 항목의 설정을 추천합니다.

코드 자동으로 사용자 연결 끊기 설정
; AutoDumpUsers controls whether listeners are disconnected if the source
; stream disconnects. The default is 0.
AutoDumpUsers=0

어떤 이유로 인해 스트림 연결을 끊었을 경우 사용자를 추방할 것인지를 지정합니다. 0으로 설정하면 클라이언트가 자체적으로 시간 초과로 처리하거나, 스트림을 버퍼로 받아둡니다.

코드 소스 제한 시간 설정
; AutoDumpSourceTime specifies how long, in seconds, the source stream is
; allowed to be idle before the server disconnects it. 0 will let the source
; stream idle indefinitely before disconnecting. The default is 30.
AutoDumpSourceTime=30

SHOUTcast 서버가 소스(주로 릴레이 서버)서버에서 컨텐트를 스트리밍할 때 기다리다 포기하는 시간을 지정합니다. 30에서 60 정도의 값이 적절합니다.

코드 컨텐트 디렉터리 설정
; ContentDir specifies the directory location on disk of where to stream
; on-demand content from. Subdirectories are supported as of DNAS 1.8.2.
; Default is ./content/, meaning a directory named content in the same directory
; as where sc_serv was invoked from.
ContentDir=/opt/SHOUTcast/content/

ContentDir은 주문 대상 컨텐트를 놓을 위치를 지정합니다. 근무자들에게 알림을 전파할 때 이 목적으로 사용할 수 있습니다. SHOUTcast 서버 이빌드에서는 /opt/SHOUTcast/content 로 설정합니다. 이 설정을 사용하려면 컨텐트 디렉터리에 mp3를 넣고, 브라우저에 http://example.com:[port]/content/mp3name.pls를 입력하십시오. SHOUTcast 서버는 mp3와 호환되는 스트리밍 미디어 재생 목록을 자동으로 만들고 요청에 따라 스트리밍을 실시합니다. 미디어 원본을 스트리밍하려면 SHOUTcast Trans 대신 이걸 사용하십시오.

코드 도입부 음원 파일 설정
; IntroFile can specify a mp3 file that will be streamed to listeners right
; when they connect before they hear the live stream.
; Note that the intro file MUST be the same sample rate/channels as the
; live stream in order for this to work properly. Although bit rate CAN
; vary, you can use '%d' to specify the bit rate in the filename
; (i.e. C:\intro%d.mp3 would be C:\intro64.mp3 if you are casting at 64kbps).
; The default is no IntroFile
; IntroFile=c:\intro%d.mp3

이 옵션으로 도입 음원 파일을 설정할 수 있습니다. 사용자가 연결하는 언제든 이 파일을 청취합니다. 여기서 언급한대로, 스트리밍 비트 전송율과 도입 음원 파일의 비트 전송율은 일치하여야 하며, 맞추지 않으면 깨집니다. intro128.mp3와 intro64.mp3 같은 파일을 둘 수 있는데 intro128.mp3 파일은 128kbps 스트림에 연결한 사용자가, intro64.mp3 파일은 64kbps 스트림에 연결한 사용자가 재생합니다.

코드 뒷부분 음원 파일 설정
; BackupFile can specify a mp3 file that will be streamed to listeners over
; and over again when the source stream disconnects. AutoDumpUsers must be
; 0 to use this feature. When the source stream reconnects, the listeners
; are rejoined into the live broadcast.
; Note that the backup file MUST be the same sample rate/channels as the
; live stream in order for this to work properly. Although bit rate CAN
; vary, you can use '%d' to specify the bit rate in the filename
; (i.e. C:\backup%d.mp3 would be C:\backup32.mp3 if you are casting at 32kbps).
; The default is no BackupFile
; BackupFile=C:\intro%d.mp3

위와 비슷하지만, 사용자가 연결을 끊기보다는 스트리밍 음원 재생이 끝났을 경우 처리합니다. AutoDumpUsers 값이 0일 때만 동작합니다.

코드 제목 형식 설정
; TitleFormat specifies a format string for what title is sent to the listener.
; For example, a string of 'Justin Radio' forces the title 'Justin Radio' even
; when the source changes the title. You can use up to one '%s' in the string
; which lets you contain the title from the source. For example, if your
; TitleFormat is 'Justin Radio: %s', and the source plug-in's title is
; 'Billy plays the blues', then the net title is
; 'Justin Radio: Billy plays the blues'. Note: only works on non-relay servers.
; The default is no format string.
TitleFormat=Chris Gentoo Beats: %s

이 항목에서는 SHOUTcast 서버의 비가변 제목 값을 설정합니다. SHOUTcast 서버 이름과 음원 스트림 성격이 다른 경우 설정하십시오. 릴레이 서버에는 동작하지 않습니다.

코드 URL 형식 설정
; URLFormat specifies a format string for what URL is sent to the listener.
; Behaves like TitleFormat (see above).
; The default is no format string.
; URLFormat=http://www.server.com/redirect.cgi?url=%s

TitleFormat과 비슷하지만 음원 스트림 URL 대신 위에서 언급한 URL 을 사용하는 경우는 제외합니다.

코드 원본 스트림 공개 상태 설정
; PublicServer can be always, never, or default (the default, heh)
; Any setting other than default will override the public status
; of the source plug-in or of a SHOUTcast Server that is being relayed.
PublicServer=default

릴레이 서버/소스 프로그램이 목록에 나타났다 해도 서버 자체를 공개 서버로 표시할 지 여부를 지정합니다.

코드 릴레이 허용
; AllowRelay determines whether or not other SHOUTcast Servers will be
; permitted to relay this server.  The default is Yes.
AllowRelay=Yes

AllowRelay는 여러분이 지닌 스트리밍 컨텐트를 다른 서버에서 릴레이할 수 있게 할 수 있게 할지를 결정합니다. 릴레이하지 않을거면 No로 설정하십시오.

코드 공개적으로 원본을 공개하는 릴레이 허용
; AllowPublicRelay, when set to No, will tell any relaying servers not
; to list the server in the SHOUTcast directory (non-public), provided
; the relaying server's Public flag is set to default.  The default is
; Yes.
AllowPublicRelay=Yes

릴레이할 서버를 이미 목록에 나타냈다 하더라도 SHOUTcast 공개 디렉터리 목록에 나타낼 지 여부를 AllowPublicRelay에 지정합니다.

코드 메타 데이터 전송 주기 설정
; MetaInterval specifies how often, in bytes, meta data sent.
; You should really leave this at the default of 32768, but the option is
; provided anyway.
MetaInterval=32768

그냥 있는 대로 내버려두십시오.

접근 설정

코드 최대 감청 시간 설정
; ListenerTimer is a value in minutes of maximum permitted time for
; a connected listener.  If someone is connected for longer than this
; amount of time, in minutes, they are disconnected.  When undefined,
; there is no limit defined.  Default is undefined.
; ListenerTimer=600

왜 이 값이 필요할지는 모르겠습니다. 기본적으로 사용자가 오랜 시간동안 기다리면 끊어버립니다. 아마도 제가 생각하기에는 대기 중인 사용자를 내쫒거나 스트리밍을 들을 사람 수를 설정하는데 목적이 있는 것 같습니다. 값은 분 단위 시간별로 측정합니다.

코드 추방 목록 파일 설정
; BanFile is the text file sc_serv reads and writes to/from
; for the list of clients prohibited to connect to this
; server.  It's automatically generated via the web
; interface.
; BanFile=sc_serv.ban

서버에서 추방할 클라이언트 목록을 담은 파일의 이름입니다. 기본 파일 이름은 sc_serv.ban이지만, 원하는 대로 어떤 이름이든 붙일 수 있습니다.

코드 접속 상시 허용 IP 목록 설정
; RipFile is the text file sc_serv reads and writes to/from
; for the list of client IP addresses which are *ALWAYS* permitted
; to connect to this server (useful for relay servers).
; This file is automatically generated via the web
; interface.  Note that if your server is FULL, and someone
; from a Reserved IP connects, the DNAS will force the person
; listening for the longest time off to make room for the new
; connection.
; RipFile=sc_serv.rip

암울한 이야기 같지만, Rip은 예약 IP입니다. 임의 접근 사용자보다는 더 중요하다고 생각하는 친구 또는 그 밖의 사람들에게 이 기능을 사용하십시오. 가능한한 최대 사용자 수에 맞춰 현재 스트리밍 서비스를 하고 있고 rip 구성원중 하나가 접속해보려고 한다면, 서버에서 가장 오랫동안 청취한 청취자를 쫒아내고 해당 사용자를 받아들입니다.

코드 예약 IP에 해당하는 사용자만 서버에 접근할 수 있도록 설정
; RipOnly, when set to Yes, will only allow IP addresses listed in the Reserved
; IP list to connect and relay.  All other connections for listening will be denied.
; This is really only useful for servers whose sole purpose is to provide the
; primary feed to all public relays.  Setting this value to Yes also forces the
; server into Private mode, since listing this server in the directory would
; be pointless.  Default is No.
; RipOnly=No

이 옵션은 Rip 구성원만 SHOUTcast 서버에 접속할 수 있게 합니다. 개인 라디오 스트리밍을 하거나, 스트리밍을 하여 각 릴레이에서 스트리밍에 접근할 수 있게 하려면 이 설정을 사용할 수 있습니다.

매스 설정

코드 Unique 변수 설정
; Unique: assigns a variable name for use in any configuration item which points to a
; file.  Useful for servers running lots of SHOUTcast Servers that have similar
; configuration parameters, excepting log file names, ban file names, etc.  Any
; parameter that takes a pathname can include the character $, which will
; substitute $ for the variable assigned here.  Keep in mind that the unique
; variable can only be used after it is defined, so don't try to use a unique
; variable substitution in a path before you define it.  For example, you
; could set:
; Unique=my_server
; and then define Log=/usr/local/SHOUTcast/$.log in an included configuration
; file.  Default is Unique=$, so that by default any file with $ in the name
; won't substitute anything at all.

기본적으로, 구동 중인 SHOUTcast 서버 여러대가 있다면, 해당 서버 전부에 대한 기록/추방 등을 의 파일을 모든 설정에 대해 고유하게 바꾸기에는 엄청나게 피곤합니다. 대신 여러분은 Unique를 어떤 값으로 설정할 수 있으며 $ 부분은 설정할 값으로 바꾸시면 됩니다. 이를테면 어떤 파일에 Unique=Jazz가 들어있고 다른 파일에는 Unique=Rock이 들어있다면 Log=/var/log/$.log는 어떤 설정 파일에서 /var/log/Jazz.log가 되고 다른 설정 파일에서 /var/log/Rock.log이 됩니다. 여러대의 SHOUTcast 서버를 비슷한 설정으로 취급할 때 이렇듯 쉽게 다룹니다.

코드 일반 설정 변수 설정
; Include: instructs the sc_serv to read from the named configuration file,
; *at the point of insertion of the Include statement*, and process as though
; the included file was part of itself.  Note that all configuration parameters
; in the DNAS configuration file are processed first to last, so if an item is defined
; twice in a configuration, the last item to process will be the one that takes
; effect.  For this reason, it's usually a good idea to use the Includes first
; in a configuration file.
; example:
; Include=/usr/local/SHOUTcast/common.conf
; Default is not applicable.

여러대의 SHOUTcast 서버를 실행중이고 각 설정 파일에서 유사한 설정 변수를 다 설정하지 않아도 제대로 활용하고 싶다면, 여러 설정간 유사한 설정이 들어있는 파일을 여기서 가리킬 수 있습니다.

최적화 설정

코드 활용할 CPU 갯수 설정
; CpuCount is used to explicitly limit the DNAS to dominating a finite
; amount of processors in multiprocessor systems.  By default,
; SHOUTcast creates one thread for every processor it detects in the
; host system, and assigns listeners equally across all the threads.
; In the event SHOUTcast doesn't correctly determine the number of
; CPUs in your host, or if you for whatever reason want to force
; the DNAS to not use other processors, you can say so here.
; Default behavior is to use as many processors as the DNAS detects on
; your system.
; CpuCount=1

다중 CPU가 달린 시스템에서, SHOUTcast 서버에 CpuCount의 숫자만큼의 프로세서를 활용하도록 강제하려면 이 설정을 활용하십시오. 기본 값은 프로세서 하나당 한개의 스레드를 할당하며 모든 스레드에 청취자를 받습니다. 전체 프로세서 갯수보다 작게 설정하면 나머지 프로세서가 다른 작업을 할 수 있도록 둘 수 있습니다.

코드 데이터 전송 간격 설정
; Sleep defines the granularity of the client threads for sending data.
; DNAS 1.7.0, per client thread, will send up to 1,024 bytes of data
; per socket (or less depending on the window available), and then
; sleep for the provided duration before repeating the whole process.
; Note that making this value smaller will vastly increase CPU usage on
; your machine.  Increasing reduces CPU, but increasing this value too far
; will cause skips.  The value which seems most optimal for 128kbps
; streaming is 833 (833 microseconds per client poll) on our test labs.
; We wouldn't recommend setting it any lower than 100, or any higher than
; 1,024.  If you have a slower machine, set this number lower to fix
; skips.
; Default value is 833.
; Sleep=833

SHOUTcast 서버는 데이터를 보내는 간격 시간을 결정하는데 sleep 값을 사용합니다. 값이 커지면 간격 시간이 길어지고, 값이 작아지면 간격 시간이 짧아지며 SHOUTcast 서버를 깨우는데 CPU를 더 많이 사용합니다. 느린 시스템에서는 언급한 바와 같이 값을 작게 설정하여 SHOUTcast서버가 더욱 빈번하게 사용자에게 전송하고 싶을 지도 모릅니다. 그냥 내버려두는게 최상의 설정입니다.

코드 XML 출력 설정
; CleanXML strips some whitespace and line feeds from XML output which
; confuses some (poorly written) XML parsers.  If you get XML rendering errors,
; try turning this on.  Default is No (off).
; CleanXML=No

아마도 개별 XML 해석 프로그램으로 서버의 개별 통계를 내지 않은 이상 이 설정에 대해 너무 걱정힐 일은 없습니다. XML 파서에서 공백과 XML의 라인피드 문자를 처리하지 못할 때 Yes로 설정하면 제대로 동작합니다.

설정 마무리

SHOUTcast 서버 설정이 끝났습니다. SHOUTcast를 활용하는데 있어 사무용도로는, 해석이 쉽고 개별 형식 통계를 만드는데 사용하는 WC3 기록을 활성화하는것이 좋겠습니다. AdministratorPassword를 활성화해야합니다. 또한 여러 SHOUTcast 서버를 만든다면, 여러 설정 옵션 일부를 활성화하는게 좋습니다.

설정을 진행하면서 SHOUTcast를 띄우고 실행하겠습니다. 간단한 시작 과정을 목적으로 단순한 주문형 스트리밍을 시작하고, 이후에 (무엇인가에 더 관여할)SHOUTcast Trans를 다루겠습니다

SHOUTcast 서버 시작하기

주문형 스트리밍 설정

설정 부분에서 보신바와 같이 주문형 스트리밍은 컨텐트 디렉터리의 mp3 파일에 대한 주문 재생 목록을 자동으로 설정합니다. SHOUTcast 서버 이빌드에서는 /opt/SHOUTcast/content 디렉터리에 모든 주문형 mp3 컨텐트를 담도록 설정합니다. 간단한 주문형 스트리밍 mp3를 만들어보겠습니다.

우선 어디에서든 mp3를 가져와서 컨텐트 디렉터리에 넣어야합니다. sample.mp3 파일을 제가 만든 /Mp3 디렉터리에 넣어보겠습니다.

root #cp sample.mp3 /opt/SHOUTcast/content/
root #cd /opt/SHOUTcast/content/
root #ls
sample.mp3

좋습니다. 파일을 복사했습니다. 이제 SHOUTcast 서버를 시작하여 파일에 접근할 수 있게 해야합니다.

root #/etc/init.d/shoutcast start
 * Starting Shoutcast Server...
*******************************************************************************
** SHOUTcast Distributed Network Audio Server
** Copyright (C) 1998-2004 Nullsoft, Inc.  All Rights Reserved.
** Use "sc_serv filename.ini" to specify an ini file.
*******************************************************************************
                                                                         [ ok ]

작은 배너는 서버가 죽지 않았음을 보려주려고 둡니다(그러니까 서버가 실제로 시작했다는걸 압니다). SHOUTcast 서버를 시작했습니다! 주문형 컨텐트 특성상 브라우저에서만 접근할 수 있습니다. MPlayer 또는 다른 클라이언트에서는 있는 그대로 스트리밍을 받을 수 없습니다. 제 브라우저에서 접근할 때는 kmplayer를 사용했습니다. 다음 이미지를 통해 결과를 보실 수 있습니다.

일부 사람은 오디오 MIME 형식을 처리하기 위해 오데이셔스 설정을 하여, 브라우저에서 스트리밍 컨텐트를 재생할 때 오데이셔스를 띄웁니다. 이제 주문형 컨텐트를 다룰 수 있으니 SHOUTcast Trans를 활용하여 진짜 스트리밍 라디오 서버를 만들어보겠습니다.

SHOUTcast 트랜스 설정

SHOUTcast Trans 도입부

SHOUTcast Trans는 mp3 파일을 더 높은 또는 낮은 비트 전송율로 변환할 수 있는 SHOUTcast 트랜스(코더)입니다. SHOUTcast Trans는 설정 파일에서 지정한 재생 목록의 mp3를 스트리밍할 때 동작합니다. SHOUTcast Trans의 설정을 시작하여 멋진 스트리밍 라디오 스테이션을 실제로 만들어보겠습니다. 이제 /etc/shoutcast/sc_trans.conf SHOUTcast Trans 설정 파일을 여십시오.

root #emerge --ask shoutcast-trans-bin
root #vi /etc/shoutcast/sc_trans.conf

이제 SHOUTcast Trans 설정 파일을 열었으니 스트리밍 음원을 설정하도록 하겠습니다.

SHOUTcast 트랜스 설정

코드 Setting up the playlist
; PlaylistFile (required EVEN IF RELAYING) - play list file (to create, use
; find /path/to/mp3/directory -type f -name "*.mp3" > playlist_filename.lst)
PlaylistFile=/opt/SHOUTcast/playlists/playlist.lst

이 설정은 SHOUTcast에게 스트리밍 미디어 음원 탐색 위치를 알립니다. 이 설정은 실제 존재하는 파일이 필요하므로, 재생목록 부터 만들도록 합시다. 앞서 참고한 /Mp3 디렉터리를 간단하게 만들겠습니다.

user $find /Mp3 -type f -name "*.mp3" > /opt/SHOUTcast/playlists/playlist.lst

재생 목록을 설정했고 설정 파일에서 재생 목록을 가리키고, SHOUTcast Trans가 어떤 파일을 스트리밍으로 내보낼지 인지하도록 하겠습니다.

코드 서버 IP 및 포트 설정
; Serverip/ServerPort are the target server to send to
Serverip=127.0.0.1
ServerPort=8000

이 설정은 스트리밍 컨텐트를 보낼 곳을 결정합니다. 이 안내서에서는 앞서 설정한 SHOUTcast 서버의 IP와 포트번호(DestIP와 PortBase)가 되겠습니다.

코드 SHOUTcast 서버 암호 설정
; Password is the password on the sc_serv you're sending to.
Password=password_you_setup_in_sc_serv.conf

SHOUTcast 서버 설정에서 설정한 암호와 동일합니다.

코드 스트림 정보 설정
; StreamTitle/URL/Genre define the data that appears on the directory and in the
; stream info.
StreamTitle=Chris Gentoo Beats
StreamURL=http://www.gentoo.org
Genre=JPOP Electronica And More!

스트리밍 제목(예: Radio One), URL(예: http://www.radio-one.com), 장르(예: Electronica Trance Tribal)를 설정합니다.

코드 기록 파일 설정
; Logfile optionally denotes a text file to log sc_Trans to.  a kill -HUP
; will force a close and re-open of this file (but will also cease logging to
; the console)
LogFile=/var/log/sc_Trans.log

SHOUTcast Trans 기록 파일을 지시합니다. 모든 기록은 여기에 들어갑니다.

코드 재생 순서 뒤섞기 설정
; Shuffle the play list
Shuffle=1

재생 목록의 재생 곡을 임의로 재생할지 여부를 결정하빈다. 대부분 1로 설정합니다. 곡 요청을 허용한다면 0으로 설정하십시오. 자세한건 나중에 설명하겠습니다.

코드 스트림 설정
; Bitrate/SampleRate/Channels recommended values:
; 8kbps 8000/11025/1
; 16kbps 16000/11025/1
; 24kbps 24000/22050/1
; 32kbps 32000/22050/1
; 64kbps mono 64000/44100/1
; 64kbps stereo 64000/22050/2
; 96kbps stereo 96000/44100/2
; 128kbps stereo 128000/44100/2
Bitrate=128000
SampleRate=44100
Channels=2
; Quality is from 1-10. 1 is best, 10 is fastest.
Quality=1

Bitrate는 스트림의 비트 전송율을 설정합니다. 8000 (8kbps) 에서 128000 (128kbps) 까지입니다. SampleRate는 스트림 샘플링처리율을 설정할 수 있습니다. 11025 (11025kHz) 값에서 44100 (44100kHz)까지입니다. Channels는 방송으로 실어보낼 스트림의 채널 갯수를 설정합니다. 모노면 1 스테레오는 2가 됩니다. Quality는 스트림의 음원 품질을 설정합니다. Bitrate/SampleRate/Channels에서 관리하기도 합니다. 스트림을 얼마나 압축할지를 담당하는 부분이기도 합니다. 1은 최고의 품질로, 10은 최대 속도로 전송하도록 압축합니다. 이 값을 설정할 때 연결 상태를 고려하십시오! mp3를 스트리밍 처리할 값은 이 안내서에서 주어진 값을 따르십시오.

코드 크로스 페이딩 설정
; Mode=0 for none, 1 for 100/100->100/0, 2 for 0/100->100/0
CrossfadeMode=1
; Length is ms.
CrossfadeLength=8000

곡 크로스페이딩을 설정합니다. 크로스페이딩을 비활성화하려면 0으로 설정합니다. 1로 설정하면 첫번째 곡을 페이드 아웃처리하고 두번째 곡을 페이드 인 처리합니다. 첫번째 곡은 페이드 인 처리하고 두번째 곡을 페이드 아웃 처리합니다. 페이딩 처리 시간은 밀리초로 지정합니다.

코드 ID3 태그 사용 활성화
UseID3=1

mp3 정보를 다룰 때 ID3 태그를 활용할지 여부를 결정합니다.

코드 공개 상태 설정
; Public determines whether or not this station will show up in the directory
Public=0

서버를 릴레이 처리할 때 공개적으로 스트리밍을 보여줄지 여부를 설정합니다. sc_serv.conf 의 PublicServer 설정이 이 설정 값을 덮어씀을 기억하십시오!

코드 사용자 소통 설정
; Put stuff here for user interaction (AOL IM, ICQ, IRC)
AIM=AIMHandle
ICQ=
IRC=SHOUTcast

여러분(DJ)께 정보를 어떻게 전달할지를 설정합니다. 곡 요청 등의 목적으로 AIM 또는 ICQ 채널을 설정할 수 있습니다. 마찬가지로 IRC 채널도 설정하여 여러 사용자와 소통할 수 있게 할 수 있습니다.

SHOUTcast 트랜스 설정 마무리

SHOUTcast Trans는 SHOUTcast 서버로 스트리밍을 할 준비가 됐습니다! 이제 mp3 스트리밍을 시작하겠습니다.

SHOUTcast 트랜스 시작하기

SHOUTcast 트랜스 시작

SHOUTcast 서버와 SHOUTcast Trans를 종종 사용하기에, 여러분이 SHOUTcast를 시작할 SHOUTcast Trans를 (상당히 쉽게) 설정하겠습니다.

root #/etc/init.d/shoutcast_trans start
 * Starting Shoutcast Server...
*******************************************************************************
** SHOUTcast Distributed Network Audio Server
** Copyright (C) 1998-2004 Nullsoft, Inc.  All Rights Reserved.
** Use "sc_serv filename.ini" to specify an ini file.
*******************************************************************************
                                                  [ ok ]
* Starting Shoutcast Trans...                     [ ok ]

SHOUTcast 트랜스 스트림 감상

SHOUTcast Trans를 시작했으니 스트리밍을 감상할 시간입니다. 스트리밍을 재생하기 위해 이 예제에서 MPlayer를 활용하겠습니다.

user $mplayer -cache 1024 http://127.0.0.1:8000/
...
Playing http://127.0.0.1:8000/.
Connecting to server 127.0.0.1[127.0.0.1]:8000 ...
Name   : Chris Gentoo Beats
Genre  : JPOP Electronica And More!
Website: http://www.gentoo.org
Public : no
Bitrate: 128kbit/s
Cache size set to 1024 KBytes
Connected to server: 127.0.0.1
Cache fill:  9.38% (98304 bytes)    Audio file detected.
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
MP3lib: init layer2 and 3 finished, tables done
mpg123: Can't rewind stream by 156 bits!
AUDIO: 44100 Hz, 2 ch, 16 bit (0x10), ratio: 16000->176400 (128.0 kbit)
Selected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
Checking audio filter chain for 44100Hz/2ch/16bit -> 44100Hz/2ch/16bit...
AF_pre: af format: 2 bps, 2 ch, 44100 hz, little endian signed int
AF_pre: 44100Hz 2ch Signed 16-bit (Little-Endian)
AO: [oss] 44100Hz 2ch Signed 16-bit (Little-Endian) (2 bps)
Building audio filter chain for 44100Hz/2ch/16bit -> 44100Hz/2ch/16bit...
Video: no video
Starting playback...

클리핑한 부분입니다. -cache 변수는 더 큰 버퍼링 값 설정에 우선했습니다. 그리고 ... 이거네요! 스트리밍 미디어를 청취중입니다! 다음에는 SHOUTcast 서버에 뭔가 더 할 수 있는걸 보여드리겠습니다.

고급 SHOUTcast 사용법

기업 용도

기업체에서는 여러가지 방식으로 SHOUTcast를 활용할 수 있습니다:

  1. 좀 더 관심있는 일일 알림 방송 용도로 주문형 컨텐트 스트리밍 활용.
  2. 그 때 그 때 발표할 공개 알림 스트리밍으로, 클라이언트에게 어떤 일이 일어나고 있는지 적소에 전달합니다! 추후 참고 용도로 주문형 컨텐트 스트리밍처럼 방송할 내용을 보관합니다.
  3. 스트리밍 미디어 인터뷰 및 주문형 컨텐트 스트리밍 보관.

기업체에서 SHOUTcast 서버를 활용할 방법의 가능성은 여러가지가 있습니다. 한물 간 텍스트 대신 실시간 스트리밍 미디어를 활용하세요!

SHOUTcast로 선곡 재생

SHOUTcast 서버는 신인 또는 전문 DJ 같은 사람들에게 인기있는 서버입니다. 시작에 있어, SHOUTcast 서버를 다루는 사용자 경험을 키울 몇가지 방식이 있습니다. 도입 음원의 보유는 매우 핵심적인 사항입니다. 여러분의 방송국에 대한 인상을 사용자에게 전달합니다. 꼭 넣으십시오! yp.SHOUTcast.com에 서버를 올려(SHOUTcast 서버 설정 부분에서 설명했음) 여러분의 방송국이 어디있는지 알게 하십시오. 가장 특별한건 요청을 받을 수 있다는겁니다. 요청을 설정하려면 우선 sc_Trans.conf에서 임의 섞기 기능을 끄십시오. 대략 10곡 정도 지정하여 시작할 준비를 하십시오. 그 다음 중간 중간 요청하는 곡의 요청 처리를 시작하십시오. 누군가가 곡을 요청하면, 그냥 재생 목록의 끝에 추가하면 되며, SHOUTcast Trans가 재생목록에 대해 어떤 동작을 처리할 지는 스크립트를 활용하시면 됩니다:

코드 djcontrol
#!/bin/bash
 
case "$1" in
  "reload")
    kill -s USR1 `cat /var/run/SHOUTcast_Trans.pid`
    ;;
  "next")
    kill -s WINCH `cat /var/run/SHOUTcast_Trans.pid`
    ;;
  *)
    echo "Invalid command"
    ;;
esac

재생 목록에 노래를 추가했다면 SHOUTcast Trans에 새 요청 항목으로 재생 목럭이 바뀌었음을 알려야합니다.

user $djcontrol reload

어떤 노래를 요청하여 다음에 재생할 지 사용자에게 알려주어야 합니다. 원하는 경우 다음 명령으로 건너뛸 수 있습니다:

user $djcontrol next

이전으로 돌아가는 방법이 없으니 너무 많이 건너뛰지 않게 조심하십시오. 노래에 도달하면 요청 항목 재생을 시작합니다. 5개 정도 가져오거나 여러분이 요청을 시작하기 전 요청한 값을 취합니다. 이 방식으로는 어떤 식으로든 처음으로 돌아갈 수 없습니다. 요청 항목을 시작할 때 간헐적 끊김이 있으며 요청시간을 넘긴다 예상이 된다면, 다음 세션의 재생 목록을 요청 재생 목록에 덮어쓰고 재생 목록을 다시 불러오시면 됩니다. 현재 재생 노래가 끝나면 새 재생 목록으로 돌아갑니다.

마무리

SHOUTcast 서버 및 SHOUTcast Trans 지침서의 내용이 끝났습니다. 여러분이 여기서 정보를 얻고 도움이 되었길 바랍니다. 이 페이지에 대한 의견이나 제안이 있으면 전자메일을 보내주십시오! 새 SHOUTcast 스트리밍 서버를 재밌게 활용하세요!


This page is based on a document formerly found on our main website gentoo.org.
The following people contributed to the original document: Chris White, Shyam Mani
They are listed here because wiki history does not allow for any external attribution. If you edit the wiki article, please do not add yourself here; your contributions are recorded on each article's associated history page.