「phpmotion」のインストールを行います。
ここでは、必要なソフトやコーデックはyumを使用してインストールを行います。
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%]
※上記手順でインストールできない場合は、下記URLで確認してください。
http://dag.wieers.com/rpm/FAQ.php#B
※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++ flvtool2 ffmpeg ffmpeg-devel mplayer mencoder xvidcore
(5)「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
(6)「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
(7)「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
(8)「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 ← # 追加
(9)「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』
(10)「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/"
(11)「Apache」を起動する。
[root@phpmotion ~]# /etc/rc.d/init.d/httpd start [root@phpmotion ~]# chkconfig httpd on
(12)ブラウザで「http://IP or FQDN/setup/」にアクセスする。

【Continue】をクリックする。

全てに確認のチェックがあれば【Continue】をクリックする。
もし、【×】がある場合は、必要なものをインストールする。

「phpmotion」コンテンツのパーミッションチェックが行われて、全てに確認のチェックがあれば【Continue】をクリックする。

先ほど作成した【データベース名】【データベースユーザ名】【パスワード】と【データベースのホスト名】を入力して【Continue】をクリックする。

赤枠部分を入力、確認をして【Continue】をクリックする。

【Login to Siteadmin】をクリックする前に「phpmotion」の「setup」ディレクトリを削除する。
[root@phpmotion ~]# cd /var/www/html/ [root@phpmotion html]# rm -rf setup/
「setup」ディレクトリ削除後に【Login to Siteadmin】をクリックします。
以上で「phpmotion」のインストールは完了です。