10/01/2560

ติดตั้ง ClipBucket (คล้าย Youtbube) บน CentOS 6 (ไม่สำเร็จ)

จากที่เห็นอาจารย์จากสถาบันแหน่งหนึ่ง แนะนำให้ทดสอบเว็บเก็บวิดีโอของมหาวิทยาลัย ซึ่งก็พบว่าสามารถใช้งานได้เป็นอย่างดี จึงอยากจะทดสอบติดตั้งเพื่อใช้งานครับ
ดูเบื้องต้นก็สวยงามใช้งาน อีกทั้งมีความสามารถอีกที่พร้อมสำหรับใช้งานเลยทีเดียว โปรแกรมชื่อ ClipBucket
ก่อนที่จะเริ่มให้ตรวจสอบความต้องการของระบบตามนี้นะครับ
ClipBucket Installation Requirements
เริ่มต้น หลังจากทำการติดตั้ง OS และระบบต่าง ๆ ของ เครื่องแล้ว จะทำตาม คู่มือนี้ครับ (คู่มือจากเว็บผูผลิต จะเป็นแค่การติดตั้งหลังจากนำเข้า Web Server แล้ว)


เริ่มต้น
เตรียมระบบที่เกี่ยวข้องสำหรับใช้งานสำหรับ Web Server
[root@server ~]# yum install mysql mysql-server httpd php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring wget unzip -y
ให้ทำการ Start Service MySQL และ Apache
[root@server ~]# /etc/init.d/mysqld start
[root@server ~]# /etc/init.d/httpd start
[root@server ~]# chkconfig mysqld on
[root@server ~]# chkconfig httpd on
เมื่อทำการ start service ดังกล่าวแล้ว จะสามารถเข้าหน้า website ของเครื่อง ได้แล้ว อาจทดสอบโดยใช้ Browser เข้าไปที่ ip ของเครื่อง ก็จะพบ Apache 2 Test Page powered by CentOS (ถ้าเข้าไม่ได้ ให้ลองตรวจสอบ Firewall หรือ SELINUX ที่เครื่อง Server)
สร้าง Mysql Root Password ด้วยคำสั่ง
(แล้วระบบจะให้กรอก password mysql เดิม ซึ่งไม่มี เลยต้อง Enter ผ่านไปก่อน
แล้วจะมีคำถามกด Y แล้วให้เรากรอก Password ที่เราต้องการ
แล้วถามว่าต้องการเอา User Anonymous ออกหรือไม่ ในที่นี้ผมเอาออก
แล้วจะมีคำถามว่า ต้องการลบฐานข้อมูลทดสอบออกหรือไม่ ในที่นี้ผมเก็บไว้
แล้วจะถามให้ reload สิทธิ์ของ User ใหม่อีกครั้ง ผมตอบ Y)
[root@server ~]# /usr/bin/mysql_secure_installation
สร้างฐานข้อมูลและผู้ใช้งานสำหรับ ClipBucket
(เมื่อใช้คำสั่งต่อไปนี้ จะต้องกรอก Password ที่ใส่ไปจากข้อที่แล้ว เมื่อใส่ได้ ระบบจะพร้อมอยู่ที่คำสั่ง mysql)
[root@server ~]# mysql -u root -p
คำสั่ง SQL ที่ต้องดำเนินการ
mysql> create database clipbucketdb;
Query OK, 1 row affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON clipbucketdb.* TO 'clipbucketadmin' IDENTIFIED BY 'centos';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
ต่อไปจะเป็นการติดตั้งเครื่องมือสำหรับให้ Web Server ไว้เพื่อใช้งานครับ
[root@server ~]# yum groupinstall "Development Tools"
[root@server ~]# yum install lame mencoder ffmpeg flvtool2 libogg libvorbis freetype-devel SDL-devel freeglut-devel zlib gpac -y
จากการ yum ล่าสุด พบว่า yum ไม่รู้จัก บางโปรแกรม เลยต้องตั้งค่าเองครับ
No package lame available.
No package mencoder available.
No package ffmpeg available.
No package flvtool2 available.
ติดตั้ง LAME
#yum install gcc gcc-c++ automake autoconf libtool yasm nasm git subversion -y
#wget http://jaist.dl.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
#tar -xvzf lame-3.99.5.tar.gz
#cd lame-3.99.5
#./configure
#make && make install
#ldconfig
ติดตั้ง mencoder (http://tecadmin.net/install-mencoder-and-mplayer-on-linux/)
# rpm --import http://packages.atrpms.net/RPM-GPG-KEY.atrpms
# vim /etc/yum.repos.d/atrpms.repo
เพิ่มข้อมูลนี้เข้าไป
[atrpms]
name=Fedora Core $releasever - $basearch - ATrpms
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
enabled=1
gpgcheck=1
# yum install mencoder
ตรวจสอบ
# mencoder -ovc help
MEncoder SVN-r37150-snapshot-4.4.6 (C) 2000-2014 MPlayer Team
Available codecs:
copy - frame copy, without re-encoding. Doesn't work with filters.
frameno - special audio-only file for 3-pass encoding, see DOCS.
raw - uncompressed video. Use fourcc option to set format explicitly.
nuv - nuppel video
lavc - libavcodec codecs - best quality!
libdv - DV encoding with libdv v0.9.5
xvid - XviD encoding
x264 - H.264 encoding
# mencoder -oac help
MEncoder SVN-r37150-snapshot-4.4.6 (C) 2000-2014 MPlayer Team
Available codecs:
copy - frame copy, without re-encoding (useful for AC3)
pcm - uncompressed PCM audio
mp3lame - cbr/abr/vbr MP3 using libmp3lame
lavc - FFmpeg audio encoder (MP2, AC3, ...)
twolame - Twolame MP2 audio encoder
faac - FAAC AAC audio encoder
ติดตั้ง ffmpeg (https://gist.github.com/mustafaturan/7053900)
เป็นการนำ Scrip install มา run บน เครื่องนะครับ (ใช้เวลานานหน่อย)
#wget https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh
#chmod +x latest-ffmpeg-centos6.sh
#./latest-ffmpeg-centos6.sh
ติดตั้ง Flvtool2
# yum install ruby -y
# wget https://codeload.github.com/unnu/flvtool2/zip/master
# unzip master
#cd flvtool2-master
#ruby setup.rb config
#ruby setup.rb setup
#ruby setup.rb install
ตั้งค่า php.ini
หาว่าไฟล์ อยู่ตรงไหนด้วยคำสั่ง
#php -i|grep php.ini
#vi /etc/php.ini
แล้วแก้ไขค่า ดังต่อไปนี้
upload_max_filesize = 500M
max_execution_time = 36000
max_input_time = 600
memory_limit = 5000M
magic_quotes_gpc = On
magic_quotes_runtime = Off
register_globals = Off
output_buffering = Off
display_errors = On
short_open_tag = On
date.timezone = Asia/Bangkok
ตรวจสอบภาพ Extension
#php -i|grep extension_dir
#cd /usr/lib64/php/modules
# wget http://www.phpshield.com/loaders/ixed4.lin.x86-32.zip
# unzip ixed4.lin.x86-32.zip
# echo "extension=ixed.5.3.lin" >> /etc/php.ini
เมื่อเสร็จกระบวนการตามนี้ให้ reboot 1 ครั้ง เพื่อบันทึกค่า
# reboot
Download ตัวติดตั้ง ClipBucket
# wget https://github.com/arslancb/clipbucket/archive/4476.zip
แตกไฟล์
# unzip 4476.zip
เข้าไปใน Folder
# cd clipbucket-4476
คัดลอก Folder Upload ไปไว้ที่เก็บเว็บไซต์
# cp -rf upload/* /var/www/html/
ตั้งค่าสิทธิ์ Folder ตามนี้ (ผมย่อเหลือแค่นี้ #chmod -R 777 includes/ files/ images/ includes/ cache/ cb_install/)
[root@server ~]# chmod -R 777 /var/www/html/includes/
[root@server ~]# chmod -R 777 /var/www/html/files/
[root@server ~]# chmod -R 777 /var/www/html/files/conversion_queue/
[root@server ~]# chmod -R 777 /var/www/html/files/logs/
[root@server ~]# chmod -R 777 /var/www/html/files/original/
[root@server ~]# chmod -R 777 /var/www/html/files/temp/
[root@server ~]# chmod -R 777 /var/www/html/files/thumbs/
[root@server ~]# chmod -R 777 /var/www/html/files/photos/
[root@server ~]# chmod -R 777 /var/www/html/files/videos/
[root@server ~]# chmod -R 777 /var/www/html/files/mass_uploads/
[root@server ~]# chmod -R 777 /var/www/html/files/temp/install.me
[root@server ~]# chmod -R 777 /var/www/html/images/
[root@server ~]# chmod -R 777 /var/www/html/images/avatars/
[root@server ~]# chmod -R 777 /var/www/html/images/backgrounds/
[root@server ~]# chmod -R 777 /var/www/html/images/collection_thumbs/
[root@server ~]# chmod -R 777 /var/www/html/images/groups_thumbs/
[root@server ~]# chmod -R 777 /var/www/html/includes/langs/en.lang
[root@server ~]# chmod -R 777 /var/www/html/cache/
[root@server ~]# chmod -R 777 /var/www/html/cache/comments/
[root@server ~]# chmod -R 777 /var/www/html/cache/userfeeds/
[root@server ~]# chmod -R 777 /var/www/html/cb_install/
เริ่มติดตั้ง
http://ip-address or domain-name/cb_install/
พบปัญหา หน้า License Agreement ไม่แสดง
ตรวจสอบเบื้องต้น พบกว่า php เป็นรุ่น 5.3 แต่ระบบต้องการ 5.4
# yum install nano wget gcc gcc-c++ make mysql mysql-server mysql-devel mysql-libs libxml2-devel openssl-devel bzip2-devel libcurl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel libxslt-devel
#wget http://th1.php.net/distributions/php-5.4.45.tar.gz
#tar xf php-5.4.0.tar.gz
#cd php-5.4.0
#./configure --with-openssl --with-zlib --enable-bcmath --with-bz2 --enable-calendar --with-curl --with-curlwrappers --enable-dba --enable-exif --enable-ftp --with-gd --enable-gd-native-ttf --enable-gd-jis-conv --enable-mbstring --with-mcrypt --with-mhash --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql=mysqlnd --enable-shmop --with-snmp --enable-soap --enable-sockets --with-regex --enable-wddx --with-xmlrpc --with-iconv --with-xsl --enable-zip --with-jpeg-dir=/usr/lib64 --with-freetype-dir=/usr/lib64 --libdir=/usr/lib64 --enable-fpm
(ติดตัวไหน ผมเอาออกก่อน นะครับ ที่เจอ คือ mcrypt กับ snmp)
#make
#make install
#cp php.ini-production /usr/lib64/php.ini
#reboot
ตรวจสอบอีกครั้ง
#[root@chi ~]# php -v
PHP 5.4.45 (cli) (built: Oct 30 2016 01:59:55)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
ติดตั้ง FFmpeg (ข้อมูลจาก https://chrisjean.com/install-ffmpeg-and-ffmpeg-php-on-centos-easily/)
#yum search ffmpeg
#yum install ffmpeg ffmpeg-devel ffmpeg-libpostproc
ตรวจสอบการทำงาน
[root@chi ~]# ffmpeg
ffmpeg version 2.2.1 Copyright (c) 2000-2014 the FFmpeg developers
built on Apr 13 2014 13:00:18 with gcc 4.4.6 (GCC) 20120305 (Red Hat 4.4.6-4)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --enable-runtime-cpudetect --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --enable-pthreads --enable-x11grab --enable-vdpau --disable-avisynth --enable-frei0r --enable-libopencv --enable-libdc1394 --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --disable-stripping
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libswscale 2. 5.102 / 2. 5.102
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
Use -h to get full help or, even better, run 'man ffmpeg'
ตรวจสอบตอนนี้ จะพบว่า ffmpeg ผ่านแล้ว
ติดตั้ง MP4Box (ที่มา https://thoaimedia.com/how-to-install-mp4box-on-centos/)
#yum -y install freetype-devel SDL-devel freeglut-devel
ดาวน์โหลดไฟล์
#cd /usr/local/src/
#wget http://mirror.ffmpeginstaller.com/source/gpac/gpac-0.5.0.tar.gz
#wget http://mirror.ffmpeginstaller.com/source/gpac/gpac_extra_libs-0.5.0.zip
แตกไฟล์
#tar -zxvf gpac-0.5.0.tar.gz
#unzip gpac_extra_libs-0.5.0.zip
ติดตั้ง
#cd extra_libs
#cp -r * /usr/local/src/gpac/extra_lib
#cd ..
#cd gpac
#chmod 755 configure
#./configure
#make lib
#make apps
#make install lib
#make install
#cp bin/gcc/libgpac.so /usr/lib
#install -m644 bin/gcc/libgpac.so /usr/local/lib/libgpac.so
#chmod +x /usr/local/lib/libgpac.so
#ldconfig
ทดสอบ
[root@server ~]# which MP4Box
/usr/local/bin/MP4Box
[root@server ~]# /usr/local/bin/MP4Box -version
MP4Box - GPAC version 0.5.0-rev4065
GPAC Copyright: (c) Jean Le Feuvre 2000-2005
(c) ENST 2005-200X
GPAC Configuration:
Features: GPAC_HAS_SSL GPAC_HAS_JPEG GPAC_HAS_PNG
ทดสอบ reboot
ไม่ได้ผล
วิธีที่ 2 ใช้ Git
#vim mp4box.sh
เพิ่มข้อมูลนี้เข้าไปในไฟล์
#Comment Install MP4Box on Centos 6
git clone https://github.com/gpac/gpac
git checkout 97eaffd
./configure
make all
sudo make install-lib install
echo "/usr/local/lib" >> /etc/ld.so.conf.d/gpac.conf
sudo /sbin/ldconfig
ติดตั้ง ImageMagick
#yum install -y gcc php-devel php-pear
#yum install ImageMagick
#yum install -y ImageMagick ImageMagick-devel
#yum install ImageMagick-perl
#pecl install imagick
# php -m | grep imagick
imagick
วิธีลงจาก Source Code
#yum -y groupinstall 'Development Tools'
#yum -y install bzip2-devel freetype-devel libjpeg-devel libpng-devel libtiff-devel giflib-devel zlib-devel ghostscript-devel djvulibre-devel libwmf-devel jasper-devel libtool-ltdl-devel libX11-devel libXext-devel libXt-devel lcms-devel libxml2-devel librsvg2-devel OpenEXR-devel php-devel
#tar xvzf ImageMagick.tar.gz
#cd ImageMagick*
#./configure
#make
#make install
คู่มืออื่น ๆ
http://www.cpanelkb.net/install-ffmpeg-mplayer-mencoder-mp4box-flvtool2/
http://discourse.clipbucket.com/t/100-work-how-to-install-mediainfo-on-centos-6/2487
https://www.unixmen.com/setup-your-own-youtube-clone-website-using-clipbucket/
http://discourse.clipbucket.com/t/install-guide-centos-6-x-ffmpeg-mp4-flv-mplayer-clipbucket-extras/142/2
http://www.zarinews.com/how-to-install-clipbucket-centos/

ไม่มีความคิดเห็น:

แสดงความคิดเห็น