2010年5月11日 星期二

CentOS6.0安裝 Gallery2 相關資料

Gallery2.31 相簿安裝 影音轉換
PHP 5.3 on CentOS 5 Webtatic.com

RPM Search RedHat EL 5 php-eaccelerator-0.9.6.1-2.el5.remi.x86_64.rpm

兩個我常用的 CentOS Yum Repo
一. remiepel升級倉庫---> PHP MYSQL 等
 rpm -Uvh http://mirror01.idc.hinet.net/EPEL/5/x86_64/epel-release-5-4.noarch.rpm
 rpm -Uvh http://rpms.famillecollet.com/enterprise/5/remi/x86_64/remi-release-5-8.el5.remi.noarch.rpm
導入認證KEY
rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi移除 mysql i386
/etc/init.d/mysqld stop 
yum erase mysql.i386

安裝升級php 與 mysql
yum --enablerepo=remi check-update
yum --enablerepo=remi upgrade php mysql mysql-server php-mysql php-devel php-gd php-mcrypt php-mstring

 /etc/init.d/mysqld start
設定密碼:mysqladmin -u root password '密碼'

如 mysql ,升級或安裝時,套件清單 都會出現相同名稱的兩套套件,差別只在 i386 與 x86_64 的差異,
若不管,直接輸入 y 安裝之後,一旦要啟動 mysql ,系統就會警告說有兩套 mysql 在系統中,無法啟動!這問題我在安裝 perl 的時候就發生過,結果 perl 就無法執行!

也許可以 rpm -qa grep mysql 確認一下系統上還有哪些 mysql 套件,是否不只是因為有同一版本的 i386 與 x64
或用 yum list mysql* 確認一下有哪些 mysql 套件

只需要在 yum.conf 加上一行過濾掉 i386, i686 的軟件包就可以了:

# vi /etc/yum.conf
[main]
...
exclude=*.i386 *.i686


二. rpmforge 升級倉庫 (另一個類似atrpms repository)---影音類如果是選擇以RPM先連上軟件倉庫最容易更新相關影音轉碼套件 ,CentOS 5.4默認的Repository裡找不到這些yum包,先安裝rpmforge這個Repository。很全很強大,近10000個軟件包

#32位:wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
rpm -ivh rpmforge-release-0.5.2-2.el5.rf.i386.rpm
#64位:wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
#rpm -Uvh rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
導入認證KEY
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
(若為CentOS6.xx 則 
   32位: http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm

    x86_64 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
)

#yum --enablerepo=rpmforge check-update
修改 vi /etc/yum.repos.d/rpmforge.repo
enabled = 1 ==> enabled = 0
然後參照 Install ffmpeg, flvtool2, mplayer, mencoder and ffmpeg-php in Cpanel/CentOS安裝 Gallery2 電子相簿系統

需額外下載 Transcode Module 放到gallery2 module 目錄

以下方式一次安裝(除了ffmapeg 比較麻煩)
yum install --enablerepo=rpmforge ImageMagick netpbm netpbm-progs jhead ffmpeg ffmpeg-devel flvtool2 mplayer mencoder lame libogg libvorbis libtheora swftools amrnb amrwb transcode x264
How To Install FFmpeg, Mplayer, Mencoder, FFmpeg-PHP on CentOS 5.x Sohail Riaz, Linux and Open Source Blog

參考下列方式可以自行安裝較新套件奇想空 先教Server學轉片吧
Install ffmpeg, flvtool2, mplayer, mencoder and ffmpeg-php in Cpanel/CentOS L i j e e s h . I N
1. Open the file “/ffmpeg-php-0.6.0/ffmpeg_frame.c”
2. Replace all PIX_FMT_RGBA32 with PIX_FMT_RGB32 (vi:n1,n2s/PIX_FMT_RGBA32/PIX_FMT_RGB32)/g

Install ffmpeg ffmpeg-php and Audio Binaries on CentOS / RHEL System with Cpanel

(1)LAME (Lame Aint an MP3 Encoder)
(2)ffmpeg
ffmpeg-php extension ffmpeg-php

(3)FLVTool2

ImageMagick: Install from Binary Distribution

http://registerboy.pixnet.net/blog/post/24896148


Installing or Upgrading PHP 5.3.2
cd /root
rpm -ivh http://repo.webtatic.com/yum/centos/5/`uname -i`/webtatic-release-5-0.noarch.rpm
yum --enablerepo=webtatic install php
yum --enablerepo=webtatic install php-devel

yum-allowdowngrade 可以降级的插件:
allow downgrade for yum:
yum install yum-allowdowngrade
Add a line to yum.conf:
showdupesfromrepos=1
After that list all php packages:
yum list php
If php 5.2.8 is available, remove new one:
yum remove php
and install an old one:
yum --allow-downgrade install php-5.2.8


相關套件說明可參考這邊Install ffmpeg ffmpeg-php and Audio Binaries on CentOS / RHEL System with Cpanel


在php.ini裡有一些跟上傳檔案時有關的數值,

◦upload_max_filesize:
這是上傳單一檔案的大小限制,譬如我若允許上傳超過20MB的影片檔,那這數值就必須至少大於「20M」才可以。
◦post_max_size:
PHP允許一次上傳檔案的大小限制,譬如Gallery2要上傳檔案時,可以一次多個檔案上傳,若我一次要上傳2個15MB的影片檔,那麼這個數值就必須至少大於「30M」了。

這個 post_max_size 必須大於 upload_max_filesize
◦memory_limit:
執行每個scripts時使用的memory大小限制

這個 memory_limit 必須大於 post_max_size
這三個數值的大小,必須是 memory_limit > post_max_size > upload_max_filesize


布丁布丁吃什麼?: VNCserver初始設定與自動啟動



MYSQL
先將mysql的服務啟動
#chkconfig mysqld on
#service mysqld start


以下範例為將預設的空密碼改為"my1234"
#mysqladmin -u root password my1234
如果你是要將舊密碼改為"my1234"
#mysqladmin -u root -p password my1234
Enter password: <==這裡請輸入舊的密碼


phpMyAdmin
先到phpmyadmin的目錄裡面
#cd /var/www/html/phpMyAdmin
產生config.inc.php設定檔
預設是沒有這個檔案的,要先將config.sample.inc.php複製成config.inc.php
#cp ./config.sample.inc.php ./config.inc.php
將認證方式改為http或是cookie還有修改hostname



為方便MySQLDB操作(或許以經習慣使用phpMyAdmin來設定DB).

安裝時會有一些要處理的事項, 在此記錄.

PS: 此文大多搜集網路



1. phpMyAdmin網頁下載最新版本.

2. /etc/httpd/conf.d/, 新增phpmyadmin.conf

Alias /phpMyAdmin /var/www/phpMyAdmin

Order deny, allow

Deny From ALL

Allow From 192.168.0.



開啟 myphpadmin下的config.sample.inc.php

3.將 $cfg['Servers'][$i]['auth_type'] = 'cookie'; cookie改為 http,另存為 config.inc.php

4.重新啟動apache

service httpd restart




----------------------------------------------------------------------

I. 問題1

http://xxx/phpMyAdmin頁面出現

[code]

php 5.2+ is required

[/code]

因為php版本低於5.2

[code]

php -v

[/code]

@解決方式:

a. 安裝epel remi

(remi需要epel; 故先安裝epel, 再安裝remi)

[code]

wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

wget http://rpms.famillecollet.com/el5.i386/remi-release-5-8.el5.remi.noarch.rpm

[/code]

epel-release-5-4.noarch.rpmremi-release-5-8.el5.remi.noarch.rpm下載時可以查尋是否有最新版本

b. rpm安裝

[code]

rpm -Uvh epel-release-5-4.noarch.rpm

rpm -Uvh remi-release-5-8.el5.remi.noarch.rpm

[/code]

c. 指定remi套件, update phpmysql

[code]

yum --enablerepo=remi update php mysql

[/code]

重新啟動php, mysql

[code]

service httpd restart

service mysqld restart

[/code]



----------------------------------------------------------------------

II. 問題2

進入phpMyAdmin, 出現

未安裝mcypt, mstring

設定檔案現在需要密碼 (passphrase) (blowfish_secret).

@解決方式

a. mcryptmstring

[code]

yum --enablerepo=remi install php-mcrypt php-mstring



(若以下方式, 可能無法安裝)

yum install php-mcrypt

yum install php-mstring

[/code]

b. 設定檔案現在需要密碼

/var/www/phpMyAdmin/config.inc.php (可修改config.sample.inc.php)

修改

[code]

$cfg['blowfish_secret'] = '輸入一亂碼, cookie認證'

[/code]

重新啟動apache

[code]

service httpd restart

[/code]


沒有留言: