cenos 6.4下安装phpmotion

分类:CentOS教程 阅读:18561 次

一 安装LAMP
二 安装转码工具

(一)安装ffmpeg。

安装yasm

  1. wgethttp://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
  2. tarxzvfyasm-1.2.0.tar.gz
  3. cdyasm-1.2.0
  4. ./configure
  5. make
  6. makeinstall
  7. makedistclean
  8. .~/.profile

wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz tar xzvf yasm-1.2.0.tar.gz cd yasm-1.2.0 ./configure make make install make distclean . ~/.profile
安装x264

  1. gitclone--depth1git://git.videolan.org/x264.git
  2. cdx264
  3. ./configure--enable-static
  4. make
  5. makeinstall
  6. makedistclean
 git clone --depth 1 git://git.videolan.org/x264.git cd x264 ./configure --enable-static make make install make distclean

安装fdk-aac
  1. gitclone--depth1git://github.com/mstorsjo/fdk-aac.git
  2. cdfdk-aac
  3. autoreconf-fiv
  4. ./configure--disable-shared
  5. make
  6. makeinstall
  7. makedistclean
 git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git cd fdk-aac autoreconf -fiv ./configure --disable-shared make make install make distclean 

安装libmp3lame

  1. sudoapt-getinstallnasm
  2. wgethttp://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
  3. tarxzvflame-3.99.5.tar.gz
  4. cdlame-3.99.5
  5. ./configure--enable-nasm--disable-shared
  6. make
  7. makeinstall
  8. makedistclean

sudo apt-get install nasm wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz tar xzvf lame-3.99.5.tar.gz cd lame-3.99.5 ./configure --enable-nasm --disable-shared make make install make distclean


安装libopus

  1. wgethttp://downloads.xiph.org/releases/opus/opus-1.0.3.tar.gz
  2. tarxzvfopus-1.0.3.tar.gz
  3. cdopus-1.0.3
  4. ./configure--disable-shared
  5. make
  6. makeinstall
  7. makedistclean

wget http://downloads.xiph.org/releases/opus/opus-1.0.3.tar.gz tar xzvf opus-1.0.3.tar.gz cd opus-1.0.3 ./configure --disable-shared make make install make distclean
安装libvpx

  1. gitclone--depth1http://git.chromium.org/webm/libvpx.git
  2. cdlibvpx
  3. ./configure--prefix="/opt/ffmpeg_sources/ffmpeg_build"--disable-examples
  4. make
  5. makeinstall
  6. makeclean
 git clone --depth 1 http://git.chromium.org/webm/libvpx.git cd libvpx ./configure --prefix="/opt/ffmpeg_sources/ffmpeg_build" --disable-examples make make install make clean

安装other
  1. yuminstalllibx11-devlibxext-devlibXfixes-devlibvorbis-devlibtheora-devlibass-dev
 yum install libx11-dev libxext-dev libXfixes-dev libvorbis-dev libtheora-dev libass-dev


安装ffmpeg
  1. gitclone--depth1git://source.ffmpeg.org/ffmpeg
  2. cdffmpeg
  3. ./configure--extra-libs="-ldl"--enable-gpl--enable-libass–enable-libfdk-aac--enable-libmp3lame--enable-libopus--enable-libtheora--enable-libvorbis--enable-libvpx--enable-libx264--enable-nonfree--enable-x11grab
  4. make
  5. makeinstall
  6. makedistclean
 git clone --depth 1 git://source.ffmpeg.org/ffmpeg cd ffmpeg ./configure --extra-libs="-ldl" --enable-gpl --enable-libass –enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab make make install make distclean


(二)安装mencoder、flvtool2等
  1. yumcleanall
  2. rpm-Uhvhttp://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
  3. yuminstallmencoderflvtool2
 yum clean all rpm -Uhv http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm yum install mencoder flvtool2

(三)创建数据库eduVMS
  1. mysql-uroot-p;
  2. createdatabaseeduVMS;
 mysql -uroot -p; create database eduVMS;

(四)将phpmotion源文件复制到apache目录下。
(五)修改phpmotion文件及子文件的目录权限。
  1. chownapache:apache-Rphpmotion;
 chown apache:apache -R phpmotion;

(六)安装配置PHPshield
1、查看php版本。
  1. Php-v
 Php -v

2、查看系统架构
  1. uname-i
 uname -i

3、查看系统中php的扩展目录
  1. php-i|grepextension_dir
 php -i|grep extension_dir

输出类似于:extension_dir => /usr/lib64/php/modules => /usr/lib64/php/modules
4、CD到上面输出的目录
  1. cd/usr/lib64/php/modules
 cd /usr/lib64/php/modules

5、将phpmotion/phpshield中对应的系统架构目录和相应版本的文件复制到当前目录中。并去掉后缀.lin。例如:
  1. cp/var/www/html/phpmotion/phpshield/Linux_x86-64/ixed.5.3.lin./ixed.5.3
 cp /var/www/html/phpmotion/phpshield/Linux_x86-64/ixed.5.3.lin ./ixed.5.3

6、通过php -i|grep php.ini命令找到php.ini文件,编辑php.ini文件,添加extension=ixed.5.3
7、重启apache
  1. /etc/init.d/httpdrestart
 /etc/init.d/httpd restart

(七)配置虚拟主机
编辑/etc/httpd/conf/httpd.conf文件。
  1. vim/etc/httpd/conf/httpd.conf
 vim /etc/httpd/conf/httpd.conf


修改如下:
1添加apache监听的IP地址和端口号:在Listen 80下面添加Listen 90
2添加文件目录设置
  1. <Directory"/var/www/html/phpmotion">
  2. OptionsIncludesExecCGIFollowSymLinks
  3. AllowOverrideAll
  4. Orderallow,deny
  5. Allowfromall
  6. </Directory>
 <Directory "/var/www/html/phpmotion"> Options Includes ExecCGI FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory>


3、添加虚拟主机
  1. <VirtualHost10.10.90.210:90>
  2. DocumentRoot"/var/www/html/phpmotion"
  3. ServerNamewww.eduvideo.com
  4. </VirtualHost>
 <VirtualHost 10.10.90.210:90> DocumentRoot "/var/www/html/phpmotion" ServerName www.eduvideo.com </VirtualHost>


4、配置cgi。去掉注释AddHandler cgi-script .cgi
5、关闭SELinux
  1. setenforce0
 setenforce 0

6、重启apache
  1. /etc/init.d/httpdrestart
 /etc/init.d/httpd restart

(八)将/phpmotion/cgi-bin中的所有文件复制到/var/www/cgi-bin中,并修改权限为755


  1. cp-r*/var/www/html/phpmotion/cgi-bin/*/var/www/cgi-bin
  2. chmod755-R/var/www/cgi-bin/*
 cp -r * /var/www/html/phpmotion/cgi-bin/* /var/www/cgi-bin chmod 755 -R /var/www/cgi-bin/*

(九)用浏览器进入系统进行设置
1、浏览器中输入ip:port。例如:10.10.90.210:90
2、点击continue按钮,进入step2。发现PHP enable_dl为叉,那么修改php.ini,将enable_dl配置为On
  1. vim/etc/php.ini
 vim /etc/php.ini

修改后,重启apache,刷新浏览器,点击continue。
3、点击continue,配置数据库信息:
4、点击continue。配置系统信息。
5、点击continue,删除phpmotion目录下的setup目录。

  1. rm-rf/var/www/html/phpmotion/setup