「phpmotion」のインストールを行います。
ここでは、必要なソフトやコーデックはyumとソースからインストールを行います。
「phpmotion」のコンテンツはApacheのデフォルトルートディレクトリ(/var/www/html)直下に保存することにします。
(1)「phpmotion」をダウンロードする。
http://www.kurobuti.com/linux_server/?page_id=546
(2)ダウンロードした「phpmotion」をサーバへアップロードする。
(3)「rpmforge」リポジトリを追加する。
[root@phpmotion ~]# rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm を取得中 準備中... ########################################### [100%] 1:rpmforge-release ########################################### [100%] [root@phpmotion ~]# vi /etc/yum.repos.d/rpmforge.repo enabled = 1 ↓ # 変更 enabled = 0
※64bit版の場合は、「http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm」を使用してください。
(4)「phpmotion」に必要なパッケージをインストールする。
[root@phpmotion ~]# yum -y install httpd ruby php php-devel php-cli php-gd php-mbstring php-mysql mysql-server automake libtool gcc gcc-c++
(5)「Apache」の設定をする。
[root@phpmotion ~]# vi /etc/httpd/conf/httpd.conf #ServerName www.example.com:80 ↓ # 変更 ServerName www.kurobuti.com:80 <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 Indexes FollowSymLinks ExecCGI ← # 追加 # # 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> #AddHandler cgi-script .cgi ↓ # 変更 AddHandler cgi-script .cgi .pm .pl ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" ↓ # 変更 #ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
(6)「MySQL」の設定をする。
[root@phpmotion ~]# 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 # Disabling symbolic-links is recommended to prevent assorted security risks; # to do so, uncomment this line: # symbolic-links=0 default-character-set = utf8 ← # 追加 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid [mysql] ← # 追加 default-character-set = utf8 ← # 追加
(7)「flvtool」をインストールする。
[root@phpmotion ~]# wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz [root@phpmotion ~]# tar zxvf flvtool2-1.0.6.tgz [root@phpmotion ~]# cd flvtool2-1.0.6 [root@phpmotion flvtool2-1.0.6]# ruby setup.rb config [root@phpmotion flvtool2-1.0.6]# ruby setup.rb setup [root@phpmotion flvtool2-1.0.6]# ruby setup.rb install [root@phpmotion flvtool2-1.0.6]# cd ../ [root@phpmotion flvtool2-1.0.6]# rm -rf flvtool2-1.0.6 flvtool2-1.0.6.tgz
(8)「git」「yasm」「a52-dec-devel」「faac-devel」をインストールする。
[root@phpmotion ~]# yum -y --enablerepo=rpmforge install yasm git a52dec-devel faac-devel
(9)「x264」をインストールする。
[root@phpmotion ~]# git clone git://git.videolan.org/x264.git [root@phpmotion ~]# cd x264/ [root@phpmotion x264]# ./configure --enable-shared [root@phpmotion x264]# make && make install [root@phpmotion x264]# cd .. [root@phpmotion ~]# rm -rf x264/
(10)「lame」をインストールする。
[root@phpmotion ~]# wget http://sourceforge.net/projects/lame/files/lame/3.98.4/lame-3.98. 4.tar.gz/download [root@phpmotion ~]# tar zvxf lame-3.98.4.tar.gz [root@phpmotion ~]# cd lame-3.98.4 [root@phpmotion lame-3.98.4]# ./configure [root@phpmotion lame-3.98.4]# make && make install [root@phpmotion lame-3.98.4]# cd ../ [root@phpmotion ~]# rm -rf lame-3.98.4 lame-3.98.4.tar.gz
(11)「xvid」をインストールする。
[root@phpmotion ~]# wget http://downloads.xvid.org/downloads/xvidcore-1.2.2.tar.gz [root@phpmotion ~]# tar zxvf xvidcore-1.2.2.tar.gz [root@phpmotion ~]# cd xvidcore/build/generic/ [root@phpmotion generic]# ./configure [root@phpmotion generic]# make && make install [root@phpmotion generic]# cd ../../../ [root@phpmotion ~]# rm -rf xvidcore xvidcore-1.2.2.tar.gz
(12)「libogg」をインストールする。
[root@phpmotion ~]# wget http://downloads.xiph.org/releases/ogg/libogg-1.2.0.tar.gz [root@phpmotion ~]# tar zxvf libogg-1.2.0.tar.gz [root@phpmotion ~]# cd libogg-1.2.0 [root@phpmotion libogg-1.2.0]# ./configure [root@phpmotion libogg-1.2.0]# make && make install [root@phpmotion libogg-1.2.0]# cd ../ [root@phpmotion libogg-1.2.0]# rm -rf libogg-1.2.0 libogg-1.2.0.tar.gz
(13)「mplayer」をインストールする。
[root@phpmotion ~]# svn co svn://svn.mplayerhq.hu/mplayer/trunk mplayer [root@phpmotion ~]# cd mplayer/ [root@phpmotion mplayer]# ./configure [root@phpmotion mplayer]# make && make install [root@phpmotion mplayer]# cd .. [root@phpmotion ~]# rm -rf mplayer/
(14)「ffmpeg」をインストールする。
[root@phpmotion ~]# svn co svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg [root@phpmotion ~]# cd ffmpeg/ [root@phpmotion ffmpeg]# ./configure --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-libfaac --enable-pthreads --enable-gpl --enable-nonfree --enable-shared [root@phpmotion ffmpeg]# make && make install [root@phpmotion ffmpeg]# cd ../ [root@phpmotion ~]# rm -rf ffmpeg/ [root@phpmotion ~]# cd /etc/ld.so.conf.d [root@phpmotion ~]# vi ffmpeg-lib-path.conf # 以下を追加 /usr/local/lib [root@phpmotion ld.so.conf.d]# ldconfig
(15)「ffmpeg-php」をインストールする。
[root@phpmotion ~]# wget http://jaist.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php -0.6.2.tbz2 [root@phpmotion ~]# tar jxvf ffmpeg-php-0.6.2.tbz2 [root@phpmotion ~]# cd ffmpeg-php-0.6.2 [root@phpmotion ffmpeg-php-0.6.2]# phpize [root@phpmotion ffmpeg-php-0.6.2]# ./configure [root@phpmotion ffmpeg-php-0.6.2]# make && make install [root@phpmotion ffmpeg-php-0.6.2]# echo "extension=ffmpeg.so" >> /etc/php.ini [root@phpmotion ffmpeg-php-0.6.2]# cd ../ [root@phpmotion ~]# rm -rf ffmpeg-php-0.6.2 ffmpeg-php-0.6.2.tbz2
(16)「phpmotion」を解凍し、「phpmotion」のコンテンツを「Apache」のDocumentRootディレクトリ(/var/www/html)へ移動する。
[root@phpmotion ~]# unzip phpmotion.zip [root@phpmotion ~]# mv phpmotion/* /var/www/html/ [root@phpmotion ~]# mv phpmotion/.htaccess /var/www/html/
(17)「phpmotion」コンテンツのパーミッションを変更する。
[root@phpmotion ~]# cd /var/www/html/ [root@phpmotion html]# chown -R apache:apache * [root@phpmotion html]# chown apache:apache .htaccess [root@phpmotion html]# chmod 777 addons/ [root@phpmotion html]# chmod 777 addons/customprofile/ [root@phpmotion html]# chmod 777 addons/customprofile/member_css/ [root@phpmotion html]# chmod 777 addons/customprofile/member_images/ [root@phpmotion html]# chmod 777 addons/albums/ [root@phpmotion html]# chmod 777 addons/albums/images/ [root@phpmotion html]# chmod 777 addons/albums/thumbs/ [root@phpmotion html]# chmod 777 classes/ [root@phpmotion html]# chmod 777 logs/ [root@phpmotion html]# chmod 777 pictures/ [root@phpmotion html]# chmod 777 temp/ [root@phpmotion html]# chmod 777 uploads/ [root@phpmotion html]# chmod 777 uploads/avi/ [root@phpmotion html]# chmod 777 uploads/thumbs/ [root@phpmotion html]# chmod 777 uploads/audio/ [root@phpmotion html]# chmod 777 uploads/player_thumbs/ [root@phpmotion html]# chmod 777 setup/ [root@phpmotion html]# chmod 755 cgi-bin/* [root@phpmotion html]# chmod 755 cgi-bin/audio/uu_default_config.pm [root@phpmotion html]# chmod 755 cgi-bin/audio/uu_ini_status.pl [root@phpmotion html]# chmod 755 cgi-bin/audio/uu_lib.pm [root@phpmotion html]# chmod 755 cgi-bin/audio/uu_upload.pl
(18)「phpmotion」で使用するデータベースとユーザーを作成する。
[root@phpmotion ~]# /etc/rc.d/init.d/mysqld start [root@phpmotion ~]# chkconfig myqld on [root@phpmotion ~]# mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.0.77 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> grant all privileges on phpmotionup.* to phpmotionuser@localhost identified by '12345678'; Query OK, 0 rows affected (0.00 sec) mysql> create database phpmotionup; Query OK, 1 row affected (0.00 sec) mysql> quit Bye
上記で作成した「データベース名」「ユーザ名」「パスワード」は以下の通りになっています。
■データベース名:『phpmotionup』
■データベースユーザ名:『phpmotionuser』
■パスワード:『12345678』
(19)「Apache」を起動する。
[root@phpmotion ~]# /etc/rc.d/init.d/httpd start [root@phpmotion ~]# chkconfig httpd on
「phpmotion」の初期設定は、以下URLの(12)以降を参照のこと。
http://www.kurobuti.com/linux_server/?page_id=543