「Clipbucket」のインストールを行います。
「Clipbucket」のコンテンツは「Apache」のDocumentRootディレクトリ(/var/www/html)直下に保存することとします。
(1)「Clipbucket」をダウンロードする。
http://www.kurobuti.com/linux_server/?page_id=606
(2)「Clipbucket」をサーバへアップロードする。
(3)「rpmforge」リポジトリをインストールする。
[root@example ~]# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm [root@example ~]# rpm -ivh rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm 警告: rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm: ヘッダ V3 DSA signature: NOKEY, key ID 6b8d79e6 準備中... ########################################### [100%] 1:rpmforge-release ########################################### [100%] [root@clipbucket ~]# vi /etc/yum.repos.d/rpmforge.repo enabled = 1 ↓ # 変更 enabled = 0
※rpmforgeの最新版は下記アドレスを参照してくください。
http://repoforge.org/use/
※ここでは、64bitの「rpmforge」リポジトリをインストールしています。32bitの場合は32bit用の「rpmforge」リポジトリをインストールしてください。
(4)「Clipbucket」に必要なパッケージをインストールする。
[root@example ~]# yum -y install httpd.x86_64 httpd-devel.x86_64 libX11-devel.x86_64 libXt-devel.x86_64 mysql.x86_64 mysql-server.x86_64 ruby.x86_64 zlib-devel.x86_64 libogg.x86_64 libogg-devel.x86_64 freetype.x86_64 freetype-devel.x86_64 SDL.x86_64 SDL-devel.x86_64 freeglut.x86_64 freeglut-devel.x86_64 libxml2-devel.x86_64 libpng-devel.x86_64 mysql-devel.x86_64 curl.x86_64 curl-devel.x86_64 [root@example ~]# yum -y install --enablerepo=rpmforge a52dec-devel.x86_64 faac-devel.x86_64 yasm.x86_64 git.x86_64 flvtool2 x264.x86_64 lame.x86_64 xvidcore.x86_64 x264-devel.x86_64 lame-devel.x86_64 xvidcore-devel.x86_64
(5)「php-5.2.17」をインストールする。
[root@example ~]# wget http://jp.php.net/get/php-5.2.17.tar.bz2/from/this/mirror [root@example ~]# tar jxvf php-5.2.17.tar.bz2 [root@example ~]# cd php-5.2.17 [root@example php-5.2.17]# ./configure --prefix=/usr --bindir=/usr/bin --libdir=/usr/lib64 --mandir=/usr/share/man --oldincludedir=/usr/include --sysconfdir=/etc --with-config-file-path=/etc --with-libdir=lib64 --with-apxs2=/usr/sbin/apxs --enable-mbstring --with-mysql --with-pdo-mysql --with-gd --with-zlib --with-curl --with-curlwrappers [root@example php-5.2.17]# make [root@example php-5.2.17]# make test Do you want to send this report now? [Yns]: n ←「n」を入力 [root@example php-5.2.17]# make install [root@example php-5.2.17]# cp php.ini-recommended /etc/php.ini
※phpのダウンロード先
http://php.net/downloads.php
注)ClipBucketがサポートしているphpは「5.2.x」です。「5.3.x」以上では動作しません。
(6)「Apache」の設定をする。
[root@example ~]# vi /etc/httpd/conf/httpd.conf LoadModule php5_module /usr/lib64/httpd/modules/libphp5.so AddType application/x-httpd-php .php .phtml ← 追加 #ServerName www.example.com:80 ↓ 変更 ServerName www.kurobuti.com:80 DirectoryIndex index.html index.html.var ↓ 変更 DirectoryIndex index.html index.html.var index.php <Directory "/var/www/html"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # Options FollowSymLinks ← # 変更 # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All ← # 変更 # # Controls who can get stuff from this server. # Order allow,deny Allow from all </DIRECTORY>
(7)「php」の設定を行う。
[root@example ~]# vi /etc/php.ini post_max_size = 8M ↓ # 変更 post_max_size = 100M upload_max_filesize = 2M ↓ # 変更 upload_max_filesize = 100M short_open_tag = Off ↓ # 変更 short_open_tag = On
(8)「MySQL」の設定をする。
[root@example ~]# vi /etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=1 default-character-set = utf8 ← # 追加 # Disabling symbolic-links is recommended to prevent assorted security risks; # to do so, uncomment this line: # symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid default-character-set = utf8 ← # 追加 [mysql] ← # 追加 default-character-set = utf8 ← # 追加
(9)「libvorbis」をインストールする。
[root@example ~]# wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.2.tar.bz2 [root@example ~]# tar jxvf libvorbis-1.3.2.tar.bz2 [root@example ~]# cd libvorbis-1.3.2 [root@example libvorbis-1.3.2]# ./configure --prefix=/usr --libdir=/usr/lib64 --oldincludedir=/usr/include --datarootdir=/usr/share [root@example libvorbis-1.3.2]# make [root@example libvorbis-1.3.2]# make install
(10)「libtheora」をインストールする。
[root@example ~]# wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2 [root@example ~]# tar jxvf libtheora-1.1.1.tar.bz2 [root@example ~]# cd libtheora-1.1.1 [root@example libtheora-1.1.1]# ./configure --prefix=/usr --libdir=/usr/lib64 --oldincludedir=/usr/include --datarootdir=/usr/share [root@example libtheora-1.1.1]# make [root@example libtheora-1.1.1]# make install [root@example libtheora-1.1.1]# make check
(11)「ffmpeg」をインストールする。
[root@example ~]# wget http://ffmpeg.org/releases/ffmpeg-0.6.3.tar.bz2 [root@example ~]# cd ffmpeg/ [root@example ~]# tar jxvf ffmpeg-0.6.3.tar.bz2 [root@example ffmpeg-0.6.3]# ./configure --prefix=/usr --bindir=/usr/bin --libdir=/usr/lib64 --incdir=/usr/include --datadir=/usr/share --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-libfaac --enable-pthreads --enable-gpl --enable-nonfree --enable-shared --enable-libtheora --enable-libvorbis [root@example ffmpeg-0.6.3]# make [root@example ffmpeg-0.6.3]# make install
※ffmpegのダウンロー先
http://ffmpeg.org/download.html
注)最新版のffmpegはサポートされていません。
(12)「MP4Box」をインストールする。
[root@example ~]# wget http://sourceforge.net/projects/gpac/files/GPAC/GPAC%200.4.5/gpac-0.4.5.tar.gz/download [root@example ~]# tar zxvf gpac-0.4.5.tar.gz [root@example ~]# cd gpac [root@example gpac]# chmod 544 configure [root@example gpac]# ./configure --prefix=/usr --mandir=/usr/share/man --disable-wx [root@example gpac]# make lib [root@example gpac]# make apps [root@example gpac]# make install
(13)「Apache」と「MySQL」を起動する。
[root@example ~]# /etc/rc.d/init.d/httpd start [root@example ~]# /etc/rc.d/init.d/mysqld start [root@example ~]# chkconfig httpd on [root@example ~]# chkconfig mysqld on
(14)「Clipbucket」で使用するデータベースとユーザーを作成する。
[root@example ~]# mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.0.91 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> grant all privileges on clipbucket.* to clipbucketuser@localhost identified by '12345678'; Query OK, 0 rows affected (0.00 sec) mysql> create database clipbucket; Query OK, 1 row affected (0.00 sec) mysql> quit Bye
上記で作成した「データベース名」「ユーザ名」「パスワード」は以下の通りになっています。
■データベース名:「clipbucket」
■データベースユーザ名:「clipbucketuser」
■パスワード:「12345678」
(15)「Clipbucket」を解凍し、「Clipbucket」コンテンツを「Apache」のDocumentRootディレクトリ(/var/www/html)へ移動、パーミッションの変更を行う。
[root@example ~]# unzip Clip2.zip [root@example ~]# mv upload/* /var/www/html/ [root@example ~]# mv upload/.htaccess /var/www/html/ [root@example ~]# chown -R apache:apache /var/www/html/* [root@example ~]# cd /var/www/html/ [root@example html]# chmod -R 777 files/ [root@example html]# chmod -R 777 images/ [root@example html]# chmod -R 777 cache/ [root@example html]# chmod -R 777 includes/
(16)ブラウザで「http://IP or FQDN/」にアクセスする。

【OK,I Agree, Now let me Continue!】をクリックする。

【PHPShield】以外で問題が無ければ【Continue To Next Step】をクリックする。

各ディレクトリのパーミッションに問題が無ければ【Continue To Next Step】をクリックする。

【Host】、【Database Name】、【Database User】、【Database Password】を入力して【Check Connection】をクリックする。

【Admin username】、【Admin Password】、【Admin Email】を入力して【Save and Continue】をクリックする。

【Website title】、【Website Slogan】、【Website URL】を入力して【Save and Continue】をクリックする。

【Register & Finish】をクリックする。
最後に【cb_install】ディレクトリを削除する。
[root@example html]# rm -rf cb_install/
(17)ブラウザで「http://IP or FQDN/admin_area/login.php」にアクセスする。
【Username】、【Password】を入力してログインする。

【Website Configurations】 => 【Uploading and Conversion Settings】をクリックし、赤く囲った部分のパスを設定後、下の方にある【Update Settings】をクリックする。

【Server Module Info】をクリックして「Status」に問題ない事を確認する。
※ffmpegとlibvorbisは△になっているが問題ない。
(18)「Clipbucket」にパッチを当てる。
[root@example ~]# cd /var/www/html/includes/classes/conversion/ [root@example conversion]# wget http://www.kurobuti.com/download/clipbucket/2.5/clipbucket2.5.patch [root@example conversion]# patch -p1 < clipbucket2.5.patch patching file ffmpeg.class.php [root@example conversion]# rm clipbucket2.5.patch
このパッチは「x264」でエンコードするときに必要なオプションの追加+「vpre」で指定するオプションの変更をするものです。
http://www.kurobuti.com/blog/?p=2308
(19)「cron」に以下の内容を追加する。
[root@example ~]# crontab -e * * * * * php -q /var/www/html/actions/video_convert.php * * * * * php -q /var/www/html/actions/verify_converted_videos.php 0 0,12,13 * * * php -q /var/www/html/actions/update_cb_stats.php