제   목 : RoundCube 웹메일 설치방법

구   분 : 설치 메뉴얼
작성자 : 이선규 (neosky)  (neosky(at)smileserv.com, admin(at)nple.com,
http://seroot.com)
작성일 : 2010년 7월 13일



0. RoundCube Webmail 소개

RoundCube Webmail (라운드큐브 웹메일)l은 웹에서 편리하게 메일서비스를 이용할 수 있도록 하는
프로그램입니다. 기존에 사용하던 Squirrel Mail (다람쥐 메일) 보다는 세련된 인터페이스를 보여주고 있습니다.


▼ RoundCube Webmail 공식 홈페이지

사용자 삽입 이미지


▼ RoundCube Webmail 을 사용하기 위한 서버 필요사항 및 테스트된 브라우저 환경

Server Requirements

  • Apache, Lighttpd (>=1.4.13 for SSL), or Cherokee Web server
  • Directory on the Web server allowed to run scripts
  • If using Apache, .htaccess support or configuration to override DirectoryIndex
  • PHP version 5.2.1 or greater with
    • PCRE (Perl-Compatible Regular Expressions)
    • Session support
    • Socket support
    • MySQL, PostgreSQL, or SQLite database engine
    • iconv (recommended)
    • OpenSSL (recommended)
    • Mbstring (optional)
    • FileInfo (optional)
    • Mcrypt (optional)
  • php.ini options:
    • error_reporting E_ALL & ~E_NOTICE (or lower)
    • file_uploads on (for attachment upload features)
    • memory_limit (increase as suitable to support large attachments)
    • session.auto_start off
    • magic_quotes_gpc off
  • If using MySQL or PostgreSQL, a database server and database user with permission to create tables
    • If using MySQL 5.0.2 or later, disable STRICT_TRANS_TABLES and STRICT_ALL_TABLES
  • OpenSSL and Socket modules for PHP required to connect to secure IMAP or IMAPS, for secure SMTP and to use the spell checker
    • Additionally, the CURL module for PHP is required for spell checking with TinyMCE (HTML WYSIWYG Editor).
  • An IMAP server which supports IMAP 4 rev 1
  • An SMTP server (recommended) or PHP configured for mail delivery

Browser Requirements

  • JavaScript? enabled
  • Accept cookies
  • Support for XMLHttpRequest
  • CSS2 Support

Tested browsers

  • Internet Explorer 6 (Windows 2000 and Windows XP)
  • Internet Explorer 7 (Windows XP)
  • Safari 2 (Mac OS X 10.4)
  • Safari 3 (Mac OS X 10.5 and Windows XP)
  • Firefox 2 (Windows XP, Mac OS X, and Linux)
  • Firefox 3 (Windows XP, Linux, and OpenSolaris)

Browsers reported to work

  • Camino 1.5.x (Mac OS X 10.4)
  • Opera 9.25 (Windows Server 2003, Windows XP, and FreeBSD 6)
  • Opera 9.30 (Wii, TinyMCE is non-functional)
  • Opera 9.60 beta1 (Windows XP)


RoundCube Webmail 설치


1. RoundCube Webmail 다운로드

2010.07 현재 최신버전은 0.3.1 이고, 0.4 beta 버전이 발표되어 있다.
아래 URL에서 다운로드 받거나, 그 다음 URL에서 직접 다운로드 한다.

 - 다운로드 메뉴 : http://www.roundcube.net/download
 - 다운로드 주소 : http://downloads.sourceforge.net/project/roundcubemail/roundcubemail/0.3.1/roundcubemail-0.3.1.tar.gz?use_mirror=cdnetworks-kr-2&ts=1278983479

▲ /usr/local/src 디렉토리로 이동해서 다운로드 받습니다.

# cd /usr/local/src
# wget http://downloads.sourceforge.net/project/roundcubemail/roundcubemail/0.3.1/roundcubemail-0.3.1.tar.gz?use_mirror=cdnetworks-kr-2&ts=1278983479


 
2. 서버측 설치작업

▲ 압축해제

# tar xvfz roundcubemail-0.3.1.tar.gz
...
roundcubemail-0.3.1/skins/default/watermark.html
roundcubemail-0.3.1/SQL/
roundcubemail-0.3.1/SQL/mssql.initial.sql
roundcubemail-0.3.1/SQL/mysql.initial.sql
roundcubemail-0.3.1/SQL/mysql.update.sql
roundcubemail-0.3.1/SQL/postgres.initial.sql
roundcubemail-0.3.1/SQL/postgres.update.sql
roundcubemail-0.3.1/SQL/sqlite.initial.sql
roundcubemail-0.3.1/SQL/sqlite.update.sql
roundcubemail-0.3.1/temp/
roundcubemail-0.3.1/temp/.htaccess
roundcubemail-0.3.1/UPGRADING


▲ 웹에서 서비스할 위치로 이동시킵니다.

# mv roundcubemail-0.3.1 /home/nple/public_html/mail
 

▲ logs, temp 디렉토리에 쓰기권한을 부여합니다.

# chmod 707 logs temp
`logs'의 모드를 0707(rwx---rwx)으로 변경하였습니다
`temp'의 모드를 0707(rwx---rwx)으로 변경하였습니다


▲ 데이터베이스를 생성합니다.

mysql> CREATE DATABASE roundcubemail;
mysql> GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcubemail@localhost IDENTIFIED BY 'fkdnsemzbqmapdlf)(*&';
mysql> FLUSH PRIVILEGES;
mysql> quit


▲ 웹에서 접근할 수 있도록 버추얼호스트 설정을 해줍니다.

<VirtualHost 222.122.11.22>
   DocumentRoot "/home/nple/public_html/mail"
   ServerName mail.nple.com
   ErrorLog "logs/mail.nple.com-error_log"
   CustomLog "logs/mail.nple.com-access_log" combined
</VirtualHost>

# /etc/init.d/apachectl graceful


3. 웹에서 설치작업
 


3-1. 필요요건 안내

아래 화면에서와 같이 충족요건이 갖추어져야 합니다.

   1. PHP 5.2.0 버전이나 그 이상에서 포함되어야 하는 것들

       - PCRE, Session support, Libiconv (추천사항), OpenSSL (추천사항), FileInfo (선택사항),
         Multibyte/mbstring (선택사항), Mcrypt (선택사항)

   2. php.ini 옵션에 설정되어야 하는 것들

       - error_reporting E_ALL & E_NOTICE (또는 이하)
       - file_uploads on
       - session.auto_start off

   3. MySQL 또는 PostgreSQL 데이터베이스 엔진 또는 SQLite extension for PHP
  
   4. SMTP Server (추천사항) or 메일 배달을 위한 PHP 설정


* 위 조건에 충족된다면 [START INSTALLATION] 버튼을 눌러 진행하도록 합니다.


▼ RoundCube Webmail Installer 초기화면

사용자 삽입 이미지



3-2. 환경체크

앞에서 충족요건사항에 대해 자체체크하게 되고, 그 결과 값을 보여준다.


▼ RoundCube Webmail Installer 에서 체크한 서버환경


사용자 삽입 이미지



3-3. 환경설정 (이미지는 클릭하면 크게 보임)

RoundCube Webmail 을 이용하기 위한 환경설정으로 설치 이후에도 설정가능하므로
여기서는 기본적으로 설정되어야 할 사항에 대해서만 살펴보겠다.

1. Database setup -- 앞에서 설정했던 DATABASE 정보를 입력해준다.

Database type : [ MySQL ]

Database server : localhost
Database name : roundcubemail
Database user name : roundcubemail
Database password : 패스워드


2. IMAP Settings 

default_host : nple.com  (사용할 도메인을 입력합니다. +add 로 도메인 추가가 가능합니다.)


3. SMTP Settings

smtp_server : mail.nple.com (메일호스트 도메인을 입력합니다.)


4. Display settings & user prefs

language : ko_KR (사용할 언어를 입력합니다.)


[CREATE CONFIG] 를 눌러 다음으로 진행합니다.


▼ RoundCube Webmail Installer 에서 환경설정 화면

사용자 삽입 이미지


3-4. config 설정파일 복사

 새로 작성된 main.inc.php 와 db.inc.php 파일 내용을 복사해서 서버내 config 디렉토리 내에 생성합니다.

# cd /home/nple/public_html/mail/config
# vi main.inc.php  (내용 복사후 저장)
# vi db.inc.php (내용 복사후 저장)

[CONTINUE] 를 눌러 다음으로 진행합니다.


3-5. 환경 테스트

모든 항목이 올바로 되어 있다면 아래와 같이 OK 메세지를 만날 수 있습니다.
여기서 메일 테스트를 해볼 수 있으나, 실제 RoundCube Webmail 로 접속해서 메일 발송을 해보도록 하겠습니다.


▼ RoundCube Webmail Installer 에서 환경테스트 화면


사용자 삽입 이미지



4. 설치파일 삭제

   설치후 필요없는 installer 디렉토리는 삭제합니다.

# rm -rf /home/nple/public_html/mail/installer


5. 메일 접속

  앞에서 설정한 주소로 접속합니다.   사용자명, 비밀번호를 입력하라는 화면이 출력됩니다.


▼ RoundCube Webmail 로그인 화면

사용자 삽입 이미지



▼ RoundCube Webmail 로그인 후 메인 화면


사용자 삽입 이미지



이상으로 RoundCube Webmail 에 대해 알아봤습니다.

2010/07/13 11:17 2010/07/13 11:17








마음튼튼 이 작성.

당신의 의견을 작성해 주세요.

  1. Comment RSS : http://seroot.com/rss/comment/124
  2. OpenID Logo https://me.yahoo.com/a/bKJoZ6gmh._zWOzk3Ap0g88xNzsnDA--#38a00 2011/05/31 21:39  편집/삭제  댓글 작성  댓글 주소

    설치까지는 완료했는데, 로그인에서 막히네요.
    아이디를 생성하는법도 모르겠습니다.
    로그인하는것좀 도와주세요.

[로그인][오픈아이디란?]
오픈아이디로만 댓글을 남길 수 있습니다


웹 방화벽 Apache mod_security 모듈 설치하기

작성일자 : 2010년 3월 5일  (2010년 1월 5일 nple.net에 게시한 글을 옮기고 수정을 봄)
작성자 : neosky (nple.com/seroot.com)


1. mod_security 모듈의 개요

mod_security 모듈은 가장 널리 알려져 있는 웹 서비스 (http, https)의 공격을 효과적으로
차단할 수 있는 공개 웹 방화벽입니다.

Apache 모든 버전에서 적용에서 설치, 적용이 가능합니다.

공격 패턴의 종류로는 XSS, PHP Injection, SQL Injection, Command Execute 등이 있습니다.


2. 설치를 위한 파일 준비 

- 설치환경 : Redhat Linux 계열 CentOS 5.4

- PCRE (Perl Compatible Regular Expressions)

   * 사이트 주소 : http://www.pcre.org/
   * 파일 주소 : ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.00.tar.gz
                     (2010년 1월 현재 최신 버전은 8.00)

- mod_security

   * 사이트 주소 :  http://www.modsecurity.org/
   * 파일 주소 : http://www.modsecurity.org/download/modsecurity-apache_2.5.11.tar.gz
                     (2010년 2월 현재 최신 버전은 2.5.12 이나 설치후 아파치 시작시 먹통되는 증상이 있음)


3. 설치를 위한 조건사항

mod_security 모듈을 설치하기 위해서 먼저, apache 데몬이 서버에 설치되어 있어야 합니다.
(apr, apu 명령을 사용하기 위함)

그리고, 서버에 PCRE 라이브러리가 설치되어 있어야 합니다.


4. PCRE 라이브러리 설치

작업하기 위한 공간으로 /usr/local/src 디렉토리에 프로그램을 다운로드 받습니다.
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.00.tar.gz

다운로드 받은 파일의 압축을 풉니다.
tar xvfz pcre-8.00.tar.gz

디렉토리에 접근해 라이브러리를 설치합니다.
cd pcre-8.00
./configure --prefix=/usr/local/pcre
make
make install


5. mod_security 모듈 설치

작업하기 위한 공간으로 /usr/local/src 디렉토리에 프로그램을 다운로드 받습니다.
wget http://www.modsecurity.org/download/modsecurity-apache_2.5.11.tar.gz

다운로드 받은 파일의 압축을 풉니다.
tar xvfz modsecurity-apache_2.5.11.tar.gz

디렉토리에 접근해 모듈을 설치합니다.
cd modsecurity-apache_2.5.11/apache2/

아파치 버전에 따라 설치 옵션을 달립니다.

Apache 2.0
./configure --with-apxs=/usr/local/apache/bin/apxs --with-pcre=/usr/local/pcre --with-apr=/usr/local/apache/bin/apr-config --with-apu=/usr/local/apache/bin/apu-config

Apache 2.2
./configure --with-apxs=/usr/local/apache/bin/apxs --with-pcre=/usr/local/pcre --with-apr=/usr/local/apache/bin/apr-1-config --with-apu=/usr/local/apache/bin/apu-1-config

make
make install


6. 아파치 환경파일 (http.conf) 추가

아파치 환경파일을 열어 위에서 설치한 모듈을 불러드립니다.
LoadModule security2_module    modules/mod_security2.so

그리고, 파일 맨 하단에 다음 문을 추가합니다.
차후 다운로드 받을 룰셋 파일을 불러드리기 위함입니다.

# mod_security roll include
Include conf/mod_security.conf


7. KISA에서 배포하는 룰셋 다운로드

한국정보보호진흥원(KISA)에서 mod_security 룰셋을 공개 배포하고 있습니다.
* 사이트 : http://toolbox.krcert.or.kr/MMVF/MMVFView_V.aspx?MENU_CODE=8&PAGE_NUMBER=13

왼쪽 메뉴중 공개웹방화벽 -> ModSecurity 자료실 클릭해서
ModSecurity용 차단 샘플룰 [`09.03.11] 게시물의 파일을 다운로드 받습니다.

서버 /usr/local/apache/conf 위치에 업로드해서 mod_security.conf 이름으로 변경해서
사용하면 되고, 이후 설정방법은 같이 다운로드 받은 압축파일 내 파일을 참조합니다.

Apache 1.3.x 은 ModSecurity_1x_hosting_090311.conf 룰셋 사용
Apache 2.x 이상은 ModSecurity_2x_hosting_09311.conf 룰셋 사용

샘플 룰은 초기 설정이 실제 차단하는 것으로 되어 있지 않으므로,
커스터마이징 후 적용하도록 합니다.


8. 아파치 재시작

위 모든 과정을 마쳤으면, 아파치를 재시작합니다.
/etc/init.d/apachectl restart


[mod_security 설치후 apache error log 에 다음 내용이 남는다면!!]

[error] ModSecurity: ModSecurity requires mod_unique_id to be installed.

아파치 소스 있는 곳으로 가서 아래 명령을 내려주고
/usr/local/apache/bin/apxs -cia mod_unique_id.c

아파치를 재시작합니다.
/etc/init.d/apachectl restart

소스가 없다면 같은 apache 버전 다운로드후 압축을 풀고
위와 같이 명령내려주고, 아파치를 재시작합니다.


* SEROOT.COM 블로그는 맑은고딕체가 설치된 PC에서 잘 보입니다.  :)

2010/03/05 00:59 2010/03/05 00:59








마음튼튼 이 작성.

당신의 의견을 작성해 주세요.

  1. Comment RSS : http://seroot.com/rss/comment/85
  2. OpenID Logo 리나 2010/09/27 13:15  편집/삭제  댓글 작성  댓글 주소

    안녕하세요?
    CentOS, 아파치2.2x를 사용하는 유저입니다.
    처음에 mod_security 1.95 버전을 설치를 했는데 이게 아파치 1.xx버전용이더라구요.
    그래서 아파치 2.xx 버전용인 mod_security 2.5.12를 다시 설치하려고 하는데요.

    우선 mod_security 1.95 버전을 지워야 할 것 같은데 방법을 모르겠습니다.

    httpd.conf 파일에서 mod_security 관련 부분만 삭제해주면 되는지 아니면 설치한 디렉토리까지 삭제해줘야 하는지...^^;;

    mod_security 삭제하는 방법에 대해서 답변을 주시면 감사드리겠습니다.

  3. OpenID Logo 리나 2010/09/27 13:18  편집/삭제  댓글 작성  댓글 주소

    그리고 서버에 mod_security 압축을 푼다음
    콘피그 설정에서 아래 문장을 그대로 붙여넣기 해서 실행해 주면 되나요?

    ./configure --with-apxs=/usr/local/apache/bin/apxs --with-pcre=/usr/local/pcre --with-apr=/usr/local/apache/bin/apr-1-config --with-apu=/usr/local/apache/bin/apu-1-config

    readme 파일에 보면 아래처럼 옵션을 각각 따로 실행해주는 것처럼 설명이 되어 있어서 헷갈리네요. ^^;;
    ./configure --with-apxs=/usr/local/apache/bin/apxs
    ./configure --with-pcre=/usr/local/pcre

[로그인][오픈아이디란?]
오픈아이디로만 댓글을 남길 수 있습니다


FFMPEG 설치
(주)스마일서브 고객기술지원팀 / 이선규


1. FFMPEG 이란?


FFMPEG 는 음악과 영상을 녹화하고 변환하고 스트리밍하는 모든 기능을 제공하는 패키지이다.
FFMPEG 는 리눅스에서 개발되었으나, 다른 많은 윈도우를 포함한 OS를 지원한다.

* The project is made of serveral components ;
  - FFMPEG : 비디오 파일 포멧을 다른 포멧으로 변환할 수 있는 커맨드 라인 툴
                    TV 수신 카드로 부터 실시간 영상을 받아 인코딩 할 수 있다.
  - FFSERVER : HTTP 프로토콜을 사용하는 스트리밍 서버이다. 
                      실시간 재생 도중 재생 위치 변경 기능을 제공한다.
  - FFPLAY : SDL과 FFMPEG 를 사용해서 구현된 간단한 재생 프로그램이다.
  - LIBAVCODEC : FFMPEG 에서 사용하는 모든 오디오/비디오 코덱이 들어있는 라이브러리이다.
                           최고의 효율과 코드 재사용성을 목표로 만들어졌다.
  - LIBAVFORMAT : FFMPEG 에서 사용하는 모든 오디오/비디오 코덱을 파싱하고 생성하는 루틴들이
                             들어있는 라이브러리이다.

여기서 우리는 FFMPEG 설치에 대해 살펴보기로 한다.


* FFMPEG Install 소스배포 주소 : http://www.sherin.in/

2. ffmpeginstall 소스 다운로드

2009년 2월 현재 최신 버전은 ffmpeginstall.3.2.1 이고 Link 주소 에서 다운로드 가능하다.
http://www.sherin.in/forum/project-announcements.html


3. 설치되는 rpm 패키지 목록

yum install gcc gcc-c++ libgcc gd gd-devel gettext freetype \
        freetype-devel ImageMagick ImageMagick-devel libjpeg* libjpeg-devel* \
        libpng* libpng-devel* libstdc++* libstdc++-devel* libtiff* \
        libtiff-devel* libtool* libungif* libungif-deve* libxml* libxml2* \
        libxml2-devel* zlib* zlib-devel* automake* autoconf* samba-common* \
        ncurses-devel ncurses patch make

4. 설치되는 코덱관련 프로그램 및 라이브러리 목록

libwmf 0.2.8.3
ruby 1.8.6
flvtool2 1.0.5-rc6
lame 3.97
codecs all-20071007
libogg 1.1.3
libvorbis 1.1.2
vorbistools 1.1.1
libtheora 1.0alpha7
amrnd 7.0.0.1
amrwb 7.0.0.2
liba52 0.7.4
facc 1.26
faad2 2,6,1
yasm 0.6.1
nasm 2.02
xvidcore 1.1.0
x264 snapshot-20080516-2245
re2c 0.13.4
mplayer 1.0 rc1
ffmpeg SVN-r14473
ffmpeg-php 0.5.3.1

* 모든 소스는 제작자 홈페이지에서 직접 다운로드 받아 설치된다.

5. 다운로드 받은 파일을 적당한 위치에 풀어놓는다.

# tar xvfz ffmpeginstall.3.2.1.tar.gz

./ffmpeginstall.3.2.1/
./ffmpeginstall.3.2.1/re2c.sh
./ffmpeginstall.3.2.1/README
./ffmpeginstall.3.2.1/post.sh
./ffmpeginstall.3.2.1/liba52.sh
./ffmpeginstall.3.2.1/codecs.sh
./ffmpeginstall.3.2.1/ffmpeg-php.sh
./ffmpeginstall.3.2.1/libtheora.sh
./ffmpeginstall.3.2.1/COPYRIGHT
./ffmpeginstall.3.2.1/INSTALL
./ffmpeginstall.3.2.1/amrwb.sh
./ffmpeginstall.3.2.1/template.sh
./ffmpeginstall.3.2.1/x264.sh
./ffmpeginstall.3.2.1/install.sh
./ffmpeginstall.3.2.1/amrnb.sh
./ffmpeginstall.3.2.1/flvtool.sh
./ffmpeginstall.3.2.1/xvid.sh
./ffmpeginstall.3.2.1/vorbistools.sh
./ffmpeginstall.3.2.1/nasm.sh
./ffmpeginstall.3.2.1/mplayer.sh
./ffmpeginstall.3.2.1/faad2.sh
./ffmpeginstall.3.2.1/libogg.sh
./ffmpeginstall.3.2.1/ffmpeginstall.so.conf
./ffmpeginstall.3.2.1/presetup.sh
./ffmpeginstall.3.2.1/install
./ffmpeginstall.3.2.1/lame.sh
./ffmpeginstall.3.2.1/facc.sh
./ffmpeginstall.3.2.1/libwmf.sh
./ffmpeginstall.3.2.1/libvorbis.sh
./ffmpeginstall.3.2.1/LICENSE
./ffmpeginstall.3.2.1/yasm.sh
./ffmpeginstall.3.2.1/start.sh
./ffmpeginstall.3.2.1/ruby.sh
./ffmpeginstall.3.2.1/ffmpeg.sh

6. 풀어놓은 소스 위치로 이동하고, 몇가지 부분을 수정하여 준다.

# cd ffmpeginstall.3.2.1

# vi install.sh 파일을 열어 49라인쯤을 보면 설치시 서버의 호스트네임을 제작자 메일로 발송해주도록
되어 있는데 발송되지 않게끔 하려면  주석처리 한다.

#echo `hostname -i `|mail -s " FFmpeg installed $_version " sherinmon@gmail.com

# vi start.sh
==> 29라인쯤을 보면 php를 소스로 설치한 경우 다음 같이 전체 경로를 적어준다.
/usr/local/php/bin/php -i |grep -i php.ini

# vi ffmpeg-php.sh
==> 41라인쯤을 보면 php를 소스로 설치한 경우 다음 같이 전체 경로를 적어준다.
/usr/local/php/bin/phpize

# vi post.sh
==> 31라인쯤을 보면 php를 소스로 설치한 경우 다음 같이 전체 경로를 적어준다.
/usr/local/php/bin/php -i |grep -i ffmpeg


7. 설치 메인 스크립트 (install.sh) 실행

# sh install.sh


다음과 같은 화면이 뜨고 '엔터'키를 누르면 php.ini 경로를 입력하라는 프롬프트가 뜬다.

##########################     ffmpeg installation script 3.2.1 ############################
#                     Note:This program is distributed in the hope that it will be useful,     #
#                         but WITHOUT ANY WARRANTY; without even the implied warranty of       #
#                               MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE                  #
#                                 See the GNU General Public License for more details.         #
#                                    -Sherin                                                   #
#If you find a bug please report at the forum : http://www.sherin.in/forum/                  #
#If  wish to modify the script please send a mail to me at sherinmon@gmail.com               #
#So that I can add it to the next release including your contact details too.                  #
#                           Please read the files README ,INSTALL and COPYRIGHT                #
################################################################################################

 All operations are loged to /var/log/ffmpeginstall.3.2.1.log.11111  . Check the logs for any failure
Press Enter to continue...........
Configuration File (php.ini) Path => /usr/local/apache/conf
Loaded Configuration File => /usr/local/Zend/etc/php.ini


Enter the full path to php.ini (see above ) : 이 곳에 바로 위 라인에서 로딩된 php.ini 경로를 적어준다.


8. 설치 진행

 스크립트 실행 순서에 따라 yum으로 rpm이 설치되고 각종 소스파일이 설치된다.

emoving useless libraries,please wait....................... done
creating folders..........done
Creating ldd configurations .......... doneEnsuring required RPM ........
Loading "fastestmirror" plugin
Loading mirror speeds from cached hostfile
 * base: ftp.daum.net
 * updates: ftp.daum.net
 * addons: ftp.daum.net
 * extras: ftp.daum.net
Setting up Install Process
Parsing package install arguments
Package gcc - 4.1.2-42.el5.i386 is already installed.
Package gcc-c++ - 4.1.2-42.el5.i386 is already installed.
Package libgcc - 4.1.2-42.el5.i386 is already installed.
Package gd - 2.0.33-9.4.el5_1.1.i386 is already installed.
Package gd-devel - 2.0.33-9.4.el5_1.1.i386 is already installed.
Package gettext - 0.14.6-4.el5.i386 is already installed.
Package freetype - 2.2.1-20.el5_2.i386 is already installed.
Package freetype-devel - 2.2.1-20.el5_2.i386 is already installed.
Package ImageMagick - 6.2.8.0-4.el5_1.1.i386 is already installed.
Package ImageMagick-devel - 6.2.8.0-4.el5_1.1.i386 is already installed.
Package libjpeg - 6b-37.i386 is already installed.
Package libjpeg-devel - 6b-37.i386 is already installed.
Package libjpeg-devel - 6b-37.i386 is already installed.
Package libpng-devel - 2:1.2.10-7.1.el5_0.1.i386 is already installed.
Package libpng - 2:1.2.10-7.1.el5_0.1.i386 is already installed.
Package libpng-devel - 2:1.2.10-7.1.el5_0.1.i386 is already installed.
Package libstdc++ - 4.1.2-42.el5.i386 is already installed.
Package libstdc++-devel - 4.1.2-42.el5.i386 is already installed.
Package libstdc++-devel - 4.1.2-42.el5.i386 is already installed.
Package libtiff - 3.8.2-7.el5_2.2.i386 is already installed.
Package libtiff-devel - 3.8.2-7.el5_2.2.i386 is already installed.
Package libtiff-devel - 3.8.2-7.el5_2.2.i386 is already installed.
Package libtool-ltdl-devel - 1.5.22-6.1.i386 is already installed.
Package libtool-ltdl - 1.5.22-6.1.i386 is already installed.
Package libtool - 1.5.22-6.1.i386 is already installed.
... 이하 생략 ...

  * 필자는 이미지 관련 rpm을 설치하여 already installed 라고 뜨고 있다.
  * 각종 설치 소스는 /usr/src/ffmpegscript 위치에 저장된다.

9. 설치 완료 후 post.sh 내용 출력

설치가 정상적으로 진행되었다면 다음과 같이 post.sh이 실행된다.

Post installation Procedures  ....... started
 ----------------------------------ffmpeg-php info--------------------------
ffmpeg
ffmpeg support (ffmpeg-php) => enabled
ffmpeg-php version => 0.5.3.1
ffmpeg-php gd support  => enabled
ffmpeg.allow_persistent => 0 => 0
ffmpeg.show_warnings => 0 => 0           ==> ffmpeg-php 모듈이 정상적으로 설치됨.

PWD => /설치스크립트경로/ffmpeginstall.3.2.1
_SERVER["PWD"] => /설치스크립트경로/ffmpeginstall.3.2.1
_ENV["PWD"] => /설치스크립트경로/ffmpeginstall.3.2.1
 Post installation Procedures ....... Completed
 
                                Don't forget to do the following

                1. Reboot webserver
                2. Test the installation ( See http://www.sherin.in/forum/topic.php?id=46 )
                3. If you support this, Make a donation in http://www.sherin.in/ffmpeg/  :-D
                4. Write your success stories and testimonials here http://www.sherin.in/forum/forum.php?id=23

10. 아파치를 재시작한다.

# /etc/init.d/apachectl restart

11. phpinfo 정보가 다음과 같이 출력되면 ffmpeg-php 모듈이 설치된 것이다.

사용자 삽입 이미지

12. 테스트용 동영상 다운로드

NVIDIA에서 제공하는 NZONE에서 테스트용 동영상을 다운로드받는다.


wget http://download.nvidia.com/downloads/nZone/videos/nzm_GTAIVPC.wmv
--18:09:20--  http://download.nvidia.com/downloads/nZone/videos/nzm_GTAIVPC.wmv
Resolving download.nvidia.com... 69.22.137.54, 69.22.137.59
Connecting to download.nvidia.com|69.22.137.54|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://http.download.nvidia.com/downloads/nZone/videos/nzm_GTAIVPC.wmv [following]
--18:09:21--  http://http.download.nvidia.com/downloads/nZone/videos/nzm_GTAIVPC.wmv
Resolving http.download.nvidia.com... 220.90.198.35, 220.90.198.120
Connecting to http.download.nvidia.com|220.90.198.35|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 53201018 (51M) [video/x-ms-wmv]
Saving to: `nzm_GTAIVPC.wmv'
100%[==============================================================>] 53,201,018  31.6M/s   in 1.6s
18:09:23 (31.6 MB/s) - `nzm_GTAIVPC.wmv' saved [53201018/53201018]

13. 변환 테스트

ffmepg 으로 위에서 다운로드 받은 wmv 파일을 flv 형식으로 변환한다.
(상세한 옵션은 ffmpeg 를 참조한다.)

ffmpeg -i nzm_GTAIVPC.wmv -ar 22050 -ab 32 -f flv -s 320x240 nzm_GTAIVPC.flv | flvtool2 -U stdin GTAIVPC.flv

* ffmpeg Options
-i filename         input file name
-ar rate            set audio sampling rate (in Hz)
-ab                <int>   E..A. set bitrate (in bits/s)
   psnr                    E.V.. error[?] variables will be set during encoding
   alt                     E.V.. enable alternate scantable (mpeg2/mpeg4)
-f fmt              force format
-s size             set frame size (WxH or abbreviation)

* flvtool2 Options
 -U            Updates FLV with an onMetaTag event

* 컨버팅 진행
FFmpeg version SVN-r14473, Copyright (c) 2000-2008 Fabrice Bellard, et al.
  configuration: --prefix=/usr/local/cpffmpeg --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-liba52 --enable-libamr-nb --enable-libamr-wb --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=-I/usr/local/cpffmpeg/include/ --extra-ldflags=-L/usr/local/cpffmpeg/lib --enable-cross-compile
  libavutil version: 49.7.0
  libavcodec version: 51.62.0
  libavformat version: 52.18.0
  libavdevice version: 52.0.0
  built on Feb  2 2009 18:06:26, gcc: 4.1.2 20071124 (Red Hat 4.1.2-42)
[wmv3 @ 0x897ab90]Extra data: 8 bits left, value: 0
Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 29.97 (30000/1001)
Input #0, asf, from 'tombraider_biketrailer.wmv':
  Duration: 00:01:20.99, start: 4.000000, bitrate: 3310 kb/s
    Stream #0.0: Audio: wmav2, 48000 Hz, stereo, 192 kb/s
    Stream #0.1: Video: wmv3, yuv420p, 1280x720, 3072 kb/s, 29.97 tb(r)
WARNING: The bitrate parameter is set too low. It takes bits/s as argument, not kbits/s
Output #0, flv, to 'nzm_GTAIVPC.flv':
    Stream #0.0: Video: flv, yuv420p, 320x240, q=2-31, 200 kb/s, 29.97 tb(c)
    Stream #0.1: Audio: libmp3lame, 22050 Hz, stereo, 0 kb/s
Stream mapping:
  Stream #0.1 -> #0.0
  Stream #0.0 -> #0.1
[wmv3 @ 0x897ab90]Extra data: 8 bits left, value: 0
Press [q] to stop encoding
frame=  847 fps= 54 q=15.8 size=    1066kB time=24.66 bitrate= 354.2kbits/s

정상적으로 컨버팅이 마쳐졌으면 flv 파일이 생성되었을 것이다.

14. flv 플레이어 다운로드

웹상에서 flv 파일을 플레이어 해주는 프로그램으로 JW Players 가 있다.
다음 주소에서 파일을 다운로드 받아 압축을 풀도록 한다.


* 홈페이지 : http://www.longtailvideo.com/players/jw-flv-player/

압축을 풀어 readme.html 살펴보면 다음과 같은 코드문이 있다. 별도의 html 문서로 저장하도록 한다.
여기서 수정해서 써야 하는 부분은 7번째줄
file={생성한 FLV 파일이름}&image={PREVIEW로 보여줄 IMAGE 파일이름} 이며, 4번째줄 ply 다음 328 200 은 각각 플레이어의 가로와 세로 사이즈이다.

    <div id="container"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">
        var s1 = new SWFObject("player.swf","ply","328","200","9","#FFFFFF");
        s1.addParam("allowfullscreen","true");
        s1.addParam("allowscriptaccess","always");
        s1.addParam("flashvars","file=sample.flv&image=preview.jpg");
        s1.write("container");
    </script>


15. 샘플 플레이어 주소

크리에이티브 커먼즈 라이센스
Creative Commons License

 

2009/02/03 18:48 2009/02/03 18:48








마음튼튼 이 작성.
TAGS ,

당신의 의견을 작성해 주세요.

[로그인][오픈아이디란?]
오픈아이디로만 댓글을 남길 수 있습니다